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

performance_schema.metadata_locks.source column is always empty

    XMLWordPrintable

Details

    Description

      In my tests SOURCE column in the performance_schema.metadata_locks table is always empty:

      openxs@ao756:~/dbs/8.0$ bin/mysql --socket=/tmp/mariadb105.sock performance_schema
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
       
      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 16
      Server version: 5.5.5-10.5.6-MariaDB Source distribution
       
      Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
       
      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      mysql> flush tables with read lock;
      Query OK, 0 rows affected (0.00 sec)
       
      mysql> select * from metadata_locks\G
      *************************** 1. row ***************************
                OBJECT_TYPE: BACKUP
              OBJECT_SCHEMA: NULL
                OBJECT_NAME: NULL
      OBJECT_INSTANCE_BEGIN: 140032711161584
                  LOCK_TYPE: BACKUP_FTWRL1
              LOCK_DURATION: EXPLICIT
                LOCK_STATUS: GRANTED
                     SOURCE:
            OWNER_THREAD_ID: 41
             OWNER_EVENT_ID: 1
      *************************** 2. row ***************************
                OBJECT_TYPE: TABLE
              OBJECT_SCHEMA: performance_schema
                OBJECT_NAME: metadata_locks
      OBJECT_INSTANCE_BEGIN: 140032711207584
                  LOCK_TYPE: SHARED_READ
              LOCK_DURATION: TRANSACTION
                LOCK_STATUS: GRANTED
                     SOURCE:
            OWNER_THREAD_ID: 41
             OWNER_EVENT_ID: 1
      2 rows in set (0.00 sec)
      

      It is expecte3d (see https://dev.mysql.com/doc/refman/5.7/en/performance-schema-metadata-locks-table.html) to get the following information there:

      "The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. This enables you to check the source to determine exactly what code is involved."

      This is how it lo0oks/works in MySQL 8.0.21, for example:

      openxs@ao756:~/dbs/8.0$ bin/mysql --socket=/tmp/mysql8.sock -uroot performance_schema
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
       
      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 9
      Server version: 8.0.21 Source distribution
       
      Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
       
      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      mysql> flush tables with read lock;
      Query OK, 0 rows affected (0.00 sec)
       
      mysql> select * from metadata_locks\G
      *************************** 1. row ***************************
                OBJECT_TYPE: GLOBAL
              OBJECT_SCHEMA: NULL
                OBJECT_NAME: NULL
                COLUMN_NAME: NULL
      OBJECT_INSTANCE_BEGIN: 139972652157040
                  LOCK_TYPE: SHARED
              LOCK_DURATION: EXPLICIT
                LOCK_STATUS: GRANTED
                     SOURCE: lock.cc:1033
            OWNER_THREAD_ID: 50
             OWNER_EVENT_ID: 112
      *************************** 2. row ***************************
                OBJECT_TYPE: COMMIT
              OBJECT_SCHEMA: NULL
                OBJECT_NAME: NULL
                COLUMN_NAME: NULL
      OBJECT_INSTANCE_BEGIN: 139972651632368
                  LOCK_TYPE: SHARED
              LOCK_DURATION: EXPLICIT
                LOCK_STATUS: GRANTED
                     SOURCE: lock.cc:1108
            OWNER_THREAD_ID: 50
             OWNER_EVENT_ID: 112
      ...
      

      Please, fix this and make the column show proper value.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            valerii Valerii Kravchuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.