Bug #7433 crash, VIEW on BASE TABLE LEFT OUTER JOIN simple VIEW
Submitted: 20 Dec 2004 16:25 Modified: 3 Mar 2005 4:08
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0 OS:
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[20 Dec 2004 16:25] Matthias Leich
Description:
# test case derived from NIST script dml112
# TEST:0623 OUTER JOINs with NULLs and empty tables!
   CREATE TABLE JNULL1 (C1 INT, C2 INT);
   CREATE TABLE JNULL2 (C2 INT);

   CREATE VIEW JNULL4 AS SELECT C2 FROM JNULL2;

   CREATE VIEW JNULL6 AS
   SELECT C1 FROM JNULL1 LEFT OUTER JOIN JNULL4
   USING (C2);

   # This command crashes the server
   SELECT * FROM JNULL6;

If I replace JNULL4 with JNULL2 within the VIEW definition
of JNULL, the crash disappears.

My environment:
   - Intel PC with Linux(SuSE 9.1)
   - MySQL compiled from source
        Version 5.0 ChangeSet@1.1770, 2004-12-19

How to repeat:
Please use my attached test file ml68.test , copy it to mysql-test/t
  ./mysql-test-run ml68
[20 Dec 2004 16:27] Matthias Leich
test case

Attachment: ml68.test (application/test, text), 994 bytes.

[20 Dec 2004 19:38] Alexander Keremidarski
Verified with:
ChangeSet@1.1770, 2004-12-19 21:25:11+02:00, monty@mysql.com

#0  0x081b7d53 in st_table_list::set_ancestor() (this=0x8bd6930) at table.cc:1563
#1  0x081b7d17 in st_table_list::set_ancestor() (this=0x8bd5e18) at table.cc:1559
#2  0x08277052 in mysql_derived_prepare(THD*, st_lex*, st_table_list*) (thd=0x8bae870, lex=0x8bae8b0, orig_table_list=0x8bd5e18) at sql_derived.cc:187
#3  0x08276d41 in mysql_handle_derived(st_lex*, int (*)(THD*, st_lex*, st_table_list*)) (lex=0x8bae8b0, processor=0x8276d78 <mysql_derived_prepare(THD*, st_lex*, st_table_list*)>) at sql_derived.cc:58
#4  0x081b08b6 in open_and_lock_tables(THD*, st_table_list*) (thd=0x8bae870, tables=0x8bd5e18) at sql_base.cc:1849
#5  0x0818ea84 in mysql_execute_command(THD*) (thd=0x8bae870) at sql_parse.cc:2178
#6  0x08195777 in mysql_parse(THD*, char*, unsigned) (thd=0x8bae870, inBuf=0x8bd5d20 "SELECT * FROM JNULL6", length=146466992) at sql_parse.cc:4677
#7  0x0818d03f in dispatch_command(enum_server_command, THD*, char*, unsigned) (command=COM_QUERY, thd=0x8bae870, packet=0x8bcdcc1 "SELECT * FROM JNULL6", packet_length=21) at sql_parse.cc:1512
#8  0x0818c912 in do_command(THD*) (thd=0x8bae870) at sql_parse.cc:1320
#9  0x0818bcf5 in handle_one_connection (arg=0x8bd6930) at sql_parse.cc:1052
#10 0x493571d5 in start_thread () from /lib/tls/libpthread.so.0
#11 0x491d82da in clone () from /lib/tls/libc.so.6
(gdb)
[31 Jan 2005 8:45] Oleksandr Byelkin
ChangeSet
  1.1817 05/01/31 10:43:36 bell@sanja.is.com.ua +3 -0
  fixed problem in view over view setup (BUG#7433)
[24 Feb 2005 2:19] Oleksandr Byelkin
Thank you for bugreport!
Bugfix is pushed into 5.0.3 source repository.
[3 Mar 2005 4:08] Paul Dubois
Noted in 5.0.3 changelog.