diff options
author | pem@mysql.com <> | 2003-12-05 13:11:50 +0100 |
---|---|---|
committer | pem@mysql.com <> | 2003-12-05 13:11:50 +0100 |
commit | 63f4858030a257364e83e90033a4099300a07659 (patch) | |
tree | a07a30ca097bfae53819a79e123ec4c4dd7d751b /sql | |
parent | a1c593f141119d6fda124cf7c64f9632a755c9c6 (diff) | |
parent | 0ca7f54b5e963583f9fafc3a7363313247d53f31 (diff) | |
download | mariadb-git-63f4858030a257364e83e90033a4099300a07659.tar.gz |
Merged 4.1 -> 5.0
Diffstat (limited to 'sql')
34 files changed, 180 insertions, 92 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index ac14f383eab..fe168d12fce 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -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,35 +89,31 @@ 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(char *name, uint namelen) +enum db_type ha_resolve_by_name(const char *name, uint namelen) { - enum db_type result = DB_TYPE_UNKNOWN; - if (!my_strcasecmp(&my_charset_latin1, name, "HEAP") || - !my_strcasecmp(&my_charset_latin1, name, "MEMORY")) { - result = DB_TYPE_HEAP; - } else - if (!my_strcasecmp(&my_charset_latin1, name, "MRG_MYISAM") || - !my_strcasecmp(&my_charset_latin1, name, "MERGE")) { - result = DB_TYPE_MRG_MYISAM; - } else - if (!my_strcasecmp(&my_charset_latin1, name, "MYISAM")) { - result = DB_TYPE_MYISAM; - } else - if (!my_strcasecmp(&my_charset_latin1, name, "BDB") || - !my_strcasecmp(&my_charset_latin1, name, "BERKELEYDB")) { - result = DB_TYPE_BERKELEY_DB; - } else - if (!my_strcasecmp(&my_charset_latin1, name, "INNODB") || - !my_strcasecmp(&my_charset_latin1, name, "INNOBASE")) { - result = DB_TYPE_INNODB; - } else - if (!my_strcasecmp(&my_charset_latin1, name, "ISAM")) { - result = DB_TYPE_ISAM; - } else if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) { - result = (enum db_type) current_thd->variables.table_type; + return(enum db_type) current_thd->variables.table_type; } - return result; + + 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 */ @@ -136,12 +151,13 @@ enum db_type ha_checktype(enum db_type database_type) default: break; } - /* Use this as default */ -#if 0 - return((enum db_type) current_thd->variables.table_type); -#else - return(DB_TYPE_MYISAM); -#endif + + 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 */ diff --git a/sql/handler.h b/sql/handler.h index 49c7e9d06c5..2183b8fa992 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -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 @@ public: /* 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,7 +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(char *name, uint namelen); +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); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index a393e80f978..3ace72ea24c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -860,7 +860,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; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1108be6e1b5..0d7fde59dbb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3650,7 +3650,7 @@ enum options_mysqld OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS, OPT_MAX_LENGTH_FOR_SORT_DATA, OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE, - OPT_MAX_ERROR_COUNT, OPT_MAX_PREP_STMT, + OPT_MAX_ERROR_COUNT, OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE, OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT, @@ -4277,11 +4277,11 @@ log and this option does nothing anymore.", { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", (gptr*) &ft_min_word_len, (gptr*) &ft_min_word_len, 0, GET_ULONG, - REQUIRED_ARG, 4, 1, HA_FT_MAXLEN, 0, 1, 0}, + REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0}, { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", (gptr*) &ft_max_word_len, (gptr*) &ft_max_word_len, 0, GET_ULONG, - REQUIRED_ARG, HA_FT_MAXLEN, 10, HA_FT_MAXLEN, 0, 1, 0}, + REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0}, { "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT, "Number of best matches to use for query expansion", (gptr*) &ft_query_expansion_limit, (gptr*) &ft_query_expansion_limit, 0, GET_ULONG, @@ -4440,11 +4440,6 @@ The minimum value for this variable is 4096.", (gptr*) &global_system_variables.max_length_for_sort_data, (gptr*) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG, REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, - {"max_prepared_statements", OPT_MAX_PREP_STMT, - "Max number of prepared_statements for a thread.", - (gptr*) &global_system_variables.max_prep_stmt_count, - (gptr*) &max_system_variables.max_prep_stmt_count, 0, GET_ULONG, - REQUIRED_ARG, DEFAULT_PREP_STMT_COUNT, 0, ~0L, 0, 1, 0}, {"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE, "If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 expected, the minimum value for this variable is 4096.", (gptr*) &max_relay_log_size, (gptr*) &max_relay_log_size, 0, GET_ULONG, @@ -5457,13 +5452,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: diff --git a/sql/set_var.cc b/sql/set_var.cc index 5912862f23b..74656f13c46 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -203,8 +203,6 @@ sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size", &SV::max_join_size, fix_max_join_size); #endif -sys_var_thd_ulong sys_max_prep_stmt_count("max_prepared_statements", - &SV::max_prep_stmt_count); sys_var_long_ptr sys_max_relay_log_size("max_relay_log_size", &max_relay_log_size, fix_max_relay_log_size); @@ -285,8 +283,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", @@ -463,7 +461,6 @@ sys_var *sys_variables[]= &sys_max_heap_table_size, &sys_max_join_size, &sys_max_length_for_sort_data, - &sys_max_prep_stmt_count, &sys_max_relay_log_size, &sys_max_seeks_for_key, &sys_max_sort_length, @@ -654,7 +651,6 @@ struct show_var_st init_vars[]= { {sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS}, {sys_max_length_for_sort_data.name, (char*) &sys_max_length_for_sort_data, SHOW_SYS}, - {sys_max_prep_stmt_count.name,(char*) &sys_max_prep_stmt_count, SHOW_SYS}, {sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS}, {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS}, {sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS}, @@ -2435,6 +2431,61 @@ int set_var_password::update(THD *thd) } /**************************************************************************** + 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 ****************************************************************************/ diff --git a/sql/set_var.h b/sql/set_var.h index 58ae53190e0..946341c4559 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -343,6 +343,26 @@ public: }; +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; diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 76c936019a0..e98a08ece94 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -297,6 +297,7 @@ character-set=latin2 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 6bacfe53b2c..7c1bc76f775 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -291,6 +291,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index f45fc31b293..e609b508536 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -299,6 +299,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index f68d65467bb..81ca7ca2d00 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -288,6 +288,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 12e33f48b31..668ce70b91e 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -293,6 +293,7 @@ character-set=latin7 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 92c831604d3..bb74283fc4c 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -288,6 +288,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index fcd8028863a..66a22c8bb05 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -300,6 +300,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index e5ac5e872ce..33261a4f66a 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -288,6 +288,7 @@ character-set=greek "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index ace96dd1420..94c23710864 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -290,6 +290,7 @@ character-set=latin2 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 9b4b6f8c601..51bd722596a 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -288,6 +288,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 53d39211378..c05c36bdb84 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -290,6 +290,7 @@ character-set=ujis "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 1abf59b2456..4f179320716 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -288,6 +288,7 @@ character-set=euckr "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 2f14cdcc042..fb549a87518 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -290,6 +290,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index d086345f97b..495f8e73125 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -290,6 +290,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index c0333f2b643..00eb13e32b8 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -292,6 +292,7 @@ character-set=latin2 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 1c307d60b25..bdc5c2b33ae 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -289,6 +289,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 4bb0dd981ae..faf63682d3d 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -292,6 +292,7 @@ character-set=latin2 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 7aab4d23f44..dabcfc61bed 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -290,6 +290,7 @@ character-set=koi8r "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index f32593c6441..c52d2d3293b 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -283,6 +283,7 @@ character-set=cp1250 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 6dccde95e25..6678877afa6 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -296,6 +296,7 @@ character-set=latin2 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index dcadd07e73e..6a9b55267eb 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -290,6 +290,7 @@ character-set=latin1 "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 8189d43fdbb..f5ae3eda372 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -288,6 +288,7 @@ character-set=latin1 "Kolumn '%-.64s' kan inte vara del av ett FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index c95fd62e104..6ad25f24611 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -293,6 +293,7 @@ character-set=koi8u "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/sql_class.h b/sql/sql_class.h index 019216e0c15..8263789a2a2 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -375,7 +375,6 @@ struct system_variables ulong max_error_count; ulong max_heap_table_size; ulong max_length_for_sort_data; - ulong max_prep_stmt_count; ulong max_sort_length; ulong max_tmp_tables; ulong myisam_repair_threads; @@ -621,6 +620,11 @@ public: // TODO: document the variables below MYSQL_LOCK *lock; /* Current locks */ MYSQL_LOCK *locked_tables; /* Tables locked with LOCK */ + /* + One thread can hold up to one named user-level lock. This variable + points to a lock object if the lock is present. See item_func.cc and + chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK. + */ ULL *ull; PREP_STMT *last_prepared_stmt; #ifndef DBUG_OFF diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c176be53c21..a2636fa38e7 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -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++) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 100f8775445..25b5392f88d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -400,7 +400,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; @@ -2007,7 +2007,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) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index bf346bc24d9..5796105200a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2089,7 +2089,7 @@ table_types: { $$ = ha_resolve_by_name($1.str,$1.length); if ($$ == DB_TYPE_UNKNOWN) { - net_printf(YYTHD, ER_UNKNOWN_TABLE, $1.str); + net_printf(YYTHD, ER_UNKNOWN_TABLE_ENGINE, $1.str); YYABORT; } }; diff --git a/sql/unireg.h b/sql/unireg.h index 2da25edd72a..442809a9e08 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -84,7 +84,6 @@ #define TRANS_MEM_ROOT_PREALLOC 4096 #define DEFAULT_ERROR_COUNT 64 -#define DEFAULT_PREP_STMT_COUNT 64 #define EXTRA_RECORDS 10 /* Extra records in sort */ #define SCROLL_EXTRA 5 /* Extra scroll-rows. */ #define FIELD_NAME_USED ((uint) 32768) /* Bit set if fieldname used */ |