Bug in SUBSELECT with LIMIT

Bug in SUBSELECT with LIMIT

am 22.12.2002 22:47:11 von Georg Richter

Hi,

looks like LIMIT will be ignored in Subselect.

how-to-repeat:

mysql> create table a (a int);
Query OK, 0 rows affected (0.00 sec)

mysql> create table b (a int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into a values (1),(2),(3),(4),(5);
Query OK, 5 rows affected (0.00 sec)
Records: 5 Duplicates: 0 Warnings: 0

mysql> insert into b values (1),(2),(3),(4),(5);
Query OK, 5 rows affected (0.00 sec)
Records: 5 Duplicates: 0 Warnings: 0

mysql> select a from a where a in (SELECT a from b limit 2);
+------+
| a |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
+------+
5 rows in set (0.00 sec)

Regards

Georg

------------------------------------------------------------ ---------
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-thread13343@lists.mysql.com
To unsubscribe, e-mail

Re: Bug in SUBSELECT with LIMIT

am 23.12.2002 00:59:17 von Georg Richter

On Sunday 22 December 2002 22:47, Georg Richter wrote:

sorry. this bug is bogus/submitted twice, Jocelyn just informed me, that he
reported this bug/problem already (but it's still open).

Regards

Georg

------------------------------------------------------------ ---------
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-thread13344@lists.mysql.com
To unsubscribe, e-mail

Re: Bug in SUBSELECT with LIMIT

am 23.12.2002 14:46:17 von Sanja Byelkin

Hi!

On Sun, Dec 22, 2002 at 10:47:11PM +0100, Georg Richter wrote:
[skip]
> looks like LIMIT will be ignored in Subselect.
>
> how-to-repeat:
>
> mysql> create table a (a int);
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> create table b (a int);
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> insert into a values (1),(2),(3),(4),(5);
> Query OK, 5 rows affected (0.00 sec)
> Records: 5 Duplicates: 0 Warnings: 0
>
> mysql> insert into b values (1),(2),(3),(4),(5);
> Query OK, 5 rows affected (0.00 sec)
> Records: 5 Duplicates: 0 Warnings: 0
>
> mysql> select a from a where a in (SELECT a from b limit 2);
> +------+
> | a |
> +------+
> | 1 |
> | 2 |
> | 3 |
> | 4 |
> | 5 |
> +------+
> 5 rows in set (0.00 sec)

Thank you for bugreport.
Yes. Limit is not implemented in IN/ALL/ANY/SOME subselects. I will make error
message for it which will be removed when LIMIT will be supported.

--
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-thread13345@lists.mysql.com
To unsubscribe, e-mail