WorkLog#1280 - Remove fixed table handler from lex/yacc

parent 0a5af444
......@@ -8,6 +8,7 @@ WAX@sergbook.mysql.com
administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
antony@ltantony.rdg.cyberkinetica.homeunix.net
arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com
arjen@george.bitbike.com
......
......@@ -300,4 +300,5 @@
#define ER_WARN_QC_RESIZE 1281
#define ER_BAD_FT_COLUMN 1282
#define ER_UNKNOWN_KEY_CACHE 1283
#define ER_ERROR_MESSAGES 284
#define ER_UNKNOWN_TABLE_ENGINE 1284
#define ER_ERROR_MESSAGES 285
......@@ -161,3 +161,4 @@ ER_WARN_DATA_OUT_OF_RANGE, "01000", "",
ER_WARN_DATA_TRUNCATED, "01000", "",
ER_WRONG_NAME_FOR_INDEX, "42000", "",
ER_WRONG_NAME_FOR_CATALOG, "42000", "",
ER_UNKNOWN_TABLE_ENGINE, "42000", "",
......@@ -200,17 +200,16 @@ t1 CREATE TABLE `t1` (
) TYPE=HEAP DEFAULT CHARSET=latin1
drop table t1;
SET SESSION table_type="gemini";
ERROR 42000: Unknown table engine 'gemini'
SELECT @@table_type;
@@table_type
GEMINI
HEAP
CREATE TABLE t1 (a int not null);
Warnings:
Warning 1265 Using storage engine MYISAM for table 't1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=latin1
) TYPE=HEAP DEFAULT CHARSET=latin1
SET SESSION table_type=default;
drop table t1;
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
......@@ -349,17 +348,16 @@ t1 CREATE TABLE `t1` (
) TYPE=HEAP DEFAULT CHARSET=latin1
drop table t1;
SET SESSION table_type="gemini";
ERROR 42000: Unknown table engine 'gemini'
SELECT @@table_type;
@@table_type
GEMINI
HEAP
CREATE TABLE t1 (a int not null);
Warnings:
Warning 1265 Using storage engine MYISAM for table 't1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=latin1
) TYPE=HEAP DEFAULT CHARSET=latin1
SET SESSION table_type=default;
drop table t1;
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
......
......@@ -15,11 +15,11 @@ select * from t1;
n
1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_behind_master
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root 9306 1 master-bin.000001 273 slave-relay-bin.000002 258 master-bin.000001 No No 0 0 214 317 None 0 No #
change master to master_user='root';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_behind_master
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root 9306 1 master-bin.000001 214 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 214 4 None 0 No #
select release_lock("a");
release_lock("a")
......
......@@ -121,7 +121,7 @@ Variable_name Value
table_type HEAP
show global variables like 'table_type';
Variable_name Value
table_type INNODB
table_type InnoDB
set GLOBAL query_cache_size=100000;
set GLOBAL myisam_max_sort_file_size=2000000;
show global variables like 'myisam_max_sort_file_size';
......@@ -219,7 +219,7 @@ ERROR HY000: Unknown system variable 'unknown_variable'
set max_join_size="hello";
ERROR 42000: Wrong argument type to variable 'max_join_size'
set table_type=UNKNOWN_TABLE_TYPE;
ERROR 42000: Variable 'table_type' can't be set to the value of 'UNKNOWN_TABLE_TYPE'
ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE'
set table_type=INNODB, big_tables=2;
ERROR 42000: Variable 'big_tables' can't be set to the value of '2'
show local variables like 'table_type';
......
......@@ -121,8 +121,8 @@ select @@warning_count;
drop table t1;
create table t1 (id int) type=isam;
Warnings:
Warning 1265 Using storage engine MYISAM for table 't1'
Warning 1265 Using storage engine MyISAM for table 't1'
alter table t1 type=isam;
Warnings:
Warning 1265 Using storage engine MYISAM for table 't1'
Warning 1265 Using storage engine MyISAM for table 't1'
drop table t1;
......@@ -155,7 +155,7 @@ SELECT @@table_type;
CREATE TABLE t1 (a int not null);
show create table t1;
drop table t1;
# Test what happens when using a non existing table type
--error 1284
SET SESSION table_type="gemini";
SELECT @@table_type;
CREATE TABLE t1 (a int not null);
......@@ -276,7 +276,7 @@ SELECT @@table_type;
CREATE TABLE t1 (a int not null);
show create table t1;
drop table t1;
# Test what happens when using a non existing table type
--error 1284
SET SESSION table_type="gemini";
SELECT @@table_type;
CREATE TABLE t1 (a int not null);
......
......@@ -124,7 +124,7 @@ set big_tables="OFFF";
set unknown_variable=1;
--error 1232
set max_join_size="hello";
--error 1231
--error 1284
set table_type=UNKNOWN_TABLE_TYPE;
--error 1231
set table_type=INNODB, big_tables=2;
......
......@@ -50,14 +50,33 @@ ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count,
ha_commit_count, ha_rollback_count,
ha_read_rnd_count, ha_read_rnd_next_count;
const char *ha_table_type[] = {
"", "DIAB_ISAM","HASH","MISAM","PISAM","RMS_ISAM","HEAP", "ISAM",
"MRG_ISAM","MYISAM", "MRG_MYISAM", "BDB", "INNODB", "GEMINI", "?", "?",NullS
};
static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
TYPELIB ha_table_typelib=
struct show_table_type_st sys_table_types[]=
{
array_elements(ha_table_type)-3, "", ha_table_type
{"MyISAM", &have_yes,
"Default type from 3.23 with great performance", DB_TYPE_MYISAM},
{"HEAP", &have_yes,
"Hash based, stored in memory, useful for temporary tables", DB_TYPE_HEAP},
{"MEMORY", &have_yes,
"Alias for HEAP", DB_TYPE_HEAP},
{"MERGE", &have_yes,
"Collection of identical MyISAM tables", DB_TYPE_MRG_MYISAM},
{"MRG_MYISAM",&have_yes,
"Alias for MERGE", DB_TYPE_MRG_MYISAM},
{"ISAM", &have_isam,
"Obsolete table type; Is replaced by MyISAM", DB_TYPE_ISAM},
{"MRG_ISAM", &have_isam,
"Obsolete table type; Is replaced by MRG_MYISAM", DB_TYPE_MRG_ISAM},
{"InnoDB", &have_innodb,
"Supports transactions, row-level locking and foreign keys", DB_TYPE_INNODB},
{"INNOBASE", &have_innodb,
"Alias for INNODB", DB_TYPE_INNODB},
{"BDB", &have_berkeley_db,
"Supports transactions and page-level locking", DB_TYPE_BERKELEY_DB},
{"BERKELEYDB",&have_berkeley_db,
"Alias for BDB", DB_TYPE_BERKELEY_DB},
{NullS, NULL, NullS, DB_TYPE_UNKNOWN}
};
const char *ha_row_type[] = {
......@@ -70,6 +89,33 @@ const char *tx_isolation_names[] =
TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
tx_isolation_names};
enum db_type ha_resolve_by_name(const char *name, uint namelen)
{
if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
return(enum db_type) current_thd->variables.table_type;
}
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
{
if (!my_strcasecmp(&my_charset_latin1, name, types->type))
return(enum db_type)types->db_type;
}
return DB_TYPE_UNKNOWN;
}
const char *ha_get_table_type(enum db_type db_type)
{
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
{
if (db_type == types->db_type)
return types->type;
}
return "none";
}
/* Use other database handler if databasehandler is not incompiled */
enum db_type ha_checktype(enum db_type database_type)
......@@ -77,18 +123,21 @@ enum db_type ha_checktype(enum db_type database_type)
switch (database_type) {
#ifdef HAVE_BERKELEY_DB
case DB_TYPE_BERKELEY_DB:
return(berkeley_skip ? DB_TYPE_MYISAM : database_type);
if (berkeley_skip) break;
return (database_type);
#endif
#ifdef HAVE_INNOBASE_DB
case DB_TYPE_INNODB:
return(innodb_skip ? DB_TYPE_MYISAM : database_type);
if (innodb_skip) break;
return (database_type);
#endif
#ifndef NO_HASH
case DB_TYPE_HASH:
#endif
#ifdef HAVE_ISAM
case DB_TYPE_ISAM:
return (isam_skip ? DB_TYPE_MYISAM : database_type);
if (isam_skip) break;
return (database_type);
case DB_TYPE_MRG_ISAM:
return (isam_skip ? DB_TYPE_MRG_MYISAM : database_type);
#else
......@@ -102,7 +151,13 @@ enum db_type ha_checktype(enum db_type database_type)
default:
break;
}
return(DB_TYPE_MYISAM); /* Use this as default */
return
DB_TYPE_UNKNOWN != (enum db_type) current_thd->variables.table_type ?
(enum db_type) current_thd->variables.table_type :
DB_TYPE_UNKNOWN != (enum db_type) global_system_variables.table_type ?
(enum db_type) global_system_variables.table_type :
DB_TYPE_MYISAM;
} /* ha_checktype */
......
......@@ -131,6 +131,13 @@ enum db_type { DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, DB_TYPE_GEMINI,
DB_TYPE_DEFAULT };
struct show_table_type_st {
const char *type;
SHOW_COMP_OPTION *value;
const char *comment;
enum db_type db_type;
};
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED};
......@@ -372,8 +379,9 @@ class handler :public Sql_alloc
/* Some extern variables used with handlers */
extern struct show_table_type_st sys_table_types[];
extern const char *ha_row_type[];
extern TYPELIB ha_table_typelib, tx_isolation_typelib;
extern TYPELIB tx_isolation_typelib;
/* Wrapper functions */
#define ha_commit_stmt(thd) (ha_commit_trans((thd), &((thd)->transaction.stmt)))
......@@ -383,6 +391,8 @@ extern TYPELIB ha_table_typelib, tx_isolation_typelib;
#define ha_supports_generate(T) (T != DB_TYPE_INNODB)
enum db_type ha_resolve_by_name(const char *name, uint namelen);
const char *ha_get_table_type(enum db_type db_type);
handler *get_new_handler(TABLE *table, enum db_type db_type);
my_off_t ha_get_ptr(byte *ptr, uint pack_length);
void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos);
......
......@@ -186,7 +186,6 @@ static SYMBOL symbols[] = {
{ "HAVING", SYM(HAVING),0,0},
{ "HANDLER", SYM(HANDLER_SYM),0,0},
{ "HASH", SYM(HASH_SYM),0,0},
{ "HEAP", SYM(HEAP_SYM),0,0},
{ "HELP", SYM(HELP_SYM),0,0},
{ "HIGH_PRIORITY", SYM(HIGH_PRIORITY),0,0},
{ "HOUR", SYM(HOUR_SYM),0,0},
......@@ -219,7 +218,6 @@ static SYMBOL symbols[] = {
{ "IF", SYM(IF),0,0},
{ "IS", SYM(IS),0,0},
{ "ISOLATION", SYM(ISOLATION),0,0},
{ "ISAM", SYM(ISAM_SYM),0,0},
{ "ISSUER", SYM(ISSUER_SYM),0,0},
{ "JOIN", SYM(JOIN_SYM),0,0},
{ "KEY", SYM(KEY_SYM),0,0},
......@@ -268,9 +266,7 @@ static SYMBOL symbols[] = {
{ "MEDIUMBLOB", SYM(MEDIUMBLOB),0,0},
{ "MEDIUMTEXT", SYM(MEDIUMTEXT),0,0},
{ "MEDIUMINT", SYM(MEDIUMINT),0,0},
{ "MERGE", SYM(MERGE_SYM),0,0},
{ "MEDIUM", SYM(MEDIUM_SYM),0,0},
{ "MEMORY", SYM(MEMORY_SYM),0,0},
{ "MICROSECOND", SYM(MICROSECOND_SYM),0,0},
{ "MIDDLEINT", SYM(MEDIUMINT),0,0}, /* For powerbuilder */
{ "MIN_ROWS", SYM(MIN_ROWS),0,0},
......@@ -284,8 +280,6 @@ static SYMBOL symbols[] = {
{ "MULTILINESTRING", SYM(MULTILINESTRING),0,0},
{ "MULTIPOINT", SYM(MULTIPOINT),0,0},
{ "MULTIPOLYGON", SYM(MULTIPOLYGON),0,0},
{ "MRG_MYISAM", SYM(MERGE_SYM),0,0},
{ "MYISAM", SYM(MYISAM_SYM),0,0},
{ "NAMES", SYM(NAMES_SYM),0,0},
{ "NATURAL", SYM(NATURAL),0,0},
{ "NATIONAL", SYM(NATIONAL_SYM),0,0},
......
......@@ -861,7 +861,6 @@ extern MY_BITMAP temp_pool;
extern String my_empty_string;
extern String my_null_string;
extern SHOW_VAR init_vars[],status_vars[], internal_vars[];
extern struct show_table_type_st table_type_vars[];
extern SHOW_COMP_OPTION have_isam;
extern SHOW_COMP_OPTION have_innodb;
extern SHOW_COMP_OPTION have_berkeley_db;
......
......@@ -5417,13 +5417,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case OPT_TABLE_TYPE:
{
int type;
if ((type=find_type(argument, &ha_table_typelib, 2)) <= 0)
if ((enum db_type)((global_system_variables.table_type=
ha_resolve_by_name(argument, strlen(argument)))) == DB_TYPE_UNKNOWN)
{
fprintf(stderr,"Unknown table type: %s\n",argument);
exit(1);
}
global_system_variables.table_type= type-1;
break;
}
case OPT_SERVER_ID:
......
......@@ -284,8 +284,8 @@ sys_var_thd_ulong sys_sort_buffer("sort_buffer_size",
&SV::sortbuff_size);
sys_var_thd_sql_mode sys_sql_mode("sql_mode",
&SV::sql_mode);
sys_var_thd_enum sys_table_type("table_type", &SV::table_type,
&ha_table_typelib);
sys_var_thd_table_type sys_table_type("table_type",
&SV::table_type);
sys_var_long_ptr sys_table_cache_size("table_cache",
&table_cache_size);
sys_var_long_ptr sys_thread_cache_size("thread_cache_size",
......@@ -2403,6 +2403,61 @@ int set_var_password::update(THD *thd)
#endif
}
/****************************************************************************
Functions to handle table_type
****************************************************************************/
bool sys_var_thd_table_type::check(THD *thd, set_var *var)
/* Based upon sys_var::check_enum() */
{
char buff[80];
const char *value;
String str(buff, sizeof(buff), &my_charset_latin1), *res;
if (var->value->result_type() == STRING_RESULT)
{
if (!(res=var->value->val_str(&str)) ||
!(var->save_result.ulong_value=
(ulong) ha_resolve_by_name(res->ptr(), res->length())))
{
value= res ? res->c_ptr() : "NULL";
goto err;
}
return 0;
}
err:
my_error(ER_UNKNOWN_TABLE_ENGINE, MYF(0), value);
return 1;
}
byte *sys_var_thd_table_type::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
ulong val;
val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
thd->variables.*offset);
const char *table_type= ha_get_table_type((enum db_type)val);
return (byte *)table_type;
}
void sys_var_thd_table_type::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
global_system_variables.*offset= (ulong) DB_TYPE_MYISAM;
else
thd->variables.*offset= (ulong) (global_system_variables.*offset);
}
bool sys_var_thd_table_type::update(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
global_system_variables.*offset= var->save_result.ulong_value;
else
thd->variables.*offset= var->save_result.ulong_value;
return 0;
}
/****************************************************************************
Functions to handle sql_mode
****************************************************************************/
......
......@@ -343,6 +343,26 @@ class sys_var_thd_sql_mode :public sys_var_thd_enum
};
class sys_var_thd_table_type :public sys_var_thd
{
protected:
ulong SV::*offset;
public:
sys_var_thd_table_type(const char *name_arg, ulong SV::*offset_arg)
:sys_var_thd(name_arg), offset(offset_arg)
{}
bool check(THD *thd, set_var *var);
SHOW_TYPE type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
{
return type != STRING_RESULT; /* Only accept strings */
}
void set_default(THD *thd, enum_var_type type);
bool update(THD *thd, set_var *var);
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
class sys_var_thd_bit :public sys_var_thd
{
sys_update_func update_func;
......
......@@ -296,3 +296,4 @@ character-set=latin2
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -290,3 +290,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -298,3 +298,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -287,3 +287,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -292,3 +292,4 @@ character-set=latin7
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -287,3 +287,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -299,3 +299,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -287,3 +287,4 @@ character-set=greek
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -289,3 +289,4 @@ character-set=latin2
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -287,3 +287,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -289,3 +289,4 @@ character-set=ujis
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -287,3 +287,4 @@ character-set=euckr
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -289,3 +289,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -289,3 +289,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -291,3 +291,4 @@ character-set=latin2
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -288,3 +288,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -291,3 +291,4 @@ character-set=latin2
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -289,3 +289,4 @@ character-set=koi8r
" %lu, - %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -282,3 +282,4 @@ character-set=cp1250
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -295,3 +295,4 @@ character-set=latin2
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -289,3 +289,4 @@ character-set=latin1
"Query cache failed to set size %lu, new query cache size is %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -287,3 +287,4 @@ character-set=latin1
"Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu",
"Kolumn '%-.64s' kan inte vara del av ett FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -292,3 +292,4 @@ character-set=koi8u
" Ԧ ͦ %lu, ͦ Ԧ - %lu",
"Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'",
"Unknown table engine '%s'",
......@@ -173,33 +173,6 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild)
** List all table types supported
***************************************************************************/
struct show_table_type_st {
const char *type;
SHOW_COMP_OPTION *value;
const char *comment;
};
SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
static struct show_table_type_st sys_table_types[]=
{
{"MyISAM", &have_yes,
"Default type from 3.23 with great performance"},
{"HEAP" , &have_yes,
"Hash based, stored in memory, useful for temporary tables"},
{"MERGE", &have_yes,
"Collection of identical MyISAM tables"},
{"ISAM", &have_isam,
"Obsolete table type; Is replaced by MyISAM"},
{"InnoDB", &have_innodb,
"Supports transactions, row-level locking and foreign keys"},
{"BDB", &have_berkeley_db,
"Supports transactions and page-level locking"},
{NullS, NULL, NullS}
};
int mysqld_show_table_types(THD *thd)
{
List<Item> field_list;
......@@ -213,8 +186,8 @@ int mysqld_show_table_types(THD *thd)
if (protocol->send_fields(&field_list,1))
DBUG_RETURN(1);
const char *default_type_name=
ha_table_typelib.type_names[thd->variables.table_type];
const char *default_type_name=
ha_get_table_type((enum db_type)thd->variables.table_type);
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
......
......@@ -404,7 +404,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER),
ha_table_typelib.type_names[new_db_type],
ha_get_table_type(new_db_type),
table_name);
}
db_options=create_info->table_options;
......@@ -2016,7 +2016,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER),
ha_table_typelib.type_names[new_db_type],
ha_get_table_type(new_db_type),
new_name);
}
if (create_info->row_type == ROW_TYPE_NOT_USED)
......
......@@ -241,7 +241,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token GROUP
%token HAVING
%token HASH_SYM
%token HEAP_SYM
%token HEX_NUM
%token HIGH_PRIORITY
%token HOSTS_SYM
......@@ -257,7 +256,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token INTO
%token IN_SYM
%token ISOLATION
%token ISAM_SYM
%token JOIN_SYM
%token KEYS
%token KEY_SYM
......@@ -296,10 +294,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token MAX_QUERIES_PER_HOUR
%token MAX_UPDATES_PER_HOUR
%token MEDIUM_SYM
%token MERGE_SYM
%token MEMORY_SYM
%token MIN_ROWS
%token MYISAM_SYM
%token NAMES_SYM
%token NATIONAL_SYM
%token NATURAL
......@@ -1126,13 +1121,14 @@ create_table_option:
| INDEX DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; };
table_types:
ISAM_SYM { $$= DB_TYPE_ISAM; }
| MYISAM_SYM { $$= DB_TYPE_MYISAM; }
| MERGE_SYM { $$= DB_TYPE_MRG_MYISAM; }
| HEAP_SYM { $$= DB_TYPE_HEAP; }
| MEMORY_SYM { $$= DB_TYPE_HEAP; }
| BERKELEY_DB_SYM { $$= DB_TYPE_BERKELEY_DB; }
| INNOBASE_SYM { $$= DB_TYPE_INNODB; };
ident_or_text
{
$$ = ha_resolve_by_name($1.str,$1.length);
if ($$ == DB_TYPE_UNKNOWN) {
net_printf(YYTHD, ER_UNKNOWN_TABLE_ENGINE, $1.str);
YYABORT;
}
};
row_types:
DEFAULT { $$= ROW_TYPE_DEFAULT; }
......@@ -4633,7 +4629,6 @@ keyword:
| GLOBAL_SYM {}
| HANDLER_SYM {}
| HASH_SYM {}
| HEAP_SYM {}
| HELP_SYM {}
| HOSTS_SYM {}
| HOUR_SYM {}
......@@ -4641,7 +4636,6 @@ keyword:
| IMPORT {}
| INDEXES {}
| ISOLATION {}
| ISAM_SYM {}
| ISSUER_SYM {}
| INNOBASE_SYM {}
| INSERT_METHOD {}
......@@ -4672,8 +4666,6 @@ keyword:
| MAX_QUERIES_PER_HOUR {}
| MAX_UPDATES_PER_HOUR {}
| MEDIUM_SYM {}
| MERGE_SYM {}
| MEMORY_SYM {}
| MICROSECOND_SYM {}
| MINUTE_SYM {}
| MIN_ROWS {}
......@@ -4683,7 +4675,6 @@ keyword:
| MULTILINESTRING {}
| MULTIPOINT {}
| MULTIPOLYGON {}
| MYISAM_SYM {}
| NAMES_SYM {}
| NATIONAL_SYM {}
| NCHAR_SYM {}
......
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