Bug #1405 Hidden Tables with prefix '#sql'
Submitted: 25 Sep 2003 23:28 Modified: 2 Sep 2006 1:30
Reporter: Georg Richter Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.1 OS:
Assigned to: Ingo Strüwing CPU Architecture:Any

[25 Sep 2003 23:28] Georg Richter
Description:
Prefix #sql for tablenames might be a nice feature for hidden tables, but it looks more like a 
bug. 

How to repeat:
mysql> create database my_test; 
Query OK, 1 row affected (0.09 sec) 
 
mysql> use my_test; 
Database changed 
mysql> create table my_public_table (a int); 
Query OK, 0 rows affected (0.43 sec) 
 
mysql> create table `#sql_my_non_public_table` (a int); 
Query OK, 0 rows affected (0.12 sec) 
 
mysql> show tables; 
+-------------------+ 
| Tables_in_my_test | 
+-------------------+ 
| my_public_table   | 
+-------------------+ 
1 row in set (0.00 sec)
[2 Oct 2003 20:48] MySQL Verification Team
I must admit that given that name for a table isn't common, but...
let us Sergei to analyze.
[6 Oct 2003 8:53] Sergei Golubchik
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

fixed, thanks
now temporary tables start from '#.sql'
[23 Oct 2003 3:36] Sergei Golubchik
posponed for some time - the issue is not critical, and the fix will come with new features soon
[13 Sep 2004 19:28] Sergei Golubchik
to be fixed in 5.0
[25 Jul 2005 13:45] Max Mether
Will this be fixed for 5.0?

If not, then for which version?
[26 Jul 2005 8:58] Max Mether
This CAN potentially stop ALTER TABLEs: look at the following:

mysql> create table `#sql-a52_1`;
Query OK, 0 rows affected (0.74 sec)

mysql> alter table citytest drop index name ;
'ERROR 1050 (42S01): Table '#sql-a52_1' already exists

The used tables are ndb tables
[8 Aug 2005 8:45] Sergei Golubchik
Ok, then let's disallow such tables for now. in 5.1 we'll have a better solution
[30 Jun 2006 19:41] Sergei Golubchik
see bug#18775 for the fix in 5.1 branch
[27 Aug 2006 17:58] Ingo Strüwing
This has been fixed in 5.1.12 with the fix for Bug #18775.
[2 Sep 2006 1:30] Paul DuBois
Noted in 5.1.12 changelog.

The server used #sql as a prefix for hidden table names, but it is also
possible for users to use that as a table name prefix, which caused
some operations to fail. Now the server uses #.sql as the prefix.
[2 Sep 2006 17:18] Paul DuBois
Previous changelog entry is incorrect, it should be:

User-created tables having a name beginning with #sql were not visible
to SHOW TABLES and could collide with internal temporary table names. Now
they are not hidden and do not collide.