Crash in setup_tables in maria-5.3-mwl106
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Igor Babaev |
Bug Description
Not repeatable in maria-5.2, maria-5.3. Repeatable in maria-5.3-mwl106. Backtrace:
#5 0x0830314c in setup_tables (thd=0xa104738, context=0xae61375c, from_clause=
full_
#6 0x08303627 in setup_tables_
select_
#7 0x08316a22 in JOIN::prepare (this=0xae630030, rref_pointer_
order_init=0x0, group_init=0x0, having_init=0x0, proc_param_
#8 0x08468257 in st_select_
#9 0x0846b084 in mysql_derived_
#10 0x0846a6cf in mysql_handle_
#11 0x08314f7c in TABLE_LIST:
#12 0x0846a747 in mysql_handle_
#13 0x0834eb73 in mysql_prepare_
update_
#14 0x0834d3de in mysql_insert (thd=0xa104738, table_list=
ignore=false) at sql_insert.cc:669
#15 0x082ab4e4 in mysql_execute_
#16 0x082b419d in mysql_parse (thd=0xa104738, rawbuf=0xae612eb0 "INSERT INTO view3 SET field2 = 'i'", length=34, found_semicolon
at sql_parse.cc:6090
#17 0x082a657b in dispatch_command (command=COM_QUERY, thd=0xa104738, packet=0xa15eff9 "INSERT INTO view3 SET field2 = 'i' ", packet_length=35)
at sql_parse.cc:1206
#18 0x082a5a01 in do_command (thd=0xa104738) at sql_parse.cc:904
#19 0x082a2a7c in handle_
#20 0x00821919 in start_thread () from /lib/libpthread
#21 0x0076acce in clone () from /lib/libc.so.6
test case:
CREATE TABLE t1 (field1 integer);
--disable_
CREATE OR REPLACE ALGORITHM = MERGE VIEW view1 AS SELECT * FROM t1;
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW view4 AS SELECT * FROM t1;
CREATE OR REPLACE ALGORITHM = MERGE VIEW view2 AS SELECT * FROM view4;
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW view3 AS SELECT * FROM view1;
CREATE OR REPLACE ALGORITHM = MERGE VIEW view1 AS SELECT * FROM view2;
INSERT INTO view3 SET field2 = 'i' ;
Related branches
Changed in maria: | |
assignee: | nobody → Igor Babaev (igorb-seattle) |
milestone: | none → 5.3 |
Changed in maria: | |
status: | New → Confirmed |
importance: | Undecided → Critical |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
The following example demonstrates the problem:
MariaDB [test]> CREATE TABLE t1 (a int);
Query OK, 0 rows affected (0.02 sec)
MariaDB [test]> CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT * FROM t1;
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> CREATE ALGORITHM = TEMPTABLE VIEW v3 AS SELECT * FROM v2;
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> INSERT INTO v1 VALUES (1);
ERROR 1471 (HY000): The target table v1 of the INSERT is not insertable-into
MariaDB [test]> INSERT INTO v2 VALUES (1);
ERROR 1471 (HY000): The target table v2 of the INSERT is not insertable-into
MariaDB [test]> INSERT INTO v3 VALUES (1);
ERROR 2013 (HY000): Lost connection to MySQL server during query <-- !!!
while this test case works correctly:
MariaDB [test]> CREATE ALGORITHM = MERGE VIEW v4 AS SELECT * FROM t1;
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> CREATE ALGORITHM = TEMPTABLE VIEW v5 AS SELECT * FROM v4;
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> INSERT INTO v5 VALUES (1);
ERROR 1471 (HY000): The target table v5 of the INSERT is not insertable-into