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

Annotate-rows-log event of statement with stored routine misleads in describing queries

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11, 11.4, 11.8
    • None
    • Replication
    • None

    Description

      In case of a query invokes stored routine (e.g functions) the Annotate event is created with the text of a query that is executed first which may be an internal query of an invoked function. E.g

      et binlog_format=row;
      create table t2m (a int) engine=myisam;
      create table t3i (a int) engine=innodb;
       
      delimiter |;
      create function i_t3i (n int)
      RETURNS int(11)
      begin
        insert into t3i values (n);
        insert into t3i values (n+1);
        return n;
      end|
      delimiter ;|
       
      insert into t2m values (i_t3i(5)), (i_t3i(7));
      include/show_binlog_events.inc
      
      

      produces

      Log_name	Pos	Event_type	Server_id	End_log_pos	Info
      master-bin.000001	#	Gtid	#	#	BEGIN GTID #-#-#
      master-bin.000001	#	Annotate_rows	#	#	insert into t3i values ( NAME_CONST('n',5))
      master-bin.000001	#	Table_map	#	#	table_id: # (test.t2m)
      master-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
      master-bin.000001	#	Table_map	#	#	table_id: # (test.t3i)
      master-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
      master-bin.000001	#	Xid	#	#	COMMIT /* XID */
      

      with the Annotate's query being not an expected

      insert into t2m values (i_t3i(5)), (i_t3i(7));
      

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              Elkin Andrei Elkin
              Votes:
              1 Vote for this issue
              Watchers:
              2 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.