diff options
author | unknown <timour@mysql.com> | 2006-02-22 10:04:10 +0200 |
---|---|---|
committer | unknown <timour@mysql.com> | 2006-02-22 10:04:10 +0200 |
commit | 475797a34622bb740409238f9ee63a5777476b4f (patch) | |
tree | 4a5a2a2b3a5bbaa7697e835edb2bd20086f5fddc /mysql-test | |
parent | 86c920ba776ddf5e9999e8293d5824be25bb43b6 (diff) | |
download | mariadb-git-475797a34622bb740409238f9ee63a5777476b4f.tar.gz |
Fix for BUG#17523: natural join and information schema.
The cause of the bug was an ASSERT that checked the consistency
of TABLE_SHARE::db and TABLE_LIST::db and failed for I_S tables.
The fix relaxes the requirement for consistency for I_S.
mysql-test/r/join.result:
Added test for BUG#17523
mysql-test/t/join.test:
Added test for BUG#17523
sql/table.cc:
Take into account that for I_S tables, TABLE_SHARE::db == 0,
while TABLE_LIST::db contains the database name of a table.
The only change is in the ASSERTs.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/join.result | 5 | ||||
-rw-r--r-- | mysql-test/t/join.test | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 724d1b1e39f..54536d6c32a 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -677,6 +677,11 @@ select t1.b from v1a; ERROR 42S22: Unknown column 't1.b' in 'field list' select * from v1a join v1b on t1.b = t2.b; ERROR 42S22: Unknown column 't1.b' in 'on clause' +select * from information_schema.statistics join information_schema.columns +using(table_name,column_name) where table_name='user'; +TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE NULL mysql 1 NO char 20 60 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references +user User NULL mysql 0 mysql PRIMARY 2 A 5 NULL NULL BTREE NULL mysql 2 NO char 5 16 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references drop table t1; drop table t2; drop table t3; diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 553aaf987bb..90abc61ca07 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -523,6 +523,12 @@ select t1.b from v1a; -- error 1054 select * from v1a join v1b on t1.b = t2.b; +# +# Bug #17523 natural join and information_schema +# +select * from information_schema.statistics join information_schema.columns + using(table_name,column_name) where table_name='user'; + drop table t1; drop table t2; drop table t3; |