Commit 1987e3f4 authored by unknown's avatar unknown

Fixed bug related to lower case table names on Power Mac

'information_schema' test is splitted because of innodb  


mysql-test/r/information_schema.result:
  Test is splitted because of innodb
mysql-test/t/information_schema.test:
  Test is splitted because of innodb
sql/sql_show.cc:
  Fixed bug related to lower case table names on Power Mac
sql/table.h:
  Fixed bug related to lower case table names on Power Mac
tests/client_test.c:
  Don't check field length for blob filed
parent 69d569ea
...@@ -363,40 +363,17 @@ NULL test PRIMARY NULL test t1 a 1 NULL NULL NULL ...@@ -363,40 +363,17 @@ NULL test PRIMARY NULL test t1 a 1 NULL NULL NULL
NULL test constraint_1 NULL test t1 a 1 NULL NULL NULL NULL test constraint_1 NULL test t1 a 1 NULL NULL NULL
NULL test key_1 NULL test t1 a 1 NULL NULL NULL NULL test key_1 NULL test t1 a 1 NULL NULL NULL
NULL test key_2 NULL test t1 a 1 NULL NULL NULL NULL test key_2 NULL test t1 a 1 NULL NULL NULL
drop table t1;
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id),
FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE,
FOREIGN KEY (t1_id) REFERENCES t1(id) ON UPDATE CASCADE) ENGINE=INNODB;
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE CONSTRAINT_METHOD
NULL test PRIMARY test t1 PRIMARY KEY NULL
NULL test PRIMARY test t2 PRIMARY KEY NULL
NULL test t2_ibfk_1 test t2 FOREIGN KEY ON DELETE CASCADE
NULL test t2_ibfk_2 test t2 FOREIGN KEY ON UPDATE CASCADE
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
NULL test PRIMARY NULL test t1 id 1 NULL NULL NULL
NULL test PRIMARY NULL test t2 id 1 NULL NULL NULL
NULL test t2_ibfk_1 NULL test t2 t1_id 1 NULL id
NULL test t2_ibfk_2 NULL test t2 t1_id 1 NULL id
select table_name from information_schema.TABLES where table_schema like "test%"; select table_name from information_schema.TABLES where table_schema like "test%";
table_name table_name
t1 t1
t2
select table_name,column_name from information_schema.COLUMNS where table_schema like "test%"; select table_name,column_name from information_schema.COLUMNS where table_schema like "test%";
table_name column_name table_name column_name
t1 id t1 a
t2 id
t2 t1_id
select ROUTINE_NAME from information_schema.ROUTINES; select ROUTINE_NAME from information_schema.ROUTINES;
ROUTINE_NAME ROUTINE_NAME
sel2 sel2
sub1 sub1
delete from mysql.user where user='mysqltest_1'; delete from mysql.user where user='mysqltest_1';
drop table t2;
drop table t1; drop table t1;
drop procedure sel2; drop procedure sel2;
drop function sub1; drop function sub1;
......
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id),
FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE,
FOREIGN KEY (t1_id) REFERENCES t1(id) ON UPDATE CASCADE) ENGINE=INNODB;
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE CONSTRAINT_METHOD
NULL test PRIMARY test t1 PRIMARY KEY NULL
NULL test PRIMARY test t2 PRIMARY KEY NULL
NULL test t2_ibfk_1 test t2 FOREIGN KEY ON DELETE CASCADE
NULL test t2_ibfk_2 test t2 FOREIGN KEY ON UPDATE CASCADE
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
NULL test PRIMARY NULL test t1 id 1 NULL NULL NULL
NULL test PRIMARY NULL test t2 id 1 NULL NULL NULL
NULL test t2_ibfk_1 NULL test t2 t1_id 1 NULL id
NULL test t2_ibfk_2 NULL test t2 t1_id 1 NULL id
drop table t2, t1;
...@@ -162,16 +162,7 @@ select * from information_schema.TABLE_CONSTRAINTS where ...@@ -162,16 +162,7 @@ select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test"; TABLE_SCHEMA= "test";
select * from information_schema.KEY_COLUMN_USAGE where select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test"; TABLE_SCHEMA= "test";
drop table t1;
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id),
FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE,
FOREIGN KEY (t1_id) REFERENCES t1(id) ON UPDATE CASCADE) ENGINE=INNODB;
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
connect (user1,localhost,mysqltest_1,,); connect (user1,localhost,mysqltest_1,,);
connection user1; connection user1;
...@@ -181,7 +172,6 @@ select ROUTINE_NAME from information_schema.ROUTINES; ...@@ -181,7 +172,6 @@ select ROUTINE_NAME from information_schema.ROUTINES;
disconnect user1; disconnect user1;
connection default; connection default;
delete from mysql.user where user='mysqltest_1'; delete from mysql.user where user='mysqltest_1';
drop table t2;
drop table t1; drop table t1;
drop procedure sel2; drop procedure sel2;
drop function sub1; drop function sub1;
......
-- source include/have_innodb.inc
#
# Test for KEY_COLUMN_USAGE & TABLE_CONSTRAINTS tables
#
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id),
FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE,
FOREIGN KEY (t1_id) REFERENCES t1(id) ON UPDATE CASCADE) ENGINE=INNODB;
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
drop table t2, t1;
...@@ -2909,12 +2909,13 @@ ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx) ...@@ -2909,12 +2909,13 @@ ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx)
0 Can't create table 0 Can't create table
*/ */
TABLE *create_schema_table(THD *thd, ST_SCHEMA_TABLE *schema_table) TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
{ {
int field_count= 0; int field_count= 0;
Item *item; Item *item;
TABLE *table; TABLE *table;
List<Item> field_list; List<Item> field_list;
ST_SCHEMA_TABLE *schema_table= table_list->schema_table;
ST_FIELD_INFO *fields_info= schema_table->fields_info; ST_FIELD_INFO *fields_info= schema_table->fields_info;
CHARSET_INFO *cs= system_charset_info; CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("create_schema_table"); DBUG_ENTER("create_schema_table");
...@@ -2959,8 +2960,7 @@ TABLE *create_schema_table(THD *thd, ST_SCHEMA_TABLE *schema_table) ...@@ -2959,8 +2960,7 @@ TABLE *create_schema_table(THD *thd, ST_SCHEMA_TABLE *schema_table)
field_list, (ORDER*) 0, 0, 0, field_list, (ORDER*) 0, 0, 0,
(select_lex->options | thd->options | (select_lex->options | thd->options |
TMP_TABLE_ALL_COLUMNS), TMP_TABLE_ALL_COLUMNS),
HA_POS_ERROR, HA_POS_ERROR, table_list->real_name)))
(char *) schema_table->table_name)))
DBUG_RETURN(0); DBUG_RETURN(0);
DBUG_RETURN(table); DBUG_RETURN(table);
} }
...@@ -3130,8 +3130,7 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) ...@@ -3130,8 +3130,7 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list)
{ {
TABLE *table; TABLE *table;
DBUG_ENTER("mysql_schema_table"); DBUG_ENTER("mysql_schema_table");
if (!(table= table_list->schema_table-> if (!(table= table_list->schema_table->create_table(thd, table_list)))
create_table(thd, table_list->schema_table)))
{ {
DBUG_RETURN(1); DBUG_RETURN(1);
} }
...@@ -3292,7 +3291,7 @@ ST_FIELD_INFO columns_fields_info[]= ...@@ -3292,7 +3291,7 @@ ST_FIELD_INFO columns_fields_info[]=
{"ORDINAL_POSITION", 21 , MYSQL_TYPE_LONG, 0, 0, 0}, {"ORDINAL_POSITION", 21 , MYSQL_TYPE_LONG, 0, 0, 0},
{"COLUMN_DEFAULT", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Default"}, {"COLUMN_DEFAULT", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Default"},
{"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"}, {"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"},
{"DATA_TYPE", 65535, MYSQL_TYPE_STRING, 0, 0, 0}, {"DATA_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"CHARACTER_MAXIMUM_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 0, 0}, {"CHARACTER_MAXIMUM_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 0, 0},
{"CHARACTER_OCTET_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 0, 0}, {"CHARACTER_OCTET_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 0, 0},
{"NUMERIC_PRECISION", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, {"NUMERIC_PRECISION", 21 , MYSQL_TYPE_LONG, 0, 1, 0},
......
...@@ -243,7 +243,7 @@ typedef struct st_schema_table ...@@ -243,7 +243,7 @@ typedef struct st_schema_table
const char* table_name; const char* table_name;
ST_FIELD_INFO *fields_info; ST_FIELD_INFO *fields_info;
/* Create information_schema table */ /* Create information_schema table */
TABLE *(*create_table) (THD *thd, struct st_schema_table *schema_table); TABLE *(*create_table) (THD *thd, struct st_table_list *table_list);
/* Fill table with data */ /* Fill table with data */
int (*fill_table) (THD *thd, struct st_table_list *tables, COND *cond); int (*fill_table) (THD *thd, struct st_table_list *tables, COND *cond);
/* Handle fileds for old SHOW */ /* Handle fileds for old SHOW */
......
...@@ -694,7 +694,8 @@ static void verify_prepare_field(MYSQL_RES *result, ...@@ -694,7 +694,8 @@ static void verify_prepare_field(MYSQL_RES *result,
as utf8. Field length is calculated as number of characters * maximum as utf8. Field length is calculated as number of characters * maximum
number of bytes a character can occupy. number of bytes a character can occupy.
*/ */
DIE_UNLESS(field->length == length * cs->mbmaxlen); if (length)
DIE_UNLESS(field->length == length * cs->mbmaxlen);
if (def) if (def)
DIE_UNLESS(strcmp(field->def, def) == 0); DIE_UNLESS(strcmp(field->def, def) == 0);
} }
...@@ -7280,7 +7281,7 @@ static void test_explain_bug() ...@@ -7280,7 +7281,7 @@ static void test_explain_bug()
MYSQL_TYPE_STRING, 0, 0, "", 192, 0); MYSQL_TYPE_STRING, 0, 0, "", 192, 0);
verify_prepare_field(result, 1, "Type", "COLUMN_TYPE", verify_prepare_field(result, 1, "Type", "COLUMN_TYPE",
MYSQL_TYPE_BLOB, 0, 0, "", 193203, 0); MYSQL_TYPE_BLOB, 0, 0, "", 0, 0);
verify_prepare_field(result, 2, "Null", "IS_NULLABLE", verify_prepare_field(result, 2, "Null", "IS_NULLABLE",
MYSQL_TYPE_STRING, 0, 0, "", 9, 0); MYSQL_TYPE_STRING, 0, 0, "", 9, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment