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

last_insert_id and insert_id are always zero in mysql.slow_log

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Trivial
    • Resolution: Unresolved
    • 10.2, 10.3, 10.4, 10.5
    • 10.4, 10.5
    • Server

    Description

      I can't find any signs that it had ever worked in the past, either in MariaDB or in upstream. So, possibly it's just a documentation issue, as from the KB article it looks like it's supposed to work.

      set @output.save= @@global.log_output;
      set global log_output='TABLE';
       
      set long_query_time=0.00001;
      create table t1 (a int auto_increment primary key);
      insert into t1 values (null),(null),(null);
      select last_insert_id();
      insert into t1 values (null),(null),(null);
      select last_insert_id();
      select last_insert_id, insert_id, sql_text from mysql.slow_log;
       
      drop table t1;
      set global log_output= @output.save;
      

      10.5 1b12e251

      insert into t1 values (null),(null),(null);
      select last_insert_id();
      last_insert_id()
      1
      insert into t1 values (null),(null),(null);
      select last_insert_id();
      last_insert_id()
      4
      select last_insert_id, insert_id, sql_text from mysql.slow_log;
      last_insert_id	insert_id	sql_text
      0	0	set long_query_time=0.00001
      0	0	create table t1 (a int auto_increment primary key)
      0	0	insert into t1 values (null),(null),(null)
      0	0	select last_insert_id()
      0	0	insert into t1 values (null),(null),(null)
      0	0	select last_insert_id()
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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