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

CONNECT proxy type table that have missing source table causes SHOW TABLES STATUS not to return anything

    Details

      Description

      SHOW TABLES STATUS will return error 1146 and nothing else when there exist a CONNECT storage engine PROXY type table that has had it's referenced source table dropped.

      Server version: 10.0.15-MariaDB-log mariadb.org binary distribution
      
      Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      root@localhost-master [(none)]> create database proxy_test;
      Query OK, 1 row affected (0.01 sec)
      
      root@localhost-master [(none)]> use proxy_test;
      Database changed
      root@localhost-master [proxy_test]> create table foo(col1 int);
      Query OK, 0 rows affected (0.04 sec)
      
      root@localhost-master [proxy_test]> create table bar
          -> engine=connect table_type=proxy tabname=foo dbname=proxy_test;
      Query OK, 0 rows affected (0.01 sec)
      
      root@localhost-master [proxy_test]> show table status from proxy_test\G
      *************************** 1. row ***************************
                 Name: bar
               Engine: CONNECT
              Version: 10
           Row_format: Fixed
                 Rows: 10
       Avg_row_length: 0
          Data_length: 0
      Max_data_length: 0
         Index_length: 0
            Data_free: 0
       Auto_increment: NULL
          Create_time: NULL
          Update_time: NULL
           Check_time: NULL
            Collation: latin1_swedish_ci
             Checksum: NULL
       Create_options: `TABLE_TYPE`='proxy' `TABNAME`='foo' `DBNAME`='proxy_test'
              Comment:
      *************************** 2. row ***************************
                 Name: foo
               Engine: InnoDB
              Version: 10
           Row_format: Compact
                 Rows: 0
       Avg_row_length: 0
          Data_length: 16384
      Max_data_length: 0
         Index_length: 0
            Data_free: 0
       Auto_increment: NULL
          Create_time: 2015-02-25 15:34:39
          Update_time: NULL
           Check_time: NULL
            Collation: latin1_swedish_ci
             Checksum: NULL
       Create_options:
              Comment:
      2 rows in set (0.00 sec)
      
      root@localhost-master [proxy_test]> drop table foo;
      Query OK, 0 rows affected (0.04 sec)
      
      root@localhost-master [proxy_test]> show table status from proxy_test\G
      ERROR 1146 (42S02): Table 'proxy_test.foo' doesn't exist
      root@localhost-master [proxy_test]> create table spam(meat_type char(20));
      Query OK, 0 rows affected (0.03 sec)
      
      root@localhost-master [proxy_test]> create table eggs(egg_type varchar(100));
      Query OK, 0 rows affected (0.03 sec)
      
      root@localhost-master [proxy_test]> show table status from proxy_test\G
      ERROR 1146 (42S02): Table 'proxy_test.foo' doesn't exist
      root@localhost-master [proxy_test]> drop table bar;
      Query OK, 0 rows affected (0.01 sec)
      
      root@localhost-master [proxy_test]> show table status from proxy_test\G
      *************************** 1. row ***************************
                 Name: eggs
               Engine: InnoDB
              Version: 10
           Row_format: Compact
                 Rows: 0
       Avg_row_length: 0
          Data_length: 16384
      Max_data_length: 0
         Index_length: 0
            Data_free: 0
       Auto_increment: NULL
          Create_time: 2015-02-25 15:44:36
          Update_time: NULL
           Check_time: NULL
            Collation: latin1_swedish_ci
             Checksum: NULL
       Create_options:
              Comment:
      *************************** 2. row ***************************
                 Name: spam
               Engine: InnoDB
              Version: 10
           Row_format: Compact
                 Rows: 0
       Avg_row_length: 0
          Data_length: 16384
      Max_data_length: 0
         Index_length: 0
            Data_free: 0
       Auto_increment: NULL
          Create_time: 2015-02-25 15:44:17
          Update_time: NULL
           Check_time: NULL
            Collation: latin1_swedish_ci
             Checksum: NULL
       Create_options:
              Comment:
      2 rows in set (0.00 sec)
      
      root@localhost-master [proxy_test]>
      

      This affects GUI tools such as HeidiSQL, causing it not to be able to show any details for the database containing the error table.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            bertrandop Olivier Bertrand added a comment -

            Added thd->clear_error() when open_table_def fails.

            Show
            bertrandop Olivier Bertrand added a comment - Added thd->clear_error() when open_table_def fails.

              People

              • Assignee:
                bertrandop Olivier Bertrand
                Reporter:
                Tuco Tuco
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h