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

Server crashes in check_grant upon invoking function with userstat enabled

    XMLWordPrintable

    Details

      Description

      SET @userstat.save= @@userstat;
       
      CREATE FUNCTION f() RETURNS INT RETURN (SELECT 1 FROM performance_schema.threads);
      SET GLOBAL userstat= 1;
      SELECT f() FROM INFORMATION_SCHEMA.TABLE_STATISTICS;
       
      # Cleanup
      SET GLOBAL userstat= @userstat.save;

      10.2 3dae5647

      #3  <signal handler called>
      #4  0x000055eb50b228b8 in check_grant (thd=0x7f03e0000d90, want_access=1, tables=0x7f03f0245ce0, any_combination_will_do=true, number=4294967295, no_errors=true) at /data/src/10.2/sql/sql_acl.cc:7659
      #5  0x000055eb51542e79 in table_stats_fill (thd=0x7f03e0000d90, tables=0x7f03e0013c20, cond=0x0) at /data/src/10.2/plugin/userstat/table_stats.cc:34
      #6  0x000055eb50c623cc in get_schema_tables_result (join=0x7f03e0017d80, executed_place=PROCESSED_BY_JOIN_EXEC) at /data/src/10.2/sql/sql_show.cc:8472
      #7  0x000055eb50bfb66b in JOIN::exec_inner (this=0x7f03e0017d80) at /data/src/10.2/sql/sql_select.cc:3606
      #8  0x000055eb50bfad22 in JOIN::exec (this=0x7f03e0017d80) at /data/src/10.2/sql/sql_select.cc:3437
      #9  0x000055eb50bfbefc in mysql_select (thd=0x7f03e0000d90, tables=0x7f03e0013c20, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x7f03e0017d60, unit=0x7f03e0004988, select_lex=0x7f03e00050c8) at /data/src/10.2/sql/sql_select.cc:3840
      #10 0x000055eb50bf005e in handle_select (thd=0x7f03e0000d90, lex=0x7f03e00048c8, result=0x7f03e0017d60, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:361
      #11 0x000055eb50bba67f in execute_sqlcom_select (thd=0x7f03e0000d90, all_tables=0x7f03e0013c20) at /data/src/10.2/sql/sql_parse.cc:6274
      #12 0x000055eb50bb11f3 in mysql_execute_command (thd=0x7f03e0000d90) at /data/src/10.2/sql/sql_parse.cc:3585
      #13 0x000055eb50bbe43b in mysql_parse (thd=0x7f03e0000d90, rawbuf=0x7f03e00126f8 "SELECT f() FROM INFORMATION_SCHEMA.TABLE_STATISTICS", length=51, parser_state=0x7f03f02475f0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7794
      #14 0x000055eb50bac664 in dispatch_command (command=COM_QUERY, thd=0x7f03e0000d90, packet=0x7f03e0008b51 "SELECT f() FROM INFORMATION_SCHEMA.TABLE_STATISTICS", packet_length=51, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #15 0x000055eb50bab15f in do_command (thd=0x7f03e0000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #16 0x000055eb50d05c94 in do_handle_one_connection (connect=0x55eb53721110) at /data/src/10.2/sql/sql_connect.cc:1336
      #17 0x000055eb50d059f9 in handle_one_connection (arg=0x55eb53721110) at /data/src/10.2/sql/sql_connect.cc:1241
      #18 0x000055eb5152ed10 in pfs_spawn_thread (arg=0x55eb53704580) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #19 0x00007f03f65fe609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x00007f03f61d8293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Fails on debug, release and ASAN builds alike.

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: