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

Table logging does not work in TRANSACTION READ ONLY mode

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 10.0.0
    • None
    • None

    Description

      In TRANSACTION READ ONLY mode, if general logging is enabled and directed to the table, MariaDB does not update the log table, and instead writes error messages in the error log:

      [ERROR] Failed to write to mysql.general_log: Cannot execute statement in a READ ONLY transaction.

      bzr version-info (10.0-monty)

      revision-id: holyfoot@askmonty.org-20120825155717-6ot5fleyej4ublum
      date: 2012-08-25 20:57:17 +0500
      build-date: 2012-08-28 22:33:49 +0400
      revno: 3434

      It works fine in MySQL 5.6, revno 3917.

      Test case:

      SET GLOBAL general_log=1;
      SET GLOBAL log_output='TABLE';
      SET GLOBAL TRANSACTION READ ONLY;
       
      --connect (con1,localhost,root,,)
      SELECT * FROM mysql.general_log;

      Output in MariaDB:

      SET GLOBAL general_log=1;
      SET GLOBAL log_output='TABLE';
      SET GLOBAL TRANSACTION READ ONLY;
      SELECT * FROM mysql.general_log;
      event_time	user_host	thread_id	server_id	command_type	argument
      2012-08-28 22:39:22.248198	root[root] @ localhost []	2	1	Query	SET GLOBAL TRANSACTION READ ONLY
      main.t1                                  [ fail ]  Found warnings/errors in server log file!
              Test ended at 2012-08-28 22:39:22
      Warnings:
      line
      120828 22:39:22 [ERROR] Failed to write to mysql.general_log: Cannot execute statement in a READ ONLY transaction.
      120828 22:39:22 [ERROR] Failed to write to mysql.general_log: Cannot execute statement in a READ ONLY transaction.
      120828 22:39:22 [ERROR] Failed to write to mysql.general_log: Cannot execute statement in a READ ONLY transaction.
      ^ Found warnings in /home/elenst/10.0-monty/mysql-test/var/log/mysqld.1.err

      Output in MySQL 5.6:

      SET GLOBAL general_log=1;
      SET GLOBAL log_output='TABLE';
      SET GLOBAL TRANSACTION READ ONLY;
      SELECT * FROM mysql.general_log;
      event_time	user_host	thread_id	server_id	command_type	argument
      2012-08-28 21:40:03	root[root] @ localhost []	2	1	Query	SET GLOBAL tx_read_only=1
      2012-08-28 21:40:03	[root] @ localhost []	3	1	Connect	root@localhost on test
      2012-08-28 21:40:03	root[root] @ localhost []	3	1	Query	SELECT * FROM mysql.general_log
      main.t1                                  [ pass ]    119

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.