mirror of
https://github.com/MariaDB/server.git
synced 2025-08-23 03:54:27 +03:00
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-prepared-4.1
This commit is contained in:
@@ -779,7 +779,8 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
|
||||
|
||||
extern time_t start_time;
|
||||
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
|
||||
mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[];
|
||||
mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
|
||||
opt_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
|
||||
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
|
||||
extern MY_TMPDIR mysql_tmpdir_list;
|
||||
extern const char *command_name[];
|
||||
|
@@ -318,7 +318,8 @@ char* log_error_file_ptr= log_error_file;
|
||||
char mysql_real_data_home[FN_REFLEN],
|
||||
language[LIBLEN],reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN],
|
||||
max_sort_char,*mysqld_user,*mysqld_chroot, *opt_init_file,
|
||||
*opt_init_connect, *opt_init_slave;
|
||||
*opt_init_connect, *opt_init_slave,
|
||||
opt_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
|
||||
|
||||
const char *opt_date_time_formats[3];
|
||||
|
||||
@@ -3603,7 +3604,7 @@ enum options_mysqld
|
||||
OPT_BACK_LOG, OPT_BINLOG_CACHE_SIZE,
|
||||
OPT_CONNECT_TIMEOUT, OPT_DELAYED_INSERT_TIMEOUT,
|
||||
OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE,
|
||||
OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN,
|
||||
OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN, OPT_FT_BOOLEAN_SYNTAX,
|
||||
OPT_FT_MAX_WORD_LEN, OPT_FT_QUERY_EXPANSION_LIMIT, OPT_FT_STOPWORD_FILE,
|
||||
OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE,
|
||||
OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE,
|
||||
@@ -3926,7 +3927,8 @@ Disable with --skip-bdb (will save memory).",
|
||||
0, 0, 0, 0},
|
||||
{"master-password", OPT_MASTER_PASSWORD,
|
||||
"The password the slave thread will authenticate with when connecting to the master. If not set, an empty password is assumed.The value in master.info will take precedence if it can be read.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
(gptr*)&master_password, (gptr*)&master_password, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"master-port", OPT_MASTER_PORT,
|
||||
"The port the master is listening on. If not set, the compiled setting of MYSQL_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read.",
|
||||
(gptr*) &master_port, (gptr*) &master_port, 0, GET_UINT, REQUIRED_ARG,
|
||||
@@ -4257,6 +4259,10 @@ replicating a LOAD DATA INFILE command.",
|
||||
"A dedicated thread is created to flush all tables at the given interval.",
|
||||
(gptr*) &flush_time, (gptr*) &flush_time, 0, GET_ULONG, REQUIRED_ARG,
|
||||
FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0},
|
||||
{ "ft_boolean_syntax", OPT_FT_BOOLEAN_SYNTAX,
|
||||
"List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE)",
|
||||
0, 0, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ "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,
|
||||
@@ -5435,8 +5441,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
break;
|
||||
case OPT_STORAGE_ENGINE:
|
||||
{
|
||||
if ((enum db_type)((global_system_variables.table_type=
|
||||
ha_resolve_by_name(argument, strlen(argument)))) == DB_TYPE_UNKNOWN)
|
||||
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);
|
||||
@@ -5608,8 +5614,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
global_system_variables.sql_mode= fix_sql_mode(global_system_variables.
|
||||
sql_mode);
|
||||
}
|
||||
case OPT_MASTER_PASSWORD:
|
||||
master_password=argument;
|
||||
case OPT_FT_BOOLEAN_SYNTAX:
|
||||
if (ft_boolean_check_syntax_string(argument))
|
||||
{
|
||||
fprintf(stderr, "Invalid ft-boolean-syntax string: %s\n", argument);
|
||||
exit(1);
|
||||
}
|
||||
strnmov(opt_ft_boolean_syntax, argument, sizeof(ft_boolean_syntax));
|
||||
break;
|
||||
case OPT_SKIP_SAFEMALLOC:
|
||||
#ifdef SAFEMALLOC
|
||||
@@ -5658,6 +5669,7 @@ static void get_options(int argc,char **argv)
|
||||
int ho_error;
|
||||
|
||||
my_getopt_register_get_addr(mysql_getopt_value);
|
||||
strnmov(opt_ft_boolean_syntax, ft_boolean_syntax, sizeof(ft_boolean_syntax));
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
if (argc > 0)
|
||||
@@ -5713,6 +5725,8 @@ static void get_options(int argc,char **argv)
|
||||
table_alias_charset= (lower_case_table_names ?
|
||||
files_charset_info :
|
||||
&my_charset_bin);
|
||||
strnmov(ft_boolean_syntax, opt_ft_boolean_syntax, sizeof(ft_boolean_syntax));
|
||||
|
||||
if (opt_short_log_format)
|
||||
opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT;
|
||||
if (opt_log_queries_not_using_indexes)
|
||||
|
@@ -19,18 +19,18 @@
|
||||
|
||||
To add a new variable, one has to do the following:
|
||||
|
||||
- If the variable is thread specific, add it to 'system_variables' struct.
|
||||
If not, add it to mysqld.cc and an declaration in 'mysql_priv.h'
|
||||
- Don't forget to initialize new fields in global_system_variables and
|
||||
max_system_variables!
|
||||
- Use one of the 'sys_var... classes from set_var.h or write a specific
|
||||
one for the variable type.
|
||||
- Define it in the 'variable definition list' in this file.
|
||||
- If the variable should be changeable or one should be able to access it
|
||||
with @@variable_name, it should be added to the 'list of all variables'
|
||||
list in this file.
|
||||
list (sys_variables) in this file.
|
||||
- If the variable is thread specific, add it to 'system_variables' struct.
|
||||
If not, add it to mysqld.cc and an declaration in 'mysql_priv.h'
|
||||
- If the variable should be changed from the command line, add a definition
|
||||
of it in the my_option structure list in mysqld.dcc
|
||||
- Don't forget to initialize new fields in global_system_variables and
|
||||
max_system_variables!
|
||||
- If the variable should show up in 'show variables' add it to the
|
||||
init_vars[] struct in this file
|
||||
|
||||
@@ -73,9 +73,12 @@ TYPELIB delay_key_write_typelib=
|
||||
array_elements(delay_key_write_type_names)-1, "", delay_key_write_type_names
|
||||
};
|
||||
|
||||
static bool sys_check_charset(THD *thd, set_var *var);
|
||||
static int sys_check_charset(THD *thd, set_var *var);
|
||||
static bool sys_update_charset(THD *thd, set_var *var);
|
||||
static void sys_set_default_charset(THD *thd, enum_var_type type);
|
||||
static int sys_check_ftb_syntax(THD *thd, set_var *var);
|
||||
static bool sys_update_ftb_syntax(THD *thd, set_var * var);
|
||||
static void sys_default_ftb_syntax(THD *thd, enum_var_type type);
|
||||
static bool sys_update_init_connect(THD*, set_var*);
|
||||
static void sys_default_init_connect(THD*, enum_var_type type);
|
||||
static bool sys_update_init_slave(THD*, set_var*);
|
||||
@@ -119,12 +122,6 @@ sys_var_str sys_charset_system("character_set_system",
|
||||
sys_check_charset,
|
||||
sys_update_charset,
|
||||
sys_set_default_charset);
|
||||
sys_var_str sys_init_connect("init_connect", 0,
|
||||
sys_update_init_connect,
|
||||
sys_default_init_connect);
|
||||
sys_var_str sys_init_slave("init_slave", 0,
|
||||
sys_update_init_slave,
|
||||
sys_default_init_slave);
|
||||
sys_var_character_set_database sys_character_set_database("character_set_database");
|
||||
sys_var_character_set_client sys_character_set_client("character_set_client");
|
||||
sys_var_character_set_connection sys_character_set_connection("character_set_connection");
|
||||
@@ -150,6 +147,16 @@ sys_var_long_ptr sys_expire_logs_days("expire_logs_days",
|
||||
&expire_logs_days);
|
||||
sys_var_bool_ptr sys_flush("flush", &myisam_flush);
|
||||
sys_var_long_ptr sys_flush_time("flush_time", &flush_time);
|
||||
sys_var_str sys_ft_boolean_syntax("ft_boolean_syntax",
|
||||
sys_check_ftb_syntax,
|
||||
sys_update_ftb_syntax,
|
||||
sys_default_ftb_syntax);
|
||||
sys_var_str sys_init_connect("init_connect", 0,
|
||||
sys_update_init_connect,
|
||||
sys_default_init_connect);
|
||||
sys_var_str sys_init_slave("init_slave", 0,
|
||||
sys_update_init_slave,
|
||||
sys_default_init_slave);
|
||||
sys_var_thd_ulong sys_interactive_timeout("interactive_timeout",
|
||||
&SV::net_interactive_timeout);
|
||||
sys_var_thd_ulong sys_join_buffer_size("join_buffer_size",
|
||||
@@ -318,7 +325,7 @@ sys_var_thd_ulong sys_net_wait_timeout("wait_timeout",
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct",
|
||||
&srv_max_buf_pool_modified_pct);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Time/date/datetime formats */
|
||||
|
||||
@@ -450,6 +457,7 @@ sys_var *sys_variables[]=
|
||||
&sys_expire_logs_days,
|
||||
&sys_flush,
|
||||
&sys_flush_time,
|
||||
&sys_ft_boolean_syntax,
|
||||
&sys_foreign_key_checks,
|
||||
&sys_group_concat_max_len,
|
||||
&sys_identity,
|
||||
@@ -593,7 +601,7 @@ struct show_var_st init_vars[]= {
|
||||
{sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS},
|
||||
{sys_flush.name, (char*) &sys_flush, SHOW_SYS},
|
||||
{sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS},
|
||||
{"ft_boolean_syntax", (char*) ft_boolean_syntax, SHOW_CHAR},
|
||||
{sys_ft_boolean_syntax.name,(char*) &ft_boolean_syntax, SHOW_CHAR},
|
||||
{"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG},
|
||||
{"ft_max_word_len", (char*) &ft_max_word_len, SHOW_LONG},
|
||||
{"ft_query_expansion_limit",(char*) &ft_query_expansion_limit, SHOW_LONG},
|
||||
@@ -775,6 +783,18 @@ bool sys_var::check(THD *thd, set_var *var)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool sys_var_str::check(THD *thd, set_var *var)
|
||||
{
|
||||
int res;
|
||||
if (!check_func)
|
||||
return 0;
|
||||
|
||||
if ((res=(*check_func)(thd, var)) < 0)
|
||||
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name,
|
||||
var->value->str_value.ptr());
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
Functions to check and update variables
|
||||
*/
|
||||
@@ -837,13 +857,35 @@ static void sys_default_init_slave(THD* thd, enum_var_type type)
|
||||
update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0);
|
||||
}
|
||||
|
||||
static int sys_check_ftb_syntax(THD *thd, set_var *var)
|
||||
{
|
||||
if (thd->master_access & SUPER_ACL)
|
||||
return ft_boolean_check_syntax_string(var->value->str_value.ptr()) ?
|
||||
-1 : 0;
|
||||
else
|
||||
{
|
||||
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static bool sys_update_ftb_syntax(THD *thd, set_var * var)
|
||||
{
|
||||
strnmov(ft_boolean_syntax, var->value->str_value.ptr(), sizeof(ft_boolean_syntax));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sys_default_ftb_syntax(THD *thd, enum_var_type type)
|
||||
{
|
||||
strnmov(ft_boolean_syntax, opt_ft_boolean_syntax, sizeof(ft_boolean_syntax));
|
||||
}
|
||||
|
||||
/*
|
||||
The following 3 functions need to be changed in 4.1 when we allow
|
||||
one to change character sets
|
||||
*/
|
||||
|
||||
static bool sys_check_charset(THD *thd, set_var *var)
|
||||
static int sys_check_charset(THD *thd, set_var *var)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1898,7 +1940,7 @@ byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
|
||||
key_cache= &zero_key_cache;
|
||||
return (byte*) key_cache + offset ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
|
||||
{
|
||||
@@ -1993,14 +2035,14 @@ bool sys_var_key_cache_long::update(THD *thd, set_var *var)
|
||||
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
KEY_CACHE *key_cache= get_key_cache(base_name);
|
||||
|
||||
|
||||
if (!key_cache && !(key_cache= create_key_cache(base_name->str,
|
||||
base_name->length)))
|
||||
{
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Abort if some other thread is changing the key cache
|
||||
TODO: This should be changed so that we wait until the previous
|
||||
|
@@ -35,7 +35,7 @@ enum enum_var_type
|
||||
OPT_DEFAULT, OPT_SESSION, OPT_GLOBAL
|
||||
};
|
||||
|
||||
typedef bool (*sys_check_func)(THD *, set_var *);
|
||||
typedef int (*sys_check_func)(THD *, set_var *);
|
||||
typedef bool (*sys_update_func)(THD *, set_var *);
|
||||
typedef void (*sys_after_update_func)(THD *,enum_var_type);
|
||||
typedef void (*sys_set_default_func)(THD *, enum_var_type);
|
||||
@@ -143,10 +143,7 @@ public:
|
||||
:sys_var(name_arg), check_func(check_func_arg),
|
||||
update_func(update_func_arg),set_default_func(set_default_func_arg)
|
||||
{}
|
||||
bool check(THD *thd, set_var *var)
|
||||
{
|
||||
return check_func ? (*check_func)(thd, var) : 0;
|
||||
}
|
||||
bool check(THD *thd, set_var *var);
|
||||
bool update(THD *thd, set_var *var)
|
||||
{
|
||||
return (*update_func)(thd, var);
|
||||
|
@@ -72,9 +72,9 @@ character-set=latin1
|
||||
"Not unique table/alias: '%-.64s'",
|
||||
"Invalid default value for '%-.64s'",
|
||||
"Multiple primary key defined",
|
||||
"Too many keys specified. Max %d keys allowed",
|
||||
"Too many keys specified; max %d keys allowed",
|
||||
"Too many key parts specified. Max %d parts allowed",
|
||||
"Specified key was too long. Max key length is %d",
|
||||
"Specified key was too long; max key length is %d bytes",
|
||||
"Key column '%-.64s' doesn't exist in table",
|
||||
"BLOB column '%-.64s' can't be used in key specification with the used table type",
|
||||
"Too big column length for column '%-.64s' (max = %d). Use BLOB instead",
|
||||
|
@@ -76,7 +76,7 @@ character-set=koi8r
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> %d <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> %d <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '%-.64s' <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> BLOB '%-.64s' <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '%-.64s' (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = %d). <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> BLOB <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
|
@@ -79,7 +79,7 @@ character-set=koi8u
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ަ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ¦<><C2A6><EFBFBD><EFBFBD> %d <20><><EFBFBD>ަ<EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ¦<><C2A6><EFBFBD><EFBFBD> %d <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD>¦<EFBFBD><C2A6><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> %d",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD>¦<EFBFBD><C2A6><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> %d <20><><EFBFBD>Ԧ<EFBFBD>",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '%-.64s' <20><> <20><><EFBFBD>դ <20> <20><><EFBFBD><EFBFBD><EFBFBD>æ",
|
||||
"BLOB <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '%-.64s' <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Φ <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>Ц <20><><EFBFBD><EFBFBD><EFBFBD>æ",
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '%-.64s' (max = %d). <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> BLOB",
|
||||
|
@@ -853,26 +853,35 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
{
|
||||
if ((length=column->length) > file->max_key_length() ||
|
||||
length > file->max_key_part_length())
|
||||
{
|
||||
my_error(ER_WRONG_SUB_KEY,MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
{
|
||||
length=min(file->max_key_length(), file->max_key_part_length());
|
||||
if (key->type == Key::MULTIPLE)
|
||||
{
|
||||
/* not a critical problem */
|
||||
char warn_buff[MYSQL_ERRMSG_SIZE];
|
||||
sprintf(warn_buff,ER(ER_TOO_LONG_KEY),length);
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_TOO_LONG_KEY, warn_buff);
|
||||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_TOO_LONG_KEY,MYF(0),length);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* TODO HF What's this for??? */
|
||||
else if (f_is_geom(sql_field->pack_flag))
|
||||
{
|
||||
}
|
||||
else if (column->length > length ||
|
||||
((f_is_packed(sql_field->pack_flag) ||
|
||||
((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
|
||||
(key_info->flags & HA_NOSAME))) &&
|
||||
column->length != length))
|
||||
{
|
||||
my_error(ER_WRONG_SUB_KEY,MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (!(file->table_flags() & HA_NO_PREFIX_CHAR_KEYS))
|
||||
length=column->length;
|
||||
else if (!f_is_geom(sql_field->pack_flag) &&
|
||||
(column->length > length ||
|
||||
((f_is_packed(sql_field->pack_flag) ||
|
||||
((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
|
||||
(key_info->flags & HA_NOSAME))) &&
|
||||
column->length != length)))
|
||||
{
|
||||
my_error(ER_WRONG_SUB_KEY,MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
else if (!(file->table_flags() & HA_NO_PREFIX_CHAR_KEYS))
|
||||
length=column->length;
|
||||
}
|
||||
else if (length == 0)
|
||||
{
|
||||
@@ -882,8 +891,20 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
}
|
||||
if (length > file->max_key_part_length())
|
||||
{
|
||||
my_error(ER_WRONG_SUB_KEY,MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
length=file->max_key_part_length();
|
||||
if (key->type == Key::MULTIPLE)
|
||||
{
|
||||
/* not a critical problem */
|
||||
char warn_buff[MYSQL_ERRMSG_SIZE];
|
||||
sprintf(warn_buff,ER(ER_TOO_LONG_KEY),length);
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_TOO_LONG_KEY, warn_buff);
|
||||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_TOO_LONG_KEY,MYF(0),length);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
key_part_info->length=(uint16) length;
|
||||
/* Use packed keys for long strings on the first column */
|
||||
|
Reference in New Issue
Block a user