Union doesn't work on single innodb table

Incomplete results are returned when the union of two columns of the same
innodb table is selected.

It works fine when the same union is performed on a myisam table.
It also works fine when selecting a union from two separate innodb tables.
I'm using mysql 4.1.1 on red hat linux 9.0.

create table t1 (col1 tinyint unsigned, col2 tinyint unsigned) type=innodb;
create table t2 (col1 tinyint unsigned, col2 tinyint unsigned) type=innodb;

insert into t1 values (1,2),(3,4),(5,6),(7,8),(9,10);
insert into t2 values (1,2),(3,4),(5,6),(7,8),(9,10);

This is the bug. It should return 10 rows:

select col1 n from t1 union select col2 n from t1 order by n;
+------+
| n |
+------+
| NULL |
| 2 |
| 4 |
| 6 |
| 8 |
| 10 |
+------+
6 rows in set (0.00 sec)

Works fine with two innodb tables:

select col1 n from t1 union select col2 n from t2 order by n;
+------+
| n |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
+------+
10 rows in set (0.00 sec)

Works fine with a single myisam table:

alter table t1 type=myisam;
select col1 n from t1 union select col2 n from t1 order by n;
+------+
| n |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
+------+
10 rows in set (0.00 sec)

Thanks,
Jeremy March

____________________________________________________________ _____
There are now three new levels of MSN Hotmail Extra Storage! Learn more.
http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Jeremy March [ So, 25 Januar 2004 04:11 ] [ ID #83027 ]

Re: Union doesn't work on single innodb table

Jeremy March writes:
> Incomplete results are returned when the union of two columns of the same
> innodb table is selected.
>
> It works fine when the same union is performed on a myisam table.
> It also works fine when selecting a union from two separate innodb tables.
> I'm using mysql 4.1.1 on red hat linux 9.0.
>

[skip]

>
> Thanks,
> Jeremy March
>

Hi!

Thank you very much for your fine bug report.

We were aware of that bug, we fixed it last week and it is now in our
4.1.2 repository.

--

Sincerely,

--
For technical support contracts, go to https://order.mysql.com/?ref=msmi
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <sinisa [at] mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB
/_/ /_/\_, /___/\___\_\___/ Fulltime Developer and Support Coordinator
<___/ www.mysql.com Larnaca, Cyprus

Want to swim with the dolphins? (April 14-16, 2004)
http://www.mysql.com/uc2004/


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Sinisa Milivojevic [ Mo, 26 Januar 2004 13:27 ] [ ID #83030 ]
Datenbanken » gmane.comp.db.mysql.bugs » Union doesn't work on single innodb table

Vorheriges Thema: fedora core 1
Nächstes Thema: Disgusting propaganda.