Bug 21897 - LEFT JOIN RESTARTS MYSQL
Summary: LEFT JOIN RESTARTS MYSQL
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mysql
Version: 7.0
Hardware: i386
OS: Linux
high
medium
Target Milestone: ---
Assignee: Patrick Macdonald
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-12-07 17:09 UTC by Martin Pedak
Modified: 2007-03-27 03:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-12-14 18:41:11 UTC
Embargoed:


Attachments (Terms of Use)
database dump for testing the left join crash. (Note the 2 left joins to one table) (5.09 KB, text/plain)
2000-12-14 18:18 UTC, Martin Pedak
no flags Details
SQL query that does the crash. (804 bytes, text/plain)
2000-12-14 18:19 UTC, Martin Pedak
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2000:133 0 normal SHIPPED_LIVE Updated mysql packages available for Red Hat Linux 7 2000-12-19 05:00:00 UTC

Description Martin Pedak 2000-12-07 17:09:15 UTC
When you do LEFT JOIN ower several tables (in my case 7) and when (at 
least i think) one of them contains no rows at all, mysql gets: 

ERROR 2013: Lost connection to MySQL server during query

and to mysql error log appears :
mysqld process hanging, pid 7198 - killed
001207 19:03:31  mysqld restarted
/usr/libexec/mysqld: ready for connections

HERE is my sql query:
select distinct tootaja.uid as tootid, broneering.uid as bronid, 
broneeritud_objekt.uid as bronobid, teenus.uid as teenid, 
teenusepakett.uid as tpakkid, SUM(teenus.hind) as thind, SUM
(teenus_teenusepakett.hind) as tphind, teenus.ajakulu as tkulu, 
teenusepakett.ajakulu as tpkulu from tootaja left join broneering on 
tootaja.uid=broneering.tootaja_id left join broneeritud_objekt on 
broneering.uid=broneeritud_objekt.broneering_id left join teenus on 
broneeritud_objekt.teenus_id=teenus.uid left join teenusepakett on 
broneeritud_objekt.teenusepakett_id=teenusepakett.uid left join 
teenus_teenusepakett on 
teenusepakett.uid=teenus_teenusepakett.teenusepakett_id left join 
teenus_teenusepakett as ttpp on teenus.uid=ttpp.teenus_id where 
tootaja.uid=1 and broneering.uid=1 group by broneeritud_objekt.uid;

AND WHERE all the tables contained at least 1 row ecxept one 
(teenusepakett)
mysql> select count(*) from teenusepakett;
+----------+
| count(*) |
+----------+
|        0 |
+----------+

Comment 1 Trond Eivind Glomsrxd 2000-12-07 20:16:56 UTC
1) Would it be possible for you to make a test script, like the ones to
   http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=19604
   More data is needed, as we need to be able to reproduce the bug in order
   to fix (and verify a fix) for it.

2) Could you try the MySQL packages currently in Rawhide?

Comment 2 Trond Eivind Glomsrxd 2000-12-14 17:11:49 UTC
Do you have a testcase?

Comment 3 Martin Pedak 2000-12-14 18:18:09 UTC
Created attachment 6412 [details]
database dump for testing the left join crash. (Note the 2 left joins to one table)

Comment 4 Martin Pedak 2000-12-14 18:19:44 UTC
Created attachment 6413 [details]
SQL query that does the crash.

Comment 5 Trond Eivind Glomsrxd 2000-12-14 18:40:56 UTC
Thanks a lot - I can reproduce it. Will look into it.

Comment 6 Trond Eivind Glomsrxd 2000-12-18 21:32:16 UTC
This should be fixed in 3.23.29-0.1 and newer, coming soon to a Rawhide near
you. For a few days, you can also pick it up at http://people.redhat.com/teg/db/


Note You need to log in before you can comment on or make changes to this bug.