[MDEV-7636] CONNECT proxy type table that have missing source table causes SHOW TABLES STATUS not to return anything Created: 2015-02-25  Updated: 2015-02-28  Resolved: 2015-02-28

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.0.15
Fix Version/s: 10.0.18

Type: Bug Priority: Major
Reporter: Tuco Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: connect-engine
Environment:

Windows 7



 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.



 Comments   
Comment by Olivier Bertrand [ 2015-02-28 ]

Added thd->clear_error() when open_table_def fails.

Generated at Thu Feb 08 07:21:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.