Bug with insert/update and subqueries returning more than 1 row in MySQL-4.1

Bug with insert/update and subqueries returning more than 1 row in MySQL-4.1

am 28.11.2002 02:05:35 von Jocelyn Fournier

Hi,

How-to-repeat :

CREATE TABLE `t` (
`id` int(11) default NULL,
KEY `id` (`id`)
) TYPE=MyISAM CHARSET=latin1

INSERT INTO t VALUES (1),(1);

mysql> INSERT INTO t VALUES ((SELECT * FROM t));
Query OK, 1 row affected (0.00 sec)

=> It should display "ERROR 1239: Subselect returns more than 1 row" ?

mysql> SELECT * FROM t;
+------+
| id |
+------+
| NULL |
| 1 |
| 1 |
+------+
3 rows in set (0.00 sec)

CREATE TABLE `t1` (
`id` int(11) default NULL,
KEY `id` (`id`)
) TYPE=MyISAM CHARSET=latin1

INSERT INTO t1 (1),(1);

mysql> UPDATE t SET id=(SELECT * FROM t1);
Query OK, 2 rows affected (0.00 sec)
Rows matched: 3 Changed: 2 Warnings: 0

=> t1 returns more than 1 row, and id will be set to NULL in t

mysql> SELECT * FROM t;
+------+
| id |
+------+
| NULL |
| NULL |
| NULL |
+------+
3 rows in set (0.00 sec)

Regards,
Jocelyn

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13138@lists.mysql.com
To unsubscribe, e-mail

Re: Bug with insert/update and subqueries returning more than 1

am 28.11.2002 12:35:32 von Alexander Keremidarski

Hello Jocelyn,

I was able to reproduce this wo we will investigate it, but there were
some small differences.

How your MySQL 4.1 is compiled? With or without debug?


--
For technical support contracts, visit https://order.mysql.com/?ref=msal
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Alexander Keremidarski
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Sofia, Bulgaria
<___/ www.mysql.com



------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13140@lists.mysql.com
To unsubscribe, e-mail

Re: Bug with insert/update and subqueries returning more than 1row in MySQL-4.1

am 28.11.2002 12:37:12 von Jocelyn Fournier

Hi !

I'm compiling MySQL without debug (I'm using compile-pentium script).

Jocelyn
----- Original Message -----
From: "Alexander Keremidarski"
To: "Jocelyn Fournier"
Cc:
Sent: Thursday, November 28, 2002 11:35 AM
Subject: Re: Bug with insert/update and subqueries returning more than 1row
in MySQL-4.1


> Hello Jocelyn,
>
> I was able to reproduce this wo we will investigate it, but there were
> some small differences.
>
> How your MySQL 4.1 is compiled? With or without debug?
>
>
> --
> For technical support contracts, visit https://order.mysql.com/?ref=msal
> __ ___ ___ ____ __
> / |/ /_ __/ __/ __ \/ / Mr. Alexander
Keremidarski
> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
> /_/ /_/\_, /___/\___\_\___/ Sofia, Bulgaria
> <___/ www.mysql.com
>
>
>
>
>


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13141@lists.mysql.com
To unsubscribe, e-mail

Re: Bug with insert/update and subqueries returning more than 1 row in MySQL-4.1

am 01.12.2002 10:39:57 von Sanja Byelkin

Hi!

On Fri, Nov 29, 2002 at 01:07:57AM -0000, Jocelyn Fournier wrote:
> Hi,
>
> How-to-repeat :
>
> CREATE TABLE `t` (
> `id` int(11) default NULL,
> KEY `id` (`id`)
> ) TYPE=MyISAM CHARSET=latin1
>
> INSERT INTO t VALUES (1),(1);
>
> mysql> INSERT INTO t VALUES ((SELECT * FROM t));
> Query OK, 1 row affected (0.00 sec)
>
> => It should display "ERROR 1239: Subselect returns more than 1 row" ?
>
> mysql> SELECT * FROM t;
> +------+
> | id |
> +------+
> | NULL |
> | 1 |
> | 1 |
> +------+
> 3 rows in set (0.00 sec)
>
> CREATE TABLE `t1` (
> `id` int(11) default NULL,
> KEY `id` (`id`)
> ) TYPE=MyISAM CHARSET=latin1
>
> INSERT INTO t1 (1),(1);
>
> mysql> UPDATE t SET id=(SELECT * FROM t1);
> Query OK, 2 rows affected (0.00 sec)
> Rows matched: 3 Changed: 2 Warnings: 0
>
> => t1 returns more than 1 row, and id will be set to NULL in t
>
> mysql> SELECT * FROM t;
> +------+
> | id |
> +------+
> | NULL |
> | NULL |
> | NULL |
> +------+
> 3 rows in set (0.00 sec)

Thank you for bug report, 2 bugs above are fixed (patches committed &
pushed)

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13169@lists.mysql.com
To unsubscribe, e-mail