Commit cd2edd17 authored by unknown's avatar unknown

remove unused parts of code

fix for 'show create schema_table'
fix for usage schema tables in subselect
'wrong schema table charset' fix


mysql-test/r/information_schema.result:
  'wrong schema table charset' fix
mysql-test/t/information_schema.test:
  'wrong schema table charset' fix
sql/mysql_priv.h:
  fix for 'show create schema_table'
sql/sql_class.cc:
  'wrong schema table charset' fix
sql/sql_class.h:
  'wrong schema table charset' fix
sql/sql_parse.cc:
  fix for 'show create schema_table'
sql/sql_select.cc:
  'wrong schema table charset' fix
sql/sql_show.cc:
  remove unused parts of code
  fix for 'show create schema_table'
  fix for usage schema tables in subselect
sql/table.h:
  remove unused parts of coed
tests/client_test.c:
  'wrong schema table charset' fix
parent 2836164f
...@@ -116,7 +116,7 @@ Field Type Collation Null Key Default Extra Privileges Comment ...@@ -116,7 +116,7 @@ Field Type Collation Null Key Default Extra Privileges Comment
Insert_priv enum('N','Y') utf8_bin N select,insert,update,references Insert_priv enum('N','Y') utf8_bin N select,insert,update,references
show full columns from v1; show full columns from v1;
Field Type Collation Null Key Default Extra Privileges Comment Field Type Collation Null Key Default Extra Privileges Comment
c char(64) latin1_swedish_ci select,insert,update,references c char(64) utf8_general_ci select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1" select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a"; and column_name= "a";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME TYPE COLLATION_NAME IS_NULLABLE KEY COLUMN_DEFAULT EXTRA PRIVILEGES COMMENT TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME TYPE COLLATION_NAME IS_NULLABLE KEY COLUMN_DEFAULT EXTRA PRIVILEGES COMMENT
...@@ -245,7 +245,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -245,7 +245,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE # ALL NULL NULL NULL NULL 2 1 SIMPLE # ALL NULL NULL NULL NULL 2
1 SIMPLE # ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE # ALL NULL NULL NULL NULL 2 Using where
select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a, select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
mysql.proc b where a.ROUTINE_NAME = b.name; mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8);
ROUTINE_NAME name ROUTINE_NAME name
sub1 sub1 sub1 sub1
sel2 sel2 sel2 sel2
...@@ -292,10 +292,10 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par ...@@ -292,10 +292,10 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
select * from information_schema.VIEWS where TABLE_NAME like "v%"; select * from information_schema.VIEWS where TABLE_NAME like "v%";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE
NULL test v0 select `SCHEMATA`.`SCHEMA_NAME` AS `c` from `information_schema`.`SCHEMATA` NONE NO NULL test v0 select `SCHEMATA`.`SCHEMA_NAME` AS `c` from `information_schema`.`SCHEMATA` NONE NO
NULL test v1 select `TABLES`.`TABLE_NAME` AS `c` from `information_schema`.`TABLES` where (`TABLES`.`TABLE_NAME` = _latin1'v1') NONE NO NULL test v1 select `TABLES`.`TABLE_NAME` AS `c` from `information_schema`.`TABLES` where (`TABLES`.`TABLE_NAME` = _utf8'v1') NONE NO
NULL test v2 select `COLUMNS`.`COLUMN_NAME` AS `c` from `information_schema`.`COLUMNS` where (`COLUMNS`.`TABLE_NAME` = _latin1'v2') NONE NO NULL test v2 select `COLUMNS`.`COLUMN_NAME` AS `c` from `information_schema`.`COLUMNS` where (`COLUMNS`.`TABLE_NAME` = _utf8'v2') NONE NO
NULL test v3 select `CHARACTER_SETS`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`CHARACTER_SETS` where (`CHARACTER_SETS`.`CHARACTER_SET_NAME` like _latin1'latin1%') NONE NO NULL test v3 select `CHARACTER_SETS`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`CHARACTER_SETS` where (`CHARACTER_SETS`.`CHARACTER_SET_NAME` like _utf8'latin1%') NONE NO
NULL test v4 select `COLLATIONS`.`COLLATION_NAME` AS `c` from `information_schema`.`COLLATIONS` where (`COLLATIONS`.`COLLATION_NAME` like _latin1'latin1%') NONE NO NULL test v4 select `COLLATIONS`.`COLLATION_NAME` AS `c` from `information_schema`.`COLLATIONS` where (`COLLATIONS`.`COLLATION_NAME` like _utf8'latin1%') NONE NO
drop view v0, v1, v2, v3, v4; drop view v0, v1, v2, v3, v4;
create table t1 (a int); create table t1 (a int);
grant select,update,insert on t1 to mysqltest_1@localhost; grant select,update,insert on t1 to mysqltest_1@localhost;
...@@ -445,3 +445,44 @@ select AUTO_INCREMENT from information_schema.tables where table_name = 't1'; ...@@ -445,3 +445,44 @@ select AUTO_INCREMENT from information_schema.tables where table_name = 't1';
AUTO_INCREMENT AUTO_INCREMENT
4 4
drop table t1; drop table t1;
create table t1 (s1 int);
insert into t1 values (0),(9),(0);
select s1 from t1 where s1 in (select version from
information_schema.tables) union select version from
information_schema.tables;
s1
9
drop table t1;
SHOW CREATE TABLE INFORMATION_SCHEMA.CHARACTER_SETS;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
`CHARACTER_SET_NAME` char(30) NOT NULL default '',
`Description` char(60) NOT NULL default '',
`DEFAULT_COLLATE_NAME` char(60) NOT NULL default '',
`Maxlen` bigint(3) NOT NULL default '0'
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=2282
set names latin2;
SHOW CREATE TABLE INFORMATION_SCHEMA.CHARACTER_SETS;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
`CHARACTER_SET_NAME` char(30) NOT NULL default '',
`Description` char(60) NOT NULL default '',
`DEFAULT_COLLATE_NAME` char(60) NOT NULL default '',
`Maxlen` bigint(3) NOT NULL default '0'
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=2282
set names latin1;
create table t1 select * from information_schema.CHARACTER_SETS
where CHARACTER_SET_NAME like "latin1";
select * from t1;
CHARACTER_SET_NAME Description DEFAULT_COLLATE_NAME Maxlen
latin1 ISO 8859-1 West European latin1_swedish_ci 1
alter table t1 default character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CHARACTER_SET_NAME` char(30) NOT NULL default '',
`Description` char(60) NOT NULL default '',
`DEFAULT_COLLATE_NAME` char(60) NOT NULL default '',
`Maxlen` bigint(3) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table t1;
...@@ -104,7 +104,7 @@ information_schema.SCHEMATA b where ...@@ -104,7 +104,7 @@ information_schema.SCHEMATA b where
a.ROUTINE_SCHEMA = b.SCHEMA_NAME; a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a, select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
mysql.proc b where a.ROUTINE_NAME = b.name; mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8);
select count(*) from information_schema.ROUTINES; select count(*) from information_schema.ROUTINES;
# #
...@@ -222,4 +222,23 @@ create table t1 (a int not null auto_increment,b int, primary key (a)); ...@@ -222,4 +222,23 @@ create table t1 (a int not null auto_increment,b int, primary key (a));
insert into t1 values (1,1),(NULL,3),(NULL,4); insert into t1 values (1,1),(NULL,3),(NULL,4);
select AUTO_INCREMENT from information_schema.tables where table_name = 't1'; select AUTO_INCREMENT from information_schema.tables where table_name = 't1';
drop table t1; drop table t1;
\ No newline at end of file create table t1 (s1 int);
insert into t1 values (0),(9),(0);
select s1 from t1 where s1 in (select version from
information_schema.tables) union select version from
information_schema.tables;
drop table t1;
SHOW CREATE TABLE INFORMATION_SCHEMA.CHARACTER_SETS;
set names latin2;
SHOW CREATE TABLE INFORMATION_SCHEMA.CHARACTER_SETS;
set names latin1;
create table t1 select * from information_schema.CHARACTER_SETS
where CHARACTER_SET_NAME like "latin1";
select * from t1;
alter table t1 default character set utf8;
show create table t1;
drop table t1;
...@@ -701,7 +701,7 @@ void append_identifier(THD *thd, String *packet, const char *name, ...@@ -701,7 +701,7 @@ void append_identifier(THD *thd, String *packet, const char *name,
uint length); uint length);
int get_quote_char_for_identifier(THD *thd, const char *name, uint length); int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild); void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild);
int mysqld_dump_create_info(THD *thd, TABLE *table, int fd = -1); int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd = -1);
bool mysqld_show_create(THD *thd, TABLE_LIST *table_list); bool mysqld_show_create(THD *thd, TABLE_LIST *table_list);
bool mysqld_show_create_db(THD *thd, char *dbname, HA_CREATE_INFO *create); bool mysqld_show_create_db(THD *thd, char *dbname, HA_CREATE_INFO *create);
......
...@@ -1765,6 +1765,7 @@ void TMP_TABLE_PARAM::init() ...@@ -1765,6 +1765,7 @@ void TMP_TABLE_PARAM::init()
field_count= sum_func_count= func_count= hidden_field_count= 0; field_count= sum_func_count= func_count= hidden_field_count= 0;
group_parts= group_length= group_null_parts= 0; group_parts= group_length= group_null_parts= 0;
quick_group= 1; quick_group= 1;
table_charset= 0;
} }
......
...@@ -1425,6 +1425,7 @@ class TMP_TABLE_PARAM :public Sql_alloc ...@@ -1425,6 +1425,7 @@ class TMP_TABLE_PARAM :public Sql_alloc
bool using_indirect_summary_function; bool using_indirect_summary_function;
/* If >0 convert all blob fields to varchar(convert_blob_length) */ /* If >0 convert all blob fields to varchar(convert_blob_length) */
uint convert_blob_length; uint convert_blob_length;
CHARSET_INFO *table_charset;
TMP_TABLE_PARAM() TMP_TABLE_PARAM()
:copy_funcs_it(copy_funcs), copy_field(0), group_parts(0), :copy_funcs_it(copy_funcs), copy_field(0), group_parts(0),
......
...@@ -1220,7 +1220,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd) ...@@ -1220,7 +1220,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
thd->free_list = 0; thd->free_list = 0;
thd->query_length=(uint) strlen(tbl_name); thd->query_length=(uint) strlen(tbl_name);
thd->query = tbl_name; thd->query = tbl_name;
if ((error = mysqld_dump_create_info(thd, table, -1))) if ((error = mysqld_dump_create_info(thd, table_list, -1)))
{ {
my_error(ER_GET_ERRNO, MYF(0), my_errno); my_error(ER_GET_ERRNO, MYF(0), my_errno);
goto err; goto err;
......
...@@ -7833,6 +7833,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, ...@@ -7833,6 +7833,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
table->temp_pool_slot = temp_pool_slot; table->temp_pool_slot = temp_pool_slot;
table->copy_blobs= 1; table->copy_blobs= 1;
table->in_use= thd; table->in_use= thd;
table->table_charset= param->table_charset;
table->keys_for_keyread.init(); table->keys_for_keyread.init();
table->keys_in_use.init(); table->keys_in_use.init();
table->read_only_keys.init(); table->read_only_keys.init();
......
This diff is collapsed.
...@@ -232,7 +232,6 @@ typedef struct st_field_info ...@@ -232,7 +232,6 @@ typedef struct st_field_info
enum enum_field_types field_type; enum enum_field_types field_type;
int value; int value;
bool maybe_null; bool maybe_null;
bool utf8;
const char* old_name; const char* old_name;
} ST_FIELD_INFO; } ST_FIELD_INFO;
......
...@@ -7261,22 +7261,22 @@ static void test_explain_bug() ...@@ -7261,22 +7261,22 @@ static void test_explain_bug()
DIE_UNLESS(6 == mysql_num_fields(result)); DIE_UNLESS(6 == mysql_num_fields(result));
verify_prepare_field(result, 0, "Field", "COLUMN_NAME", verify_prepare_field(result, 0, "Field", "COLUMN_NAME",
MYSQL_TYPE_STRING, 0, 0, "", NAME_LEN, 0); MYSQL_TYPE_STRING, 0, 0, "", 192, 0);
verify_prepare_field(result, 1, "Type", "TYPE", verify_prepare_field(result, 1, "Type", "TYPE",
MYSQL_TYPE_STRING, 0, 0, "", 40, 0); MYSQL_TYPE_STRING, 0, 0, "", 120, 0);
verify_prepare_field(result, 2, "Null", "IS_NULLABLE", verify_prepare_field(result, 2, "Null", "IS_NULLABLE",
MYSQL_TYPE_STRING, 0, 0, "", 3, 0); MYSQL_TYPE_STRING, 0, 0, "", 9, 0);
verify_prepare_field(result, 3, "Key", "KEY", verify_prepare_field(result, 3, "Key", "KEY",
MYSQL_TYPE_STRING, 0, 0, "", 3, 0); MYSQL_TYPE_STRING, 0, 0, "", 9, 0);
verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT", verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT",
MYSQL_TYPE_STRING, 0, 0, "", NAME_LEN, 0); MYSQL_TYPE_STRING, 0, 0, "", 192, 0);
verify_prepare_field(result, 5, "Extra", "EXTRA", verify_prepare_field(result, 5, "Extra", "EXTRA",
MYSQL_TYPE_STRING, 0, 0, "", 20, 0); MYSQL_TYPE_STRING, 0, 0, "", 60, 0);
mysql_free_result(result); mysql_free_result(result);
mysql_stmt_close(stmt); mysql_stmt_close(stmt);
......
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