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

Assertion failure in TABLE_SHARE::init_from_sql_statement_string upon returning wrong type from function

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 11.8
    • 11.8.2
    • Server
    • None

    Description

      It looks somewhat similar to MDEV-36067, but the tentative patch from there doesn't fix this one.

      CREATE FUNCTION f() RETURNS INT RETURN (1>2,1,2);
      SELECT * FROM information_schema.COLUMNS WHERE f() IS NULL;
       
      DROP FUNCTION f;
      

      11.8 db5bb6f3339be5a49c0f397eb80a0f259f73f447

      mariadbd: /data/bld/11.8-asan/sql/table.cc:3650: int TABLE_SHARE::init_from_sql_statement_string(THD*, bool, const char*, size_t): Assertion `!thd->is_error()' failed.
      250414 16:46:19 [ERROR] /share8t/bld/11.8-asan/sql/mariadbd got signal 6 ;
       
      #9  0x00007fca20853eb2 in __GI___assert_fail (assertion=0x5627e83b46c0 "!thd->is_error()", file=0x5627e83b20c0 "/data/bld/11.8-asan/sql/table.cc", line=3650, function=0x5627e83b4700 "int TABLE_SHARE::init_from_sql_statement_string(THD*, bool, const char*, size_t)") at ./assert/assert.c:101
      #10 0x00005627e631c60c in TABLE_SHARE::init_from_sql_statement_string (this=0x62500054b138, thd=0x62c0000b0218, write=false, sql=0x5627e8c90fa0 "CREATE TABLE users(USER CHAR(128) collate utf8_bin default null comment 'The connection''s client user name for the connection, or NULL if an internal thread.',CURRENT_CONNECTIONS bigint not null comm"..., sql_length=316) at /data/bld/11.8-asan/sql/table.cc:3650
      #11 0x00005627e70cd394 in pfs_discover_table (hton=0x615000001c18, thd=0x62c0000b0218, share=0x62500054b138) at /data/bld/11.8-asan/storage/perfschema/ha_perfschema.cc:72
      #12 0x00005627e68f29a7 in discover_handlerton (thd=0x62c0000b0218, plugin=0x603000059938, arg=0x62500054b138) at /data/bld/11.8-asan/sql/handler.cc:6639
      #13 0x00005627e5fa8e2e in plugin_foreach_with_mask (thd=0x62c0000b0218, func=0x5627e68f28ea <discover_handlerton(THD*, plugin_ref, void*)>, type=1, state_mask=8, arg=0x62500054b138) at /data/bld/11.8-asan/sql/sql_plugin.cc:2546
      #14 0x00005627e68f2f5e in ha_discover_table (thd=0x62c0000b0218, share=0x62500054b138) at /data/bld/11.8-asan/sql/handler.cc:6683
      #15 0x00005627e6303a98 in open_table_def (thd=0x62c0000b0218, share=0x62500054b138, flags=11) at /data/bld/11.8-asan/sql/table.cc:698
      #16 0x00005627e66f39e1 in tdc_acquire_share (thd=0x62c0000b0218, tl=0x7fca10bdb470, flags=3, out_table=0x0) at /data/bld/11.8-asan/sql/table_cache.cc:855
      #17 0x00005627e6156549 in fill_schema_table_from_frm (thd=0x62c0000b0218, mem_root=0x7fca10bdbf10, table=0x62d00056e438, schema_table=0x5627e9c69b30 <schema_tables+432>, db_name=0x62d000579f90, table_name=0x62d00057c240, open_tables_state_backup=0x7fca10bdbf70, can_deadlock=true) at /data/bld/11.8-asan/sql/sql_show.cc:5241
      #18 0x00005627e615962d in get_all_tables (thd=0x62c0000b0218, tables=0x62d000348ba8, cond=0x62d00034a180) at /data/bld/11.8-asan/sql/sql_show.cc:5657
      #19 0x00005627e61917d5 in get_schema_tables_result (join=0x62d00034bb00, executed_place=PROCESSED_BY_JOIN_EXEC) at /data/bld/11.8-asan/sql/sql_show.cc:9722
      #20 0x00005627e6046051 in JOIN::exec_inner (this=0x62d00034bb00) at /data/bld/11.8-asan/sql/sql_select.cc:5020
      #21 0x00005627e6043d18 in JOIN::exec (this=0x62d00034bb00) at /data/bld/11.8-asan/sql/sql_select.cc:4842
      #22 0x00005627e6048457 in mysql_select (thd=0x62c0000b0218, tables=0x62d000348ba8, fields=..., conds=0x62d00034a180, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2701396736, result=0x62d00034bad0, unit=0x62c0000b4740, select_lex=0x62d000348520) at /data/bld/11.8-asan/sql/sql_select.cc:5375
      #23 0x00005627e60164a1 in handle_select (thd=0x62c0000b0218, lex=0x62c0000b4660, result=0x62d00034bad0, setup_tables_done_option=0) at /data/bld/11.8-asan/sql/sql_select.cc:633
      #24 0x00005627e5f37fd4 in execute_sqlcom_select (thd=0x62c0000b0218, all_tables=0x62d000348ba8) at /data/bld/11.8-asan/sql/sql_parse.cc:6191
      #25 0x00005627e5f27c13 in mysql_execute_command (thd=0x62c0000b0218, is_called_from_prepared_stmt=false) at /data/bld/11.8-asan/sql/sql_parse.cc:3979
      #26 0x00005627e5f42a6a in mysql_parse (thd=0x62c0000b0218, rawbuf=0x62d000348438 "SELECT * FROM information_schema.COLUMNS WHERE f() IS NULL", length=58, parser_state=0x7fca10bdea30) at /data/bld/11.8-asan/sql/sql_parse.cc:7915
      #27 0x00005627e5f198af in dispatch_command (command=COM_QUERY, thd=0x62c0000b0218, packet=0x629000253219 "SELECT * FROM information_schema.COLUMNS WHERE f() IS NULL", packet_length=58, blocking=true) at /data/bld/11.8-asan/sql/sql_parse.cc:1902
      #28 0x00005627e5f165b7 in do_command (thd=0x62c0000b0218, blocking=true) at /data/bld/11.8-asan/sql/sql_parse.cc:1415
      #29 0x00005627e6413149 in do_handle_one_connection (connect=0x608000003b38, put_in_cache=true) at /data/bld/11.8-asan/sql/sql_connect.cc:1415
      #30 0x00005627e6412ca8 in handle_one_connection (arg=0x608000003ab8) at /data/bld/11.8-asan/sql/sql_connect.cc:1327
      #31 0x00005627e70d64a6 in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/11.8-asan/storage/perfschema/pfs.cc:2198
      #32 0x00007fca208a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #33 0x00007fca2092885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.