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

Alter sequence with second execution of prepare statement crashes server

    XMLWordPrintable

Details

    Description

      Before changes in MDEV-28152 next testcase fails with

      query 'execute stmt' failed: ER_SEQUENCE_INVALID_DATA (4085): Sequence 'test.s' has out of range value for options
      

      After changes it causes server crash.

      Testcase:

      create sequence s;
      show create sequence s;
       
      prepare stmt from 'alter sequence s maxvalue 123';
      execute stmt;
      execute stmt;
      deallocate prepare stmt;
       
      show create sequence s;
      drop sequence s;
      

      Stacktrace:

      Thread pointer: 0x7f34dc000dc8
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f34ec7a0bf8 thread_stack 0x49000
      mysys/stacktrace.c:215(my_print_stacktrace)[0x564f4996dcac]
      sql/signal_handler.cc:241(handle_fatal_signal)[0x564f490357e6]
      libc_sigaction.c:0(__restore_rt)[0x7f34f1a42520]
      nptl/pthread_kill.c:44(__pthread_kill_implementation)[0x7f34f1a969fc]
      posix/raise.c:27(__GI_raise)[0x7f34f1a42476]
      stdlib/abort.c:81(__GI_abort)[0x7f34f1a287f3]
      intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f34f1a2871b]
      /lib/x86_64-linux-gnu/libc.so.6(+0x39e96)[0x7f34f1a39e96]
      sql/sql_sequence.cc:1112(Sql_cmd_alter_sequence::execute(THD*))[0x564f48f47e9c]
      sql/sql_parse.cc:5738(mysql_execute_command(THD*, bool))[0x564f48c28cd0]
      sql/sql_prepare.cc:5071(Prepared_statement::execute(String*, bool))[0x564f48c6b9ee]
      sql/sql_prepare.cc:4455(Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*))[0x564f48c699c4]
      sql/sql_prepare.cc:3481(mysql_sql_stmt_execute(THD*))[0x564f48c66e99]
      sql/sql_parse.cc:3941(mysql_execute_command(THD*, bool))[0x564f48c21ec2]
      sql/sql_parse.cc:7748(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x564f48c2ef30]
      sql/sql_parse.cc:1895(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x564f48c1bad1]
      sql/sql_parse.cc:1406(do_command(THD*, bool))[0x564f48c1a417]
      sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x564f48e14e14]
      sql/sql_connect.cc:1322(handle_one_connection)[0x564f48e14b7d]
      perfschema/pfs.cc:2203(pfs_spawn_thread)[0x564f493ac2e5]
      nptl/pthread_create.c:442(start_thread)[0x7f34f1a94ac3]
      x86_64/clone3.S:83(__clone3)[0x7f34f1b26660]
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.