Bug#5299 Remove SHOW COLUMN TYPES, backport to Betony
This commit is contained in:
parent
8bc236e936
commit
0c7e9e3f52
@ -808,7 +808,6 @@ show plugins;
|
|||||||
show columns in t1;
|
show columns in t1;
|
||||||
show slave hosts;
|
show slave hosts;
|
||||||
show keys in t1;
|
show keys in t1;
|
||||||
show column types;
|
|
||||||
show table types;
|
show table types;
|
||||||
show storage engines;
|
show storage engines;
|
||||||
show authors;
|
show authors;
|
||||||
|
@ -20,16 +20,16 @@ return 0;
|
|||||||
end $$
|
end $$
|
||||||
show procedure code signal_proc;
|
show procedure code signal_proc;
|
||||||
Pos Instruction
|
Pos Instruction
|
||||||
0 stmt 136 "SIGNAL foo"
|
0 stmt 135 "SIGNAL foo"
|
||||||
1 stmt 136 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
||||||
2 stmt 137 "RESIGNAL foo"
|
2 stmt 136 "RESIGNAL foo"
|
||||||
3 stmt 137 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
||||||
drop procedure signal_proc;
|
drop procedure signal_proc;
|
||||||
show function code signal_func;
|
show function code signal_func;
|
||||||
Pos Instruction
|
Pos Instruction
|
||||||
0 stmt 136 "SIGNAL foo"
|
0 stmt 135 "SIGNAL foo"
|
||||||
1 stmt 136 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
||||||
2 stmt 137 "RESIGNAL foo"
|
2 stmt 136 "RESIGNAL foo"
|
||||||
3 stmt 137 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
||||||
4 freturn 3 0
|
4 freturn 3 0
|
||||||
drop function signal_func;
|
drop function signal_func;
|
||||||
|
@ -155,11 +155,11 @@ Pos Instruction
|
|||||||
0 stmt 9 "drop temporary table if exists sudoku..."
|
0 stmt 9 "drop temporary table if exists sudoku..."
|
||||||
1 stmt 1 "create temporary table sudoku_work ( ..."
|
1 stmt 1 "create temporary table sudoku_work ( ..."
|
||||||
2 stmt 1 "create temporary table sudoku_schedul..."
|
2 stmt 1 "create temporary table sudoku_schedul..."
|
||||||
3 stmt 94 "call sudoku_init()"
|
3 stmt 93 "call sudoku_init()"
|
||||||
4 jump_if_not 7(8) p_naive@0
|
4 jump_if_not 7(8) p_naive@0
|
||||||
5 stmt 4 "update sudoku_work set cnt = 0 where ..."
|
5 stmt 4 "update sudoku_work set cnt = 0 where ..."
|
||||||
6 jump 8
|
6 jump 8
|
||||||
7 stmt 94 "call sudoku_count()"
|
7 stmt 93 "call sudoku_count()"
|
||||||
8 stmt 6 "insert into sudoku_schedule (row,col)..."
|
8 stmt 6 "insert into sudoku_schedule (row,col)..."
|
||||||
9 set v_scounter@2 0
|
9 set v_scounter@2 0
|
||||||
10 set v_i@3 1
|
10 set v_i@3 1
|
||||||
|
@ -2377,7 +2377,6 @@ create procedure bug4902()
|
|||||||
begin
|
begin
|
||||||
show charset like 'foo';
|
show charset like 'foo';
|
||||||
show collation like 'foo';
|
show collation like 'foo';
|
||||||
show column types;
|
|
||||||
show create table t1;
|
show create table t1;
|
||||||
show create database test;
|
show create database test;
|
||||||
show databases like 'foo';
|
show databases like 'foo';
|
||||||
@ -2395,9 +2394,6 @@ end|
|
|||||||
call bug4902()|
|
call bug4902()|
|
||||||
Charset Description Default collation Maxlen
|
Charset Description Default collation Maxlen
|
||||||
Collation Charset Id Default Compiled Sortlen
|
Collation Charset Id Default Compiled Sortlen
|
||||||
Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
|
|
||||||
tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
|
|
||||||
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`id` char(16) NOT NULL DEFAULT '',
|
`id` char(16) NOT NULL DEFAULT '',
|
||||||
@ -2419,9 +2415,6 @@ Level Code Message
|
|||||||
call bug4902()|
|
call bug4902()|
|
||||||
Charset Description Default collation Maxlen
|
Charset Description Default collation Maxlen
|
||||||
Collation Charset Id Default Compiled Sortlen
|
Collation Charset Id Default Compiled Sortlen
|
||||||
Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
|
|
||||||
tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
|
|
||||||
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`id` char(16) NOT NULL DEFAULT '',
|
`id` char(16) NOT NULL DEFAULT '',
|
||||||
|
@ -629,7 +629,6 @@ show plugins;
|
|||||||
show columns in t1;
|
show columns in t1;
|
||||||
show slave hosts;
|
show slave hosts;
|
||||||
show keys in t1;
|
show keys in t1;
|
||||||
show column types;
|
|
||||||
show table types;
|
show table types;
|
||||||
show storage engines;
|
show storage engines;
|
||||||
show authors;
|
show authors;
|
||||||
|
@ -2882,7 +2882,6 @@ create procedure bug4902()
|
|||||||
begin
|
begin
|
||||||
show charset like 'foo';
|
show charset like 'foo';
|
||||||
show collation like 'foo';
|
show collation like 'foo';
|
||||||
show column types;
|
|
||||||
show create table t1;
|
show create table t1;
|
||||||
show create database test;
|
show create database test;
|
||||||
show databases like 'foo';
|
show databases like 'foo';
|
||||||
|
@ -3075,7 +3075,6 @@ SHOW_VAR com_status_vars[]= {
|
|||||||
{"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS},
|
{"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS},
|
||||||
{"show_charsets", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CHARSETS]), SHOW_LONG_STATUS},
|
{"show_charsets", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CHARSETS]), SHOW_LONG_STATUS},
|
||||||
{"show_collations", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS},
|
{"show_collations", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS},
|
||||||
{"show_column_types", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLUMN_TYPES]), SHOW_LONG_STATUS},
|
|
||||||
{"show_contributors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CONTRIBUTORS]), SHOW_LONG_STATUS},
|
{"show_contributors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CONTRIBUTORS]), SHOW_LONG_STATUS},
|
||||||
{"show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS},
|
{"show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS},
|
||||||
{"show_create_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_EVENT]), SHOW_LONG_STATUS},
|
{"show_create_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_EVENT]), SHOW_LONG_STATUS},
|
||||||
|
@ -177,7 +177,6 @@ sp_get_flags_for_command(LEX *lex)
|
|||||||
case SQLCOM_SHOW_BINLOG_EVENTS:
|
case SQLCOM_SHOW_BINLOG_EVENTS:
|
||||||
case SQLCOM_SHOW_CHARSETS:
|
case SQLCOM_SHOW_CHARSETS:
|
||||||
case SQLCOM_SHOW_COLLATIONS:
|
case SQLCOM_SHOW_COLLATIONS:
|
||||||
case SQLCOM_SHOW_COLUMN_TYPES:
|
|
||||||
case SQLCOM_SHOW_CONTRIBUTORS:
|
case SQLCOM_SHOW_CONTRIBUTORS:
|
||||||
case SQLCOM_SHOW_CREATE:
|
case SQLCOM_SHOW_CREATE:
|
||||||
case SQLCOM_SHOW_CREATE_DB:
|
case SQLCOM_SHOW_CREATE_DB:
|
||||||
|
@ -94,7 +94,7 @@ enum enum_sql_command {
|
|||||||
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
|
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
|
||||||
SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO,
|
SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO,
|
||||||
SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
|
SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
|
||||||
SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
|
SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
|
||||||
SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
|
SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
|
||||||
SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
|
SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
|
||||||
SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
|
SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
|
||||||
|
@ -300,7 +300,6 @@ void init_update_queries(void)
|
|||||||
sql_command_flags[SQLCOM_SHOW_BINLOGS]= CF_STATUS_COMMAND;
|
sql_command_flags[SQLCOM_SHOW_BINLOGS]= CF_STATUS_COMMAND;
|
||||||
sql_command_flags[SQLCOM_SHOW_SLAVE_HOSTS]= CF_STATUS_COMMAND;
|
sql_command_flags[SQLCOM_SHOW_SLAVE_HOSTS]= CF_STATUS_COMMAND;
|
||||||
sql_command_flags[SQLCOM_SHOW_BINLOG_EVENTS]= CF_STATUS_COMMAND;
|
sql_command_flags[SQLCOM_SHOW_BINLOG_EVENTS]= CF_STATUS_COMMAND;
|
||||||
sql_command_flags[SQLCOM_SHOW_COLUMN_TYPES]= CF_STATUS_COMMAND;
|
|
||||||
sql_command_flags[SQLCOM_SHOW_STORAGE_ENGINES]= CF_STATUS_COMMAND;
|
sql_command_flags[SQLCOM_SHOW_STORAGE_ENGINES]= CF_STATUS_COMMAND;
|
||||||
sql_command_flags[SQLCOM_SHOW_AUTHORS]= CF_STATUS_COMMAND;
|
sql_command_flags[SQLCOM_SHOW_AUTHORS]= CF_STATUS_COMMAND;
|
||||||
sql_command_flags[SQLCOM_SHOW_CONTRIBUTORS]= CF_STATUS_COMMAND;
|
sql_command_flags[SQLCOM_SHOW_CONTRIBUTORS]= CF_STATUS_COMMAND;
|
||||||
@ -3472,9 +3471,6 @@ end_with_restore_list:
|
|||||||
case SQLCOM_SHOW_PRIVILEGES:
|
case SQLCOM_SHOW_PRIVILEGES:
|
||||||
res= mysqld_show_privileges(thd);
|
res= mysqld_show_privileges(thd);
|
||||||
break;
|
break;
|
||||||
case SQLCOM_SHOW_COLUMN_TYPES:
|
|
||||||
res= mysqld_show_column_types(thd);
|
|
||||||
break;
|
|
||||||
case SQLCOM_SHOW_ENGINE_LOGS:
|
case SQLCOM_SHOW_ENGINE_LOGS:
|
||||||
#ifdef DONT_ALLOW_SHOW_COMMANDS
|
#ifdef DONT_ALLOW_SHOW_COMMANDS
|
||||||
my_message(ER_NOT_ALLOWED_COMMAND, ER(ER_NOT_ALLOWED_COMMAND),
|
my_message(ER_NOT_ALLOWED_COMMAND, ER(ER_NOT_ALLOWED_COMMAND),
|
||||||
|
@ -1923,7 +1923,6 @@ static bool check_prepared_statement(Prepared_statement *stmt)
|
|||||||
case SQLCOM_SHOW_PROCESSLIST:
|
case SQLCOM_SHOW_PROCESSLIST:
|
||||||
case SQLCOM_SHOW_STORAGE_ENGINES:
|
case SQLCOM_SHOW_STORAGE_ENGINES:
|
||||||
case SQLCOM_SHOW_PRIVILEGES:
|
case SQLCOM_SHOW_PRIVILEGES:
|
||||||
case SQLCOM_SHOW_COLUMN_TYPES:
|
|
||||||
case SQLCOM_SHOW_ENGINE_LOGS:
|
case SQLCOM_SHOW_ENGINE_LOGS:
|
||||||
case SQLCOM_SHOW_ENGINE_STATUS:
|
case SQLCOM_SHOW_ENGINE_STATUS:
|
||||||
case SQLCOM_SHOW_ENGINE_MUTEX:
|
case SQLCOM_SHOW_ENGINE_MUTEX:
|
||||||
|
@ -344,94 +344,6 @@ bool mysqld_show_privileges(THD *thd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
List all column types
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
struct show_column_type_st
|
|
||||||
{
|
|
||||||
const char *type;
|
|
||||||
uint size;
|
|
||||||
const char *min_value;
|
|
||||||
const char *max_value;
|
|
||||||
uint precision;
|
|
||||||
uint scale;
|
|
||||||
const char *nullable;
|
|
||||||
const char *auto_increment;
|
|
||||||
const char *unsigned_attr;
|
|
||||||
const char *zerofill;
|
|
||||||
const char *searchable;
|
|
||||||
const char *case_sensitivity;
|
|
||||||
const char *default_value;
|
|
||||||
const char *comment;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* TODO: Add remaning types */
|
|
||||||
|
|
||||||
static struct show_column_type_st sys_column_types[]=
|
|
||||||
{
|
|
||||||
{"tinyint",
|
|
||||||
1, "-128", "127", 0, 0, "YES", "YES",
|
|
||||||
"NO", "YES", "YES", "NO", "NULL,0",
|
|
||||||
"A very small integer"},
|
|
||||||
{"tinyint unsigned",
|
|
||||||
1, "0" , "255", 0, 0, "YES", "YES",
|
|
||||||
"YES", "YES", "YES", "NO", "NULL,0",
|
|
||||||
"A very small integer"},
|
|
||||||
};
|
|
||||||
|
|
||||||
bool mysqld_show_column_types(THD *thd)
|
|
||||||
{
|
|
||||||
List<Item> field_list;
|
|
||||||
Protocol *protocol= thd->protocol;
|
|
||||||
DBUG_ENTER("mysqld_show_column_types");
|
|
||||||
|
|
||||||
field_list.push_back(new Item_empty_string("Type",30));
|
|
||||||
field_list.push_back(new Item_int("Size",(longlong) 1,
|
|
||||||
MY_INT64_NUM_DECIMAL_DIGITS));
|
|
||||||
field_list.push_back(new Item_empty_string("Min_Value",20));
|
|
||||||
field_list.push_back(new Item_empty_string("Max_Value",20));
|
|
||||||
field_list.push_back(new Item_return_int("Prec", 4, MYSQL_TYPE_SHORT));
|
|
||||||
field_list.push_back(new Item_return_int("Scale", 4, MYSQL_TYPE_SHORT));
|
|
||||||
field_list.push_back(new Item_empty_string("Nullable",4));
|
|
||||||
field_list.push_back(new Item_empty_string("Auto_Increment",4));
|
|
||||||
field_list.push_back(new Item_empty_string("Unsigned",4));
|
|
||||||
field_list.push_back(new Item_empty_string("Zerofill",4));
|
|
||||||
field_list.push_back(new Item_empty_string("Searchable",4));
|
|
||||||
field_list.push_back(new Item_empty_string("Case_Sensitive",4));
|
|
||||||
field_list.push_back(new Item_empty_string("Default",NAME_CHAR_LEN));
|
|
||||||
field_list.push_back(new Item_empty_string("Comment",NAME_CHAR_LEN));
|
|
||||||
|
|
||||||
if (protocol->send_fields(&field_list,
|
|
||||||
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
|
||||||
DBUG_RETURN(TRUE);
|
|
||||||
|
|
||||||
/* TODO: Change the loop to not use 'i' */
|
|
||||||
for (uint i=0; i < sizeof(sys_column_types)/sizeof(sys_column_types[0]); i++)
|
|
||||||
{
|
|
||||||
protocol->prepare_for_resend();
|
|
||||||
protocol->store(sys_column_types[i].type, system_charset_info);
|
|
||||||
protocol->store((ulonglong) sys_column_types[i].size);
|
|
||||||
protocol->store(sys_column_types[i].min_value, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].max_value, system_charset_info);
|
|
||||||
protocol->store_short((longlong) sys_column_types[i].precision);
|
|
||||||
protocol->store_short((longlong) sys_column_types[i].scale);
|
|
||||||
protocol->store(sys_column_types[i].nullable, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].auto_increment, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].unsigned_attr, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].zerofill, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].searchable, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].case_sensitivity, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].default_value, system_charset_info);
|
|
||||||
protocol->store(sys_column_types[i].comment, system_charset_info);
|
|
||||||
if (protocol->write())
|
|
||||||
DBUG_RETURN(TRUE);
|
|
||||||
}
|
|
||||||
my_eof(thd);
|
|
||||||
DBUG_RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
find_files() - find files in a given directory.
|
find_files() - find files in a given directory.
|
||||||
|
|
||||||
|
@ -10210,11 +10210,6 @@ show_param:
|
|||||||
if (prepare_schema_table(YYTHD, lex, $3, SCH_STATISTICS))
|
if (prepare_schema_table(YYTHD, lex, $3, SCH_STATISTICS))
|
||||||
MYSQL_YYABORT;
|
MYSQL_YYABORT;
|
||||||
}
|
}
|
||||||
| COLUMN_SYM TYPES_SYM
|
|
||||||
{
|
|
||||||
LEX *lex=Lex;
|
|
||||||
lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES;
|
|
||||||
}
|
|
||||||
| TABLE_SYM TYPES_SYM
|
| TABLE_SYM TYPES_SYM
|
||||||
{
|
{
|
||||||
LEX *lex=Lex;
|
LEX *lex=Lex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user