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

SHOW TABLE STATUS shows all temporary tables ignoring database and conditions

    XMLWordPrintable

Details

    Description

      create temporary table test.tmp_in_test (a int);
      create database db;
      use db;
      # This should show tables from currently used DB and it is 'db'  - no temporary tables should be visible
      show table status;
      # The same as before
      show table status in db;
      # This shouldn't give any results
      show table status like 'nonexisting';
       
      # Cleanup
      drop database db;
      

      preview-10.9-MDEV-20119-misc c906db30

      # This should be empty (since db is used)
      show table status;
      Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment	Max_index_length	Temporary
      tmp_in_test	MyISAM	10	Fixed	0	0	0	1970324836974591	1024	0	NULL	2022-04-17 23:46:11	2022-04-17 23:46:11	NULL	latin1_swedish_ci	NULL			17179868160	Y
       
      # This should be empty
      show table status in db;
      Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment	Max_index_length	Temporary
      tmp_in_test	MyISAM	10	Fixed	0	0	0	1970324836974591	1024	0	NULL	2022-04-17 23:46:11	2022-04-17 23:46:11	NULL	latin1_swedish_ci	NULL			17179868160	Y
       
      # This should be empty
      show table status like 'nonexisting';
      Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment	Max_index_length	Temporary
      tmp_in_test	MyISAM	10	Fixed	0	0	0	1970324836974591	1024	0	NULL	2022-04-17 23:46:11	2022-04-17 23:46:11	NULL	latin1_swedish_ci	NULL			17179868160	Y
      

      Note that show tables is not exposing temporary tables, only non-temporary tables.
      show table status should show temporary tables as an extension to show tables using temporary column.

      Attachments

        Issue Links

          Activity

            People

              anel Anel Husakovic
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.