3 messages in com.mysql.lists.bugsRe: Bug in Union?!| From | Sent On | Attachments |
|---|---|---|
| Georg Richter | 22 Dec 2002 07:07 | |
| Sinisa Milivojevic | 23 Dec 2002 12:16 | |
| Sinisa Milivojevic | 24 Dec 2002 10:41 |
| Subject: | Re: Bug in Union?!![]() |
|---|---|
| From: | Sinisa Milivojevic (sin...@mysql.com) |
| Date: | 12/24/2002 10:41:38 AM |
| List: | com.mysql.lists.bugs |
Georg Richter writes:
On Monday 23 December 2002 21:16, you wrote:
Hi!
I do not think that mixing UNION with and without braces should be allowed. For many reasons, although standard is not clear on this one.
Hello Sinisa,
unfortunately currently I don't have the time to test your fix (Kirsten's family is here during the christmas time, so I have to try not to spend too much time in front of my PC :). I'll check your fix after Dec 25th.
The sample also fails when I don't mix parenthesis/braces:
SELECT foo from bar limit 1,1 union select foo from bar limit 3,1 returns an empty resultset too.
I wish you and your family a merry christmas!
Regards
Georg
Hi Georg,
You were quite right, as you have hit a veritable bug.
One more reason, why forcing consistent usage / not-usage of braces is mandatory.
This is a fix for the bug.
==== sql/sql_union.cc 1.55 vs edited ===== *** /tmp/sql_union.cc-1.55-1877 Sat Dec 14 15:15:17 2002 --- edited/sql/sql_union.cc Tue Dec 24 20:36:12 2002 *************** *** 279,287 **** } if (!thd->fatal_error) // Check if EOM { ! offset_limit_cnt= global_parameters->offset_limit; ! select_limit_cnt= global_parameters->select_limit+ ! global_parameters->offset_limit; if (select_limit_cnt < global_parameters->select_limit) select_limit_cnt= HA_POS_ERROR; // no limit if (select_limit_cnt == HA_POS_ERROR) --- 279,288 ---- } if (!thd->fatal_error) // Check if EOM { ! SELECT_LEX *sl=thd->lex.current_select->master_unit()->first_select(); ! offset_limit_cnt= (sl->braces) ? global_parameters->offset_limit : 0; ! select_limit_cnt= (sl->braces) ? global_parameters->select_limit+ ! global_parameters->offset_limit : HA_POS_ERROR; if (select_limit_cnt < global_parameters->select_limit) select_limit_cnt= HA_POS_ERROR; // no limit if (select_limit_cnt == HA_POS_ERROR)
For the filter:
How-to-repeat:
Fix:
Happy Christmas to you and your family too !!!
-- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <sin...@mysql.com> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus <___/ www.mysql.com
Join MySQL Users Conference and Expo: http://www.mysql.com/events/uc2003/




