[MDEV-2968] LP:643424 - mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed in maria-5.3-mwl89. Created: 2010-09-20  Updated: 2015-02-02  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Philip Stoev (Inactive) Assignee: Timour Katchaounov (Inactive)
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug643424.xml    

 Description   

The following query:

SELECT `pk`
FROM C
WHERE ( `col_int_key` , `col_int_nokey` ) IN (
SELECT `col_int_key` , `col_int_key`
FROM B ) ;

produces the following assertion in maria-5.3-mwl89. Maria-5.3 is not affected.

mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed.

backtrace:

/lib/libc.so.6(__assert_fail+0xf8) [0x133d98]
/home/philips/bzr/maria-5.3-mwl89/sql/mysqld(net_end_statement(THD*)+0x1ec) [0x82742e3]
/home/philips/bzr/maria-5.3-mwl89/sql/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0x19c1) [0x8290870]
/home/philips/bzr/maria-5.3-mwl89/sql/mysqld(do_command(THD*)+0x273) [0x828ec18]
/home/philips/bzr/maria-5.3-mwl89/sql/mysqld(handle_one_connection+0x152) [0x828bd78]



 Comments   
Comment by Philip Stoev (Inactive) [ 2010-09-20 ]

Re: mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed.
Test case:

--disable_abort_on_error
SET SESSION optimizer_switch = 'index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=off,table_elimination=on';
--enable_abort_on_error

CREATE TABLE `C` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_int_nokey` int(11) DEFAULT NULL,
`col_int_key` int(11) DEFAULT NULL,
`col_varchar_key` varchar(1) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_int_key` (`col_int_key`),
KEY `col_varchar_key` (`col_varchar_key`,`col_int_key`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
INSERT INTO `C` VALUES (1,NULL,2,'w');
INSERT INTO `C` VALUES (2,7,9,'m');
INSERT INTO `C` VALUES (3,9,3,'m');
INSERT INTO `C` VALUES (4,7,9,'k');
INSERT INTO `C` VALUES (5,4,NULL,'r');
INSERT INTO `C` VALUES (6,2,9,'t');
INSERT INTO `C` VALUES (7,6,3,'j');
INSERT INTO `C` VALUES (8,8,8,'u');
INSERT INTO `C` VALUES (9,NULL,8,'h');
INSERT INTO `C` VALUES (10,5,53,'o');
INSERT INTO `C` VALUES (11,NULL,0,NULL);
INSERT INTO `C` VALUES (12,6,5,'k');
INSERT INTO `C` VALUES (13,188,166,'e');
INSERT INTO `C` VALUES (14,2,3,'n');
INSERT INTO `C` VALUES (15,1,0,'t');
INSERT INTO `C` VALUES (16,1,1,'c');
INSERT INTO `C` VALUES (17,0,9,'m');
INSERT INTO `C` VALUES (18,9,5,'y');
INSERT INTO `C` VALUES (19,NULL,6,'f');
INSERT INTO `C` VALUES (20,4,2,'d');
CREATE TABLE `B` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_int_nokey` int(11) DEFAULT NULL,
`col_int_key` int(11) DEFAULT NULL,
`col_varchar_key` varchar(1) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_int_key` (`col_int_key`),
KEY `col_varchar_key` (`col_varchar_key`,`col_int_key`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
INSERT INTO `B` VALUES (1,1,7,'f');

SELECT `pk`
FROM C
WHERE ( `col_int_key` , `col_int_nokey` ) IN (
SELECT `col_int_key` , `col_int_key`
FROM B ) ;

DROP TABLE C;
DROP TABLE B;

Comment by Timour Katchaounov (Inactive) [ 2010-09-30 ]

Re: mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed in maria-5.3-mwl89.
Appears to be fixed in the latest 5.3-mwl89.

Comment by Timour Katchaounov (Inactive) [ 2010-10-26 ]

Re: mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed in maria-5.3-mwl89.
Actually I was not able to reproduce this bug with an old version of 5.3-mwl89 (tried a version from early September).

Comment by Philip Stoev (Inactive) [ 2010-10-26 ]

Re: mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed in maria-5.3-mwl89.
The test case prduces Valgrind warnings:

==4141== Conditional jump or move depends on uninitialised value(s)
==4141== at 0x830C0BB: get_partial_join_cost(JOIN*, unsigned int, double*, double*) (sql_select.cc:5455)
==4141== by 0x83BE20F: JOIN::choose_subquery_plan(unsigned long long) (opt_subselect.cc:3683)
==4141== by 0x83068CB: make_join_statistics(JOIN*, TABLE_LIST*, Item*, st_dynamic_array*) (sql_select.cc:3113)
==4141== by 0x82FE7C9: JOIN::optimize() (sql_select.cc:931)
==4141== by 0x81A721E: st_select_lex::optimize_unflattened_subqueries() (sql_lex.cc:3115)
==4141== by 0x83BDEB4: JOIN::optimize_unflattened_subqueries() (opt_subselect.cc:3577)
==4141== by 0x82FFBCE: JOIN::optimize() (sql_select.cc:1280)
==4141== by 0x83042B2: mysql_select(THD*, Item**, TABLE_LIST, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:2549)
==4141== by 0x82FCA4E: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:276)
==4141== by 0x829B16F: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5081)
==4141== by 0x8291B4F: mysql_execute_command(THD*) (sql_parse.cc:2265)
==4141== by 0x829D350: mysql_parse(THD*, char const*, unsigned int, char const**) (sql_parse.cc:6027)
==4141== by 0x828F581: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1184)
==4141== by 0x828EA27: do_command(THD*) (sql_parse.cc:890)
==4141== by 0x828BB87: handle_one_connection (sql_connect.cc:1153)
==4141== by 0xBEA918: start_thread (in /lib/libpthread-2.12.so)

Comment by Philip Stoev (Inactive) [ 2010-10-26 ]

Re: mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed in maria-5.3-mwl89.
The valgrind warnings are not reproducible in 5.3-main . Reproducible in maria-5.3-mwl89

Comment by Rasmus Johansson (Inactive) [ 2010-11-02 ]

Launchpad bug id: 643424

Generated at Thu Feb 08 06:45:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.