Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-2968

LP:643424 - mysqld: protocol.cc:507: void net_end_statement(THD*): Assertion `0' failed in maria-5.3-mwl89.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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]

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            philipstoev Philip Stoev added a comment -

            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;

            Show
            philipstoev Philip Stoev added a comment - 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;
            Hide
            timour Timour Katchaounov added a comment -

            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.

            Show
            timour Timour Katchaounov added a comment - 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.
            Hide
            timour Timour Katchaounov added a comment -

            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).

            Show
            timour Timour Katchaounov added a comment - 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).
            Hide
            philipstoev Philip Stoev added a comment -

            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)

            Show
            philipstoev Philip Stoev added a comment - 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)
            Hide
            philipstoev Philip Stoev added a comment -

            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

            Show
            philipstoev Philip Stoev added a comment - 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
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 643424

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 643424

              People

              • Assignee:
                timour Timour Katchaounov
                Reporter:
                philipstoev Philip Stoev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: