>Description:

Take two tables (call them a and b), which have identical structures.  Table a
has no rows, table b has some (say 10) rows.  If you do this:

select * from a union select * from b limit 0,5

It works as expected.  Now do this: 

select * from a union select * from b limit 5,5

Now you get _zero_ rows.   In version 4.0.0, this worked as expected. 

>How-To-Repeat:

mysql> desc a; desc b;
+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| data  | varchar(50) | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
1 row in set (0.00 sec)

+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| data  | varchar(50) | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> select count(*) from a; select count(*) from b;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

+----------+
| count(*) |
+----------+
|       10 |
+----------+
1 row in set (0.00 sec)

mysql> select * from b;
+------+
| data |
+------+
| 1    |
| 2    |
| 3    |
| 4    |
| 5    |
| 6    |
| 7    |
| 8    |
| 9    |
| 10   |
+------+
10 rows in set (0.00 sec)

mysql> select * from a union select * from b limit 0,5;
+------+
| data |
+------+
| 1    |
| 2    |
| 3    |
| 4    |
| 5    |
+------+
5 rows in set (0.00 sec)

mysql> select * from a union select * from b limit 5,5;
Empty set (0.00 sec)

mysql> 

>Fix:

 None known.

>Submitter-Id:  
>Originator:    Eric Poulsen
>Organization:
 
>MySQL support: none
>Synopsis:      Union + Limit issue in 4.0.1 Alpha
>Severity:      non-critical
>Priority:      medium  
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-4.0.1-alpha (Official MySQL binary)

>Environment:
        
System: Linux webserver1 2.4.17 #1 SMP Thu Jan 10 11:10:31 PST 2002 i686 unknown
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
Compilation info: CC='gcc'  CFLAGS='-O3 -mpentium '  CXX='gcc'  CXXFLAGS='-O3 
-mpentium  -felide-constructors'  LDFLAGS='-static'
LIBC: 
lrwxrwxrwx    1 root     root           14 Mar 13 11:25 /lib/libc.so.5 -> 
libc.so.5.4.46
-rw-r--r--    1 root     root       586720 Feb  8  1999 /lib/libc.so.5.4.46
lrwxrwxrwx    1 root     root           13 Jan 17 20:08 /lib/libc.so.6 -> libc-2.1.3.so
-rwxr-xr-x    1 root     root       888064 Jan 17 20:08 /lib/libc-2.1.3.so
-rw-r--r--    1 root     root      2090000 Jan  9 07:11 /usr/lib/libc.a
-rw-r--r--    1 root     root          178 Jan  9 07:11 /usr/lib/libc.so
Configure command: ./configure  --prefix=/usr/local/mysql '--with-comment=Official 
MySQL binary' --with-extra-charsets=complex --with-server-suffix= 
--enable-thread-safe-client --enable-assembler --with-mysqld-ldflags=-all-static 
--with-client-ldflags=-all-static --disable-shared
Perl: This is perl, version 5.005_03 built for i386-linux

---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to