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

spider plugin init failure with no_zero_date sql_mode

Details

    Description

      Splitted from a case from Roel's comment in MDEV-33242[1], reproducible in 10.5 and 10.6 53c6c823dc7cafefffdc93c79661cfb146ff8641

      set global sql_mode=(SELECT CONCAT (@@sql_mode,',no_zero_date'));
      install soname 'ha_spider';
      

      [1] https://jira.mariadb.org/browse/MDEV-33242?focusedCommentId=280426&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-280426

      Attachments

        Issue Links

          Activity

            ycp Yuchen Pei created issue -
            ycp Yuchen Pei made changes -
            Field Original Value New Value
            ycp Yuchen Pei made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            ycp Yuchen Pei made changes -
            Description Splitted from a case from Roel's comment in MDEV-33242[1], reproducible in 10.5 and 10.6 53c6c823dc7cafefffdc93c79661cfb146ff8641

            {code:sql}
            set global sql_mode=(SELECT CONCAT (@@sql_mode,',no_zero_date'));
            install soname 'ha_spider';
            {code}

            [1] https://jira.mariadb.org/browse/MDEV-33242?focusedCommentId=280426&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-280426
            Splitted from a case from [~Roel]'s comment in MDEV-33242[1], reproducible in 10.5 and 10.6 53c6c823dc7cafefffdc93c79661cfb146ff8641

            {code:sql}
            set global sql_mode=(SELECT CONCAT (@@sql_mode,',no_zero_date'));
            install soname 'ha_spider';
            {code}

            [1] https://jira.mariadb.org/browse/MDEV-33242?focusedCommentId=280426&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-280426
            ycp Yuchen Pei added a comment -

            Hi holyfoot, ptal thanks

            upstream/bb-10.5-ycp 3e494b1ea5a50a0769aab91af205284067f408b7
            MDEV-33494 fix spider init with no_zero_date global sql mode
             
            Like the fix for MDEV-32753 and MDEV-33242, spider init queries
            creates new connections that use the global sql_mode of the existing
            connection.
            

            ycp Yuchen Pei added a comment - Hi holyfoot , ptal thanks upstream/bb-10.5-ycp 3e494b1ea5a50a0769aab91af205284067f408b7 MDEV-33494 fix spider init with no_zero_date global sql mode   Like the fix for MDEV-32753 and MDEV-33242, spider init queries creates new connections that use the global sql_mode of the existing connection.
            ycp Yuchen Pei made changes -
            Assignee Yuchen Pei [ JIRAUSER52627 ] Alexey Botchkov [ holyfoot ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Fix Version/s 10.6 [ 24028 ]

            ycp Hi! Found this today, likely the same bug:

            SET sql_mode=traditional;
            SET GLOBAL sql_mode=(SELECT REPLACE (@@sql_mode,',strict_trans_ts',''));
            INSTALL PLUGIN Spider SONAME 'ha_spider.so';
            SHUTDOWN;
            

            Leads to:

            11.4.2 9b6e267bfd8fbed66807b8ca81a84d1faa84ff34 (Optimized, UBASAN)

            2024-02-28  8:29:21 0 [Note] /test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-opt/bin/mariadbd: Shutdown complete
             
            Warning: Memory not freed: 10720
             
            =================================================================
            ==866058==ERROR: LeakSanitizer: detected memory leaks
             
            Direct leak of 10720 byte(s) in 20 object(s) allocated from:
                #0 0x55f821511597 in malloc (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-opt/bin/mariadbd+0x7edb597)
                #1 0x55f825a94934 in my_malloc /test/11.4_opt_san/mysys/my_malloc.c:93
                #2 0x55f825a136de in init_dynamic_array2 /test/11.4_opt_san/mysys/array.c:73
                #3 0x154bf019c84e  (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-opt/bin/mariadbd+0x2619c84e)
                #4 0x55f8233dd806 in ha_initialize_handlerton(st_plugin_int*) /test/11.4_opt_san/sql/handler.cc:695
                #5 0x55f821e5e8b6 in plugin_do_initialize /test/11.4_opt_san/sql/sql_plugin.cc:1453
                #6 0x55f821e7f5a6 in plugin_initialize /test/11.4_opt_san/sql/sql_plugin.cc:1506
                #7 0x55f821e7fb94 in finalize_install /test/11.4_opt_san/sql/sql_plugin.cc:2226
                #8 0x55f821e8163b in mysql_install_plugin(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*) /test/11.4_opt_san/sql/sql_plugin.cc:2325
                #9 0x55f821dbe68d in mysql_execute_command(THD*, bool) /test/11.4_opt_san/sql/sql_parse.cc:5705
                #10 0x55f821dd7ba2 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.4_opt_san/sql/sql_parse.cc:7815
                #11 0x55f821de3bbb in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.4_opt_san/sql/sql_parse.cc:1893
                #12 0x55f821def608 in do_command(THD*, bool) /test/11.4_opt_san/sql/sql_parse.cc:1406
                #13 0x55f822746cbc in do_handle_one_connection(CONNECT*, bool) /test/11.4_opt_san/sql/sql_connect.cc:1437
                #14 0x55f8227492bc in handle_one_connection /test/11.4_opt_san/sql/sql_connect.cc:1339
                #15 0x154c14c94ac2 in start_thread nptl/pthread_create.c:442
             
            SUMMARY: AddressSanitizer: 10720 byte(s) leaked in 20 allocation(s).
            240228  8:29:21 [ERROR] mysqld got signal 6 ;
            Sorry, we probably made a mistake, and this is a bug.
            

            And

            11.4.2 9b6e267bfd8fbed66807b8ca81a84d1faa84ff34 (Debug, UBASAN)

            2024-02-28  8:29:23 0 [Note] /test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-dbg/bin/mariadbd: Shutdown complete
             
            Warning: Memory not freed: 10720
             
            =================================================================
            ==866736==ERROR: LeakSanitizer: detected memory leaks
             
            Direct leak of 10720 byte(s) in 20 object(s) allocated from:
                #0 0x559cf849d3d7 in __interceptor_malloc (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-dbg/bin/mariadbd+0x7e623d7)
                #1 0x559cfcd90313 in my_malloc /test/11.4_dbg_san/mysys/my_malloc.c:93
                #2 0x559cfcd22f24 in init_dynamic_array2 /test/11.4_dbg_san/mysys/array.c:73
                #3 0x559cfcd33710 in my_hash_init2 /test/11.4_dbg_san/mysys/hash.c:99
                #4 0x14590d9b6877  (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-dbg/bin/mariadbd+0x253b6877)
                #5 0x559cfa629f6b in ha_initialize_handlerton(st_plugin_int*) /test/11.4_dbg_san/sql/handler.cc:695
                #6 0x559cf8e8dbe4 in plugin_do_initialize /test/11.4_dbg_san/sql/sql_plugin.cc:1453
                #7 0x559cf8ea59e2 in plugin_initialize /test/11.4_dbg_san/sql/sql_plugin.cc:1506
                #8 0x559cf8ea5d09 in finalize_install /test/11.4_dbg_san/sql/sql_plugin.cc:2226
                #9 0x559cf8ea778d in mysql_install_plugin(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*) /test/11.4_dbg_san/sql/sql_plugin.cc:2325
                #10 0x559cf8df0d81 in mysql_execute_command(THD*, bool) /test/11.4_dbg_san/sql/sql_parse.cc:5705
                #11 0x559cf8df840e in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.4_dbg_san/sql/sql_parse.cc:7815
                #12 0x559cf8e08252 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.4_dbg_san/sql/sql_parse.cc:1893
                #13 0x559cf8e16799 in do_command(THD*, bool) /test/11.4_dbg_san/sql/sql_parse.cc:1406
                #14 0x559cf982888b in do_handle_one_connection(CONNECT*, bool) /test/11.4_dbg_san/sql/sql_connect.cc:1437
                #15 0x559cf9829da6 in handle_one_connection /test/11.4_dbg_san/sql/sql_connect.cc:1339
                #16 0x145932694ac2 in start_thread nptl/pthread_create.c:442
             
            SUMMARY: AddressSanitizer: 10720 byte(s) leaked in 20 allocation(s).
            240228  8:29:24 [ERROR] mysqld got signal 6 ;
            

            Roel Roel Van de Paar added a comment - ycp Hi! Found this today, likely the same bug: SET sql_mode=traditional; SET GLOBAL sql_mode=( SELECT REPLACE (@@sql_mode, ',strict_trans_ts' , '' )); INSTALL PLUGIN Spider SONAME 'ha_spider.so' ; SHUTDOWN; Leads to: 11.4.2 9b6e267bfd8fbed66807b8ca81a84d1faa84ff34 (Optimized, UBASAN) 2024-02-28 8:29:21 0 [Note] /test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-opt/bin/mariadbd: Shutdown complete   Warning: Memory not freed: 10720   ================================================================= ==866058==ERROR: LeakSanitizer: detected memory leaks   Direct leak of 10720 byte(s) in 20 object(s) allocated from: #0 0x55f821511597 in malloc (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-opt/bin/mariadbd+0x7edb597) #1 0x55f825a94934 in my_malloc /test/11.4_opt_san/mysys/my_malloc.c:93 #2 0x55f825a136de in init_dynamic_array2 /test/11.4_opt_san/mysys/array.c:73 #3 0x154bf019c84e (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-opt/bin/mariadbd+0x2619c84e) #4 0x55f8233dd806 in ha_initialize_handlerton(st_plugin_int*) /test/11.4_opt_san/sql/handler.cc:695 #5 0x55f821e5e8b6 in plugin_do_initialize /test/11.4_opt_san/sql/sql_plugin.cc:1453 #6 0x55f821e7f5a6 in plugin_initialize /test/11.4_opt_san/sql/sql_plugin.cc:1506 #7 0x55f821e7fb94 in finalize_install /test/11.4_opt_san/sql/sql_plugin.cc:2226 #8 0x55f821e8163b in mysql_install_plugin(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*) /test/11.4_opt_san/sql/sql_plugin.cc:2325 #9 0x55f821dbe68d in mysql_execute_command(THD*, bool) /test/11.4_opt_san/sql/sql_parse.cc:5705 #10 0x55f821dd7ba2 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.4_opt_san/sql/sql_parse.cc:7815 #11 0x55f821de3bbb in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.4_opt_san/sql/sql_parse.cc:1893 #12 0x55f821def608 in do_command(THD*, bool) /test/11.4_opt_san/sql/sql_parse.cc:1406 #13 0x55f822746cbc in do_handle_one_connection(CONNECT*, bool) /test/11.4_opt_san/sql/sql_connect.cc:1437 #14 0x55f8227492bc in handle_one_connection /test/11.4_opt_san/sql/sql_connect.cc:1339 #15 0x154c14c94ac2 in start_thread nptl/pthread_create.c:442   SUMMARY: AddressSanitizer: 10720 byte(s) leaked in 20 allocation(s). 240228 8:29:21 [ERROR] mysqld got signal 6 ; Sorry, we probably made a mistake, and this is a bug. And 11.4.2 9b6e267bfd8fbed66807b8ca81a84d1faa84ff34 (Debug, UBASAN) 2024-02-28 8:29:23 0 [Note] /test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-dbg/bin/mariadbd: Shutdown complete   Warning: Memory not freed: 10720   ================================================================= ==866736==ERROR: LeakSanitizer: detected memory leaks   Direct leak of 10720 byte(s) in 20 object(s) allocated from: #0 0x559cf849d3d7 in __interceptor_malloc (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-dbg/bin/mariadbd+0x7e623d7) #1 0x559cfcd90313 in my_malloc /test/11.4_dbg_san/mysys/my_malloc.c:93 #2 0x559cfcd22f24 in init_dynamic_array2 /test/11.4_dbg_san/mysys/array.c:73 #3 0x559cfcd33710 in my_hash_init2 /test/11.4_dbg_san/mysys/hash.c:99 #4 0x14590d9b6877 (/test/UBASAN_MD190224-mariadb-11.4.2-linux-x86_64-dbg/bin/mariadbd+0x253b6877) #5 0x559cfa629f6b in ha_initialize_handlerton(st_plugin_int*) /test/11.4_dbg_san/sql/handler.cc:695 #6 0x559cf8e8dbe4 in plugin_do_initialize /test/11.4_dbg_san/sql/sql_plugin.cc:1453 #7 0x559cf8ea59e2 in plugin_initialize /test/11.4_dbg_san/sql/sql_plugin.cc:1506 #8 0x559cf8ea5d09 in finalize_install /test/11.4_dbg_san/sql/sql_plugin.cc:2226 #9 0x559cf8ea778d in mysql_install_plugin(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*) /test/11.4_dbg_san/sql/sql_plugin.cc:2325 #10 0x559cf8df0d81 in mysql_execute_command(THD*, bool) /test/11.4_dbg_san/sql/sql_parse.cc:5705 #11 0x559cf8df840e in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.4_dbg_san/sql/sql_parse.cc:7815 #12 0x559cf8e08252 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.4_dbg_san/sql/sql_parse.cc:1893 #13 0x559cf8e16799 in do_command(THD*, bool) /test/11.4_dbg_san/sql/sql_parse.cc:1406 #14 0x559cf982888b in do_handle_one_connection(CONNECT*, bool) /test/11.4_dbg_san/sql/sql_connect.cc:1437 #15 0x559cf9829da6 in handle_one_connection /test/11.4_dbg_san/sql/sql_connect.cc:1339 #16 0x145932694ac2 in start_thread nptl/pthread_create.c:442   SUMMARY: AddressSanitizer: 10720 byte(s) leaked in 20 allocation(s). 240228 8:29:24 [ERROR] mysqld got signal 6 ;

            Affects testing due to generality of stacks.

            Roel Roel Van de Paar added a comment - Affects testing due to generality of stacks.
            Roel Roel Van de Paar made changes -
            Labels affects-tests
            Roel Roel Van de Paar made changes -
            Affects Version/s 11.4 [ 29301 ]
            Roel Roel Van de Paar made changes -
            Fix Version/s 11.4 [ 29301 ]
            Roel Roel Van de Paar made changes -

            Also found this one, same outcome. This one may be lightly sporadic.

            SET @@sql_mode='TRADITIONAL';
            SET GLOBAL sql_mode=(SELECT REPLACE (@@sql_mode,',pipes_as_concat',''));
            INSTALL PLUGIN Spider SONAME 'ha_spider.so';
            SHUTDOWN;
            

            Roel Roel Van de Paar added a comment - Also found this one, same outcome. This one may be lightly sporadic. SET @@sql_mode= 'TRADITIONAL' ; SET GLOBAL sql_mode=( SELECT REPLACE (@@sql_mode, ',pipes_as_concat' , '' )); INSTALL PLUGIN Spider SONAME 'ha_spider.so' ; SHUTDOWN;

            And another one, this time again using old_mode alike to MDEV-33242

            SET sql_mode='';
            SET GLOBAL old_mode='no_dup_key_warnings_with_ignore,no_progress_info';
            INSTALL PLUGIN Spider SONAME 'ha_spider.so';
            SHUTDOWN;
            

            Roel Roel Van de Paar added a comment - And another one, this time again using old_mode alike to MDEV-33242 SET sql_mode= '' ; SET GLOBAL old_mode= 'no_dup_key_warnings_with_ignore,no_progress_info' ; INSTALL PLUGIN Spider SONAME 'ha_spider.so' ; SHUTDOWN;

            ok to push.

            holyfoot Alexey Botchkov added a comment - ok to push.
            holyfoot Alexey Botchkov made changes -
            Assignee Alexey Botchkov [ holyfoot ] Yuchen Pei [ JIRAUSER52627 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            ycp Yuchen Pei added a comment - - edited

            Thanks for the review holyfoot.

            I am pushing this and opening a new ticket (MDEV-33584) from other examples from Roel (if not fixed already).

            ycp Yuchen Pei added a comment - - edited Thanks for the review holyfoot . I am pushing this and opening a new ticket ( MDEV-33584 ) from other examples from Roel (if not fixed already).
            ycp Yuchen Pei added a comment -

            Roel, at which commit did you get the failure in the old_mode case in your comment[1]? I couldn't reproduce it at 10.6 5b8493ba34a4e5393ad9bdfe2803a11780ef3f52

            [1] https://jira.mariadb.org/browse/MDEV-33494?focusedCommentId=280963&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-280963

            ycp Yuchen Pei added a comment - Roel , at which commit did you get the failure in the old_mode case in your comment [1] ? I couldn't reproduce it at 10.6 5b8493ba34a4e5393ad9bdfe2803a11780ef3f52 [1] https://jira.mariadb.org/browse/MDEV-33494?focusedCommentId=280963&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-280963
            ycp Yuchen Pei made changes -
            ycp Yuchen Pei added a comment -

            pushed d37c51b8053344b52fd9c539c3964070a9c0b307 to 10.5

            ycp Yuchen Pei added a comment - pushed d37c51b8053344b52fd9c539c3964070a9c0b307 to 10.5
            ycp Yuchen Pei made changes -
            Fix Version/s 10.5.25 [ 29626 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 11.4 [ 29301 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.6.18 [ 29627 ]
            Fix Version/s 10.11.8 [ 29630 ]
            Fix Version/s 11.0.6 [ 29628 ]
            Fix Version/s 11.1.5 [ 29629 ]
            Fix Version/s 11.2.4 [ 29631 ]

            Confirmed that the issue in this comment is no longer reproducible in 10.6 build today at rev 0df4651c13d68f1c228986f940d8ea4a226132f5

            Roel Roel Van de Paar added a comment - Confirmed that the issue in this comment is no longer reproducible in 10.6 build today at rev 0df4651c13d68f1c228986f940d8ea4a226132f5
            Roel Roel Van de Paar added a comment - - edited

            However, the original testcase in this ticket still causes an ERROR message in the error log (which is MDEV-31111). Info added here. A fix for that bug would be great, whenever possible (or is it perhaps fixed by the MDEV-33584 fix?).

            Update: here w/ thanks ycp

            Roel Roel Van de Paar added a comment - - edited However, the original testcase in this ticket still causes an ERROR message in the error log (which is MDEV-31111 ). Info added here . A fix for that bug would be great, whenever possible (or is it perhaps fixed by the MDEV-33584 fix?). Update: here w/ thanks ycp
            ycp Yuchen Pei made changes -

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.