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

Add thread ID and database / table, where the error occured to SQL error plugin

Details

    Description

      For debug purposes, it will useful, if threadID and database/ table name (if available) will be added to the SQL ERROR Plugin log entries.

      Error messages should also be extended so that the database and table name is present for errors related to tables.

      To enable this feature, on has to also do
      sql_error_log_with_db_and_thread_info=1
      See https://mariadb.com/kb/en/sql-error-log-system-variables-and-options/#sql_error_log_with_db_and_thread_info

      Attachments

        Issue Links

          Activity

            ok to push

            ramesh Ramesh Sivaraman added a comment - ok to push
            rucha174 Rucha Deodhar added a comment -

            pushed to 10.6

            rucha174 Rucha Deodhar added a comment - pushed to 10.6
            rucha174 Rucha Deodhar added a comment - - edited

            A new global variable with_db_and_thread_info for the error logging plugin is added. If set to 1(enabled), it prints the database name and the thread ID in the log in addition to already existing columns. Default value is 0. It cannot be set at runtime to keep the entire log with same formatting.

            Example when select is done from a non existing table with enabled with_db_and_thread_info, the log will have:

            2023-10-31 15:54:37 4 root[root] @ localhost [] `test` ERROR 1146: Table 'test.t_doesnt_exist' doesn't exist : select * from t_doesnt_exist

            If no database is selected, then there is NULL in place of database instead of being empty.

            rucha174 Rucha Deodhar added a comment - - edited A new global variable with_db_and_thread_info for the error logging plugin is added. If set to 1(enabled), it prints the database name and the thread ID in the log in addition to already existing columns. Default value is 0. It cannot be set at runtime to keep the entire log with same formatting. Example when select is done from a non existing table with enabled with_db_and_thread_info, the log will have: 2023-10-31 15:54:37 4 root [root] @ localhost [] `test` ERROR 1146: Table 'test.t_doesnt_exist' doesn't exist : select * from t_doesnt_exist If no database is selected, then there is NULL in place of database instead of being empty.
            ralf.gebhardt Ralf Gebhardt added a comment -

            Hi rucha174, as discussed with serg please change the order to

            <timestamp> <thread_id> <user> <db> <error>
            

            I am reopening the ticket

            ralf.gebhardt Ralf Gebhardt added a comment - Hi rucha174 , as discussed with serg please change the order to <timestamp> <thread_id> <user> <db> <error> I am reopening the ticket
            rucha174 Rucha Deodhar added a comment -

            made changes to format of log. fixed and pushed to 10.6

            rucha174 Rucha Deodhar added a comment - made changes to format of log. fixed and pushed to 10.6

            People

              rucha174 Rucha Deodhar
              Richard Richard Stracke
              Votes:
              1 Vote for this issue
              Watchers:
              13 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.