Merge with 5.1
This commit is contained in:
commit
d2f7348fdc
@ -1924,3 +1924,7 @@ libmysqld/opt_table_elimination.cc
|
|||||||
libmysqld/ha_federatedx.cc
|
libmysqld/ha_federatedx.cc
|
||||||
tmp
|
tmp
|
||||||
libmysqld/debug_sync.cc
|
libmysqld/debug_sync.cc
|
||||||
|
client/rpl_filter.cc
|
||||||
|
client/rpl_filter.h
|
||||||
|
client/sql_list.cc
|
||||||
|
client/sql_list.h
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
cflags="$c_warnings $extra_flags"
|
cflags="$c_warnings $extra_flags $EXTRA_FLAGS $EXTRA_CFLAGS"
|
||||||
cxxflags="$cxx_warnings $base_cxxflags $extra_flags"
|
cxxflags="$cxx_warnings $base_cxxflags $extra_flags $EXTRA_FLAGS $EXTRA_CXXFLAGS"
|
||||||
extra_configs="$extra_configs $local_infile_configs"
|
extra_configs="$extra_configs $local_infile_configs $EXTRA_CONFIGS"
|
||||||
configure="./configure $base_configs $extra_configs"
|
configure="./configure $base_configs $extra_configs"
|
||||||
|
|
||||||
commands="\
|
commands="\
|
||||||
|
@ -34,6 +34,14 @@ parse_options()
|
|||||||
full_debug="=full";;
|
full_debug="=full";;
|
||||||
--warning-mode=*)
|
--warning-mode=*)
|
||||||
warning_mode=`get_key_value "$1"`;;
|
warning_mode=`get_key_value "$1"`;;
|
||||||
|
--extra-flags=*)
|
||||||
|
EXTRA_FLAGS=`get_key_value "$1"`;;
|
||||||
|
--extra-cflags=*)
|
||||||
|
EXTRA_CFLAGS=`get_key_value "$1"`;;
|
||||||
|
--extra-cxxflags=*)
|
||||||
|
EXTRA_CXXFLAGS=`get_key_value "$1"`;;
|
||||||
|
--extra-configs=*)
|
||||||
|
EXTRA_CONFIGS=`get_key_value "$1"`;;
|
||||||
-c | --just-configure)
|
-c | --just-configure)
|
||||||
just_configure=1;;
|
just_configure=1;;
|
||||||
-n | --just-print | --print)
|
-n | --just-print | --print)
|
||||||
|
@ -1279,7 +1279,6 @@ sig_handler handle_sigint(int sig)
|
|||||||
char kill_buffer[40];
|
char kill_buffer[40];
|
||||||
MYSQL *kill_mysql= NULL;
|
MYSQL *kill_mysql= NULL;
|
||||||
|
|
||||||
/* terminate if no query being executed, or we already tried interrupting */
|
|
||||||
/* terminate if no query being executed, or we already tried interrupting */
|
/* terminate if no query being executed, or we already tried interrupting */
|
||||||
if (!executing_query || (interrupted_query == 2))
|
if (!executing_query || (interrupted_query == 2))
|
||||||
{
|
{
|
||||||
@ -1295,6 +1294,7 @@ sig_handler handle_sigint(int sig)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* First time try to kill the query, second time the connection */
|
||||||
interrupted_query++;
|
interrupted_query++;
|
||||||
|
|
||||||
/* mysqld < 5 does not understand KILL QUERY, skip to KILL CONNECTION */
|
/* mysqld < 5 does not understand KILL QUERY, skip to KILL CONNECTION */
|
||||||
@ -1305,10 +1305,13 @@ sig_handler handle_sigint(int sig)
|
|||||||
sprintf(kill_buffer, "KILL %s%lu",
|
sprintf(kill_buffer, "KILL %s%lu",
|
||||||
(interrupted_query == 1) ? "QUERY " : "",
|
(interrupted_query == 1) ? "QUERY " : "",
|
||||||
mysql_thread_id(&mysql));
|
mysql_thread_id(&mysql));
|
||||||
tee_fprintf(stdout, "Ctrl-C -- sending \"%s\" to server ...\n", kill_buffer);
|
if (verbose)
|
||||||
|
tee_fprintf(stdout, "Ctrl-C -- sending \"%s\" to server ...\n",
|
||||||
|
kill_buffer);
|
||||||
mysql_real_query(kill_mysql, kill_buffer, (uint) strlen(kill_buffer));
|
mysql_real_query(kill_mysql, kill_buffer, (uint) strlen(kill_buffer));
|
||||||
mysql_close(kill_mysql);
|
mysql_close(kill_mysql);
|
||||||
tee_fprintf(stdout, "Ctrl-C -- query aborted.\n");
|
tee_fprintf(stdout, "Ctrl-C -- query killed. Continuing normally.\n");
|
||||||
|
interrupted_query= 0;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1321,7 +1324,6 @@ err:
|
|||||||
handler called mysql_end().
|
handler called mysql_end().
|
||||||
*/
|
*/
|
||||||
mysql_thread_end();
|
mysql_thread_end();
|
||||||
return;
|
|
||||||
#else
|
#else
|
||||||
mysql_end(sig);
|
mysql_end(sig);
|
||||||
#endif
|
#endif
|
||||||
@ -2881,13 +2883,8 @@ com_help(String *buffer __attribute__((unused)),
|
|||||||
return com_server_help(buffer,line,help_arg);
|
return com_server_help(buffer,line,help_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
put_info("\nFor information about MySQL products and services, visit:\n"
|
put_info("\nGeneral information about MariaDB can be found at\n"
|
||||||
" http://www.mysql.com/\n"
|
"http://askmonty.org/wiki/index.php/Manual:Contents\n", INFO_INFO);
|
||||||
"For developer information, including the MySQL Reference Manual, "
|
|
||||||
"visit:\n"
|
|
||||||
" http://dev.mysql.com/\n"
|
|
||||||
"To buy MySQL Enterprise support, training, or other products, visit:\n"
|
|
||||||
" https://shop.mysql.com/\n", INFO_INFO);
|
|
||||||
put_info("List of all MySQL commands:", INFO_INFO);
|
put_info("List of all MySQL commands:", INFO_INFO);
|
||||||
if (!named_cmds)
|
if (!named_cmds)
|
||||||
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
|
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
|
||||||
|
@ -857,7 +857,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (!opt_write_binlog)
|
if (!opt_write_binlog)
|
||||||
{
|
{
|
||||||
if (disable_binlog()) {
|
if (disable_binlog())
|
||||||
|
{
|
||||||
first_error= 1;
|
first_error= 1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -472,8 +472,7 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
|
|||||||
if (commit_rate)
|
if (commit_rate)
|
||||||
run_query(mysql, "SET AUTOCOMMIT=0", strlen("SET AUTOCOMMIT=0"));
|
run_query(mysql, "SET AUTOCOMMIT=0", strlen("SET AUTOCOMMIT=0"));
|
||||||
|
|
||||||
if (pre_system)
|
if (pre_system && (sysret= system(pre_system)) != 0)
|
||||||
if ((sysret= system(pre_system)) != 0)
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Warning: Execution of pre_system option returned %d.\n",
|
"Warning: Execution of pre_system option returned %d.\n",
|
||||||
sysret);
|
sysret);
|
||||||
@ -490,8 +489,7 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
|
|||||||
if (post_statements)
|
if (post_statements)
|
||||||
run_statements(mysql, post_statements);
|
run_statements(mysql, post_statements);
|
||||||
|
|
||||||
if (post_system)
|
if (post_system && (sysret= system(post_system)) != 0)
|
||||||
if ((sysret= system(post_system)) != 0)
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Warning: Execution of post_system option returned %d.\n",
|
"Warning: Execution of post_system option returned %d.\n",
|
||||||
sysret);
|
sysret);
|
||||||
|
@ -1267,6 +1267,7 @@ void abort_not_supported_test(const char *fmt, ...)
|
|||||||
DBUG_ENTER("abort_not_supported_test");
|
DBUG_ENTER("abort_not_supported_test");
|
||||||
|
|
||||||
/* Print include filestack */
|
/* Print include filestack */
|
||||||
|
fflush(stdout);
|
||||||
fprintf(stderr, "The test '%s' is not supported by this installation\n",
|
fprintf(stderr, "The test '%s' is not supported by this installation\n",
|
||||||
file_stack->file_name);
|
file_stack->file_name);
|
||||||
fprintf(stderr, "Detected in file %s at line %d\n",
|
fprintf(stderr, "Detected in file %s at line %d\n",
|
||||||
@ -3497,7 +3498,8 @@ void do_diff_files(struct st_command *command)
|
|||||||
if ((error= compare_files(ds_filename.str, ds_filename2.str)) &&
|
if ((error= compare_files(ds_filename.str, ds_filename2.str)) &&
|
||||||
match_expected_error(command, error, NULL) < 0)
|
match_expected_error(command, error, NULL) < 0)
|
||||||
{
|
{
|
||||||
/* Compare of the two files failed, append them to output
|
/*
|
||||||
|
Compare of the two files failed, append them to output
|
||||||
so the failure can be analyzed, but only if it was not
|
so the failure can be analyzed, but only if it was not
|
||||||
expected to fail.
|
expected to fail.
|
||||||
*/
|
*/
|
||||||
@ -5013,6 +5015,7 @@ void do_connect(struct st_command *command)
|
|||||||
con_options= ds_options.str;
|
con_options= ds_options.str;
|
||||||
while (*con_options)
|
while (*con_options)
|
||||||
{
|
{
|
||||||
|
size_t length;
|
||||||
char *end;
|
char *end;
|
||||||
/* Step past any spaces in beginning of option*/
|
/* Step past any spaces in beginning of option*/
|
||||||
while (*con_options && my_isspace(charset_info, *con_options))
|
while (*con_options && my_isspace(charset_info, *con_options))
|
||||||
@ -5021,13 +5024,14 @@ void do_connect(struct st_command *command)
|
|||||||
end= con_options;
|
end= con_options;
|
||||||
while (*end && !my_isspace(charset_info, *end))
|
while (*end && !my_isspace(charset_info, *end))
|
||||||
end++;
|
end++;
|
||||||
if (!strncmp(con_options, "SSL", 3))
|
length= (size_t) (end - con_options);
|
||||||
|
if (length == 3 && !strncmp(con_options, "SSL", 3))
|
||||||
con_ssl= 1;
|
con_ssl= 1;
|
||||||
else if (!strncmp(con_options, "COMPRESS", 8))
|
else if (length == 8 && !strncmp(con_options, "COMPRESS", 8))
|
||||||
con_compress= 1;
|
con_compress= 1;
|
||||||
else if (!strncmp(con_options, "PIPE", 4))
|
else if (length == 4 && !strncmp(con_options, "PIPE", 4))
|
||||||
con_pipe= 1;
|
con_pipe= 1;
|
||||||
else if (!strncmp(con_options, "SHM", 3))
|
else if (length == 3 && !strncmp(con_options, "SHM", 3))
|
||||||
con_shm= 1;
|
con_shm= 1;
|
||||||
else
|
else
|
||||||
die("Illegal option to connect: %.*s",
|
die("Illegal option to connect: %.*s",
|
||||||
@ -5103,7 +5107,6 @@ void do_connect(struct st_command *command)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Use default db name */
|
/* Use default db name */
|
||||||
if (ds_database.length == 0)
|
if (ds_database.length == 0)
|
||||||
dynstr_set(&ds_database, opt_db);
|
dynstr_set(&ds_database, opt_db);
|
||||||
@ -6879,10 +6882,8 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
|||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
DYNAMIC_STRING ds_prepare_warnings;
|
DYNAMIC_STRING ds_prepare_warnings;
|
||||||
DYNAMIC_STRING ds_execute_warnings;
|
DYNAMIC_STRING ds_execute_warnings;
|
||||||
ulonglong affected_rows;
|
|
||||||
DBUG_ENTER("run_query_stmt");
|
DBUG_ENTER("run_query_stmt");
|
||||||
DBUG_PRINT("query", ("'%-.60s'", query));
|
DBUG_PRINT("query", ("'%-.60s'", query));
|
||||||
LINT_INIT(affected_rows);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Init a new stmt if it's not already one created for this connection
|
Init a new stmt if it's not already one created for this connection
|
||||||
@ -6981,6 +6982,9 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
|||||||
handle_no_error(command);
|
handle_no_error(command);
|
||||||
if (!disable_result_log)
|
if (!disable_result_log)
|
||||||
{
|
{
|
||||||
|
ulonglong affected_rows;
|
||||||
|
LINT_INIT(affected_rows);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Not all statements creates a result set. If there is one we can
|
Not all statements creates a result set. If there is one we can
|
||||||
now create another normal result set that contains the meta
|
now create another normal result set that contains the meta
|
||||||
@ -7026,10 +7030,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
|||||||
Need to grab affected rows information before getting
|
Need to grab affected rows information before getting
|
||||||
warnings here
|
warnings here
|
||||||
*/
|
*/
|
||||||
{
|
|
||||||
ulonglong affected_rows;
|
|
||||||
LINT_INIT(affected_rows);
|
|
||||||
|
|
||||||
if (!disable_info)
|
if (!disable_info)
|
||||||
affected_rows= mysql_affected_rows(mysql);
|
affected_rows= mysql_affected_rows(mysql);
|
||||||
|
|
||||||
@ -7055,11 +7055,9 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
|||||||
ds_execute_warnings.length);
|
ds_execute_warnings.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!disable_info)
|
if (!disable_info)
|
||||||
append_info(ds, affected_rows, mysql_info(mysql));
|
append_info(ds, affected_rows, mysql_info(mysql));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (!disable_warnings)
|
if (!disable_warnings)
|
||||||
@ -7235,7 +7233,6 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dynstr_free(&query_str);
|
dynstr_free(&query_str);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp_protocol_enabled &&
|
if (sp_protocol_enabled &&
|
||||||
@ -7662,6 +7659,7 @@ int main(int argc, char **argv)
|
|||||||
my_bool q_send_flag= 0, abort_flag= 0;
|
my_bool q_send_flag= 0, abort_flag= 0;
|
||||||
uint command_executed= 0, last_command_executed= 0;
|
uint command_executed= 0, last_command_executed= 0;
|
||||||
char save_file[FN_REFLEN];
|
char save_file[FN_REFLEN];
|
||||||
|
bool empty_result= FALSE;
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
|
|
||||||
save_file[0]= 0;
|
save_file[0]= 0;
|
||||||
@ -7819,6 +7817,7 @@ int main(int argc, char **argv)
|
|||||||
verbose_msg("Start processing test commands from '%s' ...", cur_file->file_name);
|
verbose_msg("Start processing test commands from '%s' ...", cur_file->file_name);
|
||||||
while (!read_command(&command) && !abort_flag)
|
while (!read_command(&command) && !abort_flag)
|
||||||
{
|
{
|
||||||
|
my_bool ok_to_do;
|
||||||
int current_line_inc = 1, processed = 0;
|
int current_line_inc = 1, processed = 0;
|
||||||
if (command->type == Q_UNKNOWN || command->type == Q_COMMENT_WITH_COMMAND)
|
if (command->type == Q_UNKNOWN || command->type == Q_COMMENT_WITH_COMMAND)
|
||||||
get_command_type(command);
|
get_command_type(command);
|
||||||
@ -7831,7 +7830,7 @@ int main(int argc, char **argv)
|
|||||||
command->type= Q_COMMENT;
|
command->type= Q_COMMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
my_bool ok_to_do= cur_block->ok;
|
ok_to_do= cur_block->ok;
|
||||||
/*
|
/*
|
||||||
Some commands need to be "done" the first time if they may get
|
Some commands need to be "done" the first time if they may get
|
||||||
re-iterated over in a true context. This can only happen if there's
|
re-iterated over in a true context. This can only happen if there's
|
||||||
@ -8100,7 +8099,10 @@ int main(int argc, char **argv)
|
|||||||
abort_flag= 1;
|
abort_flag= 1;
|
||||||
break;
|
break;
|
||||||
case Q_SKIP:
|
case Q_SKIP:
|
||||||
abort_not_supported_test("%s", command->first_argument);
|
/* Eval the query, thus replacing all environment variables */
|
||||||
|
dynstr_set(&ds_res, 0);
|
||||||
|
do_eval(&ds_res, command->first_argument, command->end, FALSE);
|
||||||
|
abort_not_supported_test("%s",ds_res.str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Q_RESULT:
|
case Q_RESULT:
|
||||||
@ -8167,8 +8169,6 @@ int main(int argc, char **argv)
|
|||||||
if (parsing_disabled)
|
if (parsing_disabled)
|
||||||
die("Test ended with parsing disabled");
|
die("Test ended with parsing disabled");
|
||||||
|
|
||||||
my_bool empty_result= FALSE;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The whole test has been executed _sucessfully_.
|
The whole test has been executed _sucessfully_.
|
||||||
Time to compare result or save it to record file.
|
Time to compare result or save it to record file.
|
||||||
|
35
dbug/dbug.c
35
dbug/dbug.c
@ -497,12 +497,18 @@ int DbugParse(CODE_STATE *cs, const char *control)
|
|||||||
const char *end;
|
const char *end;
|
||||||
int rel, f_used=0;
|
int rel, f_used=0;
|
||||||
struct settings *stack;
|
struct settings *stack;
|
||||||
|
int org_cs_locked;
|
||||||
|
|
||||||
stack= cs->stack;
|
stack= cs->stack;
|
||||||
|
|
||||||
|
if (!(org_cs_locked= cs->locked))
|
||||||
|
{
|
||||||
|
cs->locked= 1;
|
||||||
|
pthread_mutex_lock(&THR_LOCK_dbug);
|
||||||
|
}
|
||||||
|
|
||||||
if (control[0] == '-' && control[1] == '#')
|
if (control[0] == '-' && control[1] == '#')
|
||||||
control+=2;
|
control+=2;
|
||||||
|
|
||||||
rel= control[0] == '+' || control[0] == '-';
|
rel= control[0] == '+' || control[0] == '-';
|
||||||
if ((!rel || (!stack->out_file && !stack->next)))
|
if ((!rel || (!stack->out_file && !stack->next)))
|
||||||
{
|
{
|
||||||
@ -550,9 +556,11 @@ int DbugParse(CODE_STATE *cs, const char *control)
|
|||||||
while (control < end)
|
while (control < end)
|
||||||
{
|
{
|
||||||
int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0;
|
int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0;
|
||||||
if (sign) control++;
|
if (sign)
|
||||||
|
control++;
|
||||||
c= *control++;
|
c= *control++;
|
||||||
if (*control == ',') control++;
|
if (*control == ',')
|
||||||
|
control++;
|
||||||
/* XXX when adding new cases here, don't forget _db_explain_ ! */
|
/* XXX when adding new cases here, don't forget _db_explain_ ! */
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'd':
|
case 'd':
|
||||||
@ -718,8 +726,13 @@ int DbugParse(CODE_STATE *cs, const char *control)
|
|||||||
control=end+1;
|
control=end+1;
|
||||||
end= DbugStrTok(control);
|
end= DbugStrTok(control);
|
||||||
}
|
}
|
||||||
return !rel || f_used;
|
if (!org_cs_locked)
|
||||||
|
{
|
||||||
|
pthread_mutex_unlock(&THR_LOCK_dbug);
|
||||||
|
cs->locked= 0;
|
||||||
}
|
}
|
||||||
|
return !rel || f_used;}
|
||||||
|
|
||||||
|
|
||||||
#define framep_trace_flag(cs, frp) (frp ? \
|
#define framep_trace_flag(cs, frp) (frp ? \
|
||||||
frp->level & TRACE_ON : \
|
frp->level & TRACE_ON : \
|
||||||
@ -1340,11 +1353,11 @@ void _db_doprnt_(const char *format,...)
|
|||||||
|
|
||||||
va_start(args,format);
|
va_start(args,format);
|
||||||
|
|
||||||
|
if (!cs->locked)
|
||||||
|
pthread_mutex_lock(&THR_LOCK_dbug);
|
||||||
if (_db_keyword_(cs, cs->u_keyword, 0))
|
if (_db_keyword_(cs, cs->u_keyword, 0))
|
||||||
{
|
{
|
||||||
int save_errno=errno;
|
int save_errno=errno;
|
||||||
if (!cs->locked)
|
|
||||||
pthread_mutex_lock(&THR_LOCK_dbug);
|
|
||||||
DoPrefix(cs, cs->u_line);
|
DoPrefix(cs, cs->u_line);
|
||||||
if (TRACING)
|
if (TRACING)
|
||||||
Indent(cs, cs->level + 1);
|
Indent(cs, cs->level + 1);
|
||||||
@ -1356,6 +1369,9 @@ void _db_doprnt_(const char *format,...)
|
|||||||
DbugFlush(cs);
|
DbugFlush(cs);
|
||||||
errno=save_errno;
|
errno=save_errno;
|
||||||
}
|
}
|
||||||
|
else if (!cs->locked)
|
||||||
|
pthread_mutex_unlock(&THR_LOCK_dbug);
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1386,10 +1402,10 @@ void _db_dump_(uint _line_, const char *keyword,
|
|||||||
CODE_STATE *cs;
|
CODE_STATE *cs;
|
||||||
get_code_state_or_return;
|
get_code_state_or_return;
|
||||||
|
|
||||||
if (_db_keyword_(cs, keyword, 0))
|
|
||||||
{
|
|
||||||
if (!cs->locked)
|
if (!cs->locked)
|
||||||
pthread_mutex_lock(&THR_LOCK_dbug);
|
pthread_mutex_lock(&THR_LOCK_dbug);
|
||||||
|
if (_db_keyword_(cs, keyword, 0))
|
||||||
|
{
|
||||||
DoPrefix(cs, _line_);
|
DoPrefix(cs, _line_);
|
||||||
if (TRACING)
|
if (TRACING)
|
||||||
{
|
{
|
||||||
@ -1420,6 +1436,8 @@ void _db_dump_(uint _line_, const char *keyword,
|
|||||||
(void) fputc('\n',cs->stack->out_file);
|
(void) fputc('\n',cs->stack->out_file);
|
||||||
DbugFlush(cs);
|
DbugFlush(cs);
|
||||||
}
|
}
|
||||||
|
else if (!cs->locked)
|
||||||
|
pthread_mutex_unlock(&THR_LOCK_dbug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2105,6 +2123,7 @@ static void DBUGCloseFile(CODE_STATE *cs, FILE *fp)
|
|||||||
{
|
{
|
||||||
if (fp != stderr && fp != stdout && fclose(fp) == EOF)
|
if (fp != stderr && fp != stdout && fclose(fp) == EOF)
|
||||||
{
|
{
|
||||||
|
if (!cs->locked)
|
||||||
pthread_mutex_lock(&THR_LOCK_dbug);
|
pthread_mutex_lock(&THR_LOCK_dbug);
|
||||||
(void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process);
|
(void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process);
|
||||||
perror("");
|
perror("");
|
||||||
|
@ -167,6 +167,7 @@ public:
|
|||||||
void CleanNew(word32 newSize)
|
void CleanNew(word32 newSize)
|
||||||
{
|
{
|
||||||
New(newSize);
|
New(newSize);
|
||||||
|
if (sz_ > 0)
|
||||||
memset(buffer_, 0, sz_ * sizeof(T));
|
memset(buffer_, 0, sz_ * sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_big5.require
|
let collation=big5_chinese_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'big5_chinese_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
3
mysql-test/include/have_collation.inc
Normal file
3
mysql-test/include/have_collation.inc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
if (!`SELECT count(*) AS 'true' FROM information_schema.collations WHERE collation_name LIKE '$collation'`) {
|
||||||
|
skip Test needs character set '$collation';
|
||||||
|
}
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_cp1250_ch.require
|
let collation=cp1250_czech_cs;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'cp1250_czech_cs';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,7 +1,2 @@
|
|||||||
--require r/have_cp1251.require
|
let collation=cp1251_general_ci;
|
||||||
|
--source include/have_collation.inc
|
||||||
--disable_query_log
|
|
||||||
|
|
||||||
SHOW COLLATION LIKE 'cp1251_general_ci';
|
|
||||||
|
|
||||||
--enable_query_log
|
|
||||||
|
@ -1,7 +1,2 @@
|
|||||||
--require r/have_cp866.require
|
let collation=cp866_general_ci;
|
||||||
|
--source include/have_collation.inc
|
||||||
--disable_query_log
|
|
||||||
|
|
||||||
SHOW COLLATION LIKE 'cp866_general_ci';
|
|
||||||
|
|
||||||
--enable_query_log
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_cp932.require
|
let collation=cp932_japanese_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'cp932_japanese_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_eucjpms.require
|
let collation=eucjpms_japanese_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'eucjpms_japanese_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_euckr.require
|
let collation=euckr_korean_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'euckr_korean_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_gb2312.require
|
let collation=gb2312_chinese_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'gb2312_chinese_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_gbk.require
|
let collation=gbk_chinese_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'gbk_chinese_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,7 +1,2 @@
|
|||||||
--require r/have_koi8r.require
|
let collation=koi8r_general_ci;
|
||||||
|
--source include/have_collation.inc
|
||||||
--disable_query_log
|
|
||||||
|
|
||||||
SHOW COLLATION LIKE 'koi8r_general_ci';
|
|
||||||
|
|
||||||
--enable_query_log
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_latin2_ch.require
|
let collation=latin2_czech_cs;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'latin2_czech_cs';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_sjis.require
|
let collation=sjis_japanese_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'sjis_japanese_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_tis620.require
|
let collation=tis620_thai_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'tis620_thai_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_ucs2.require
|
let collation=ucs2_general_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'ucs2_general_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
-- require r/have_ujis.require
|
let collation=ujis_japanese_ci;
|
||||||
disable_query_log;
|
--source include/have_collation.inc
|
||||||
show collation like 'ujis_japanese_ci';
|
|
||||||
enable_query_log;
|
|
||||||
|
@ -1,7 +1,2 @@
|
|||||||
--require r/have_utf8.require
|
let collation=utf8_general_ci;
|
||||||
|
--source include/have_collation.inc
|
||||||
--disable_query_log
|
|
||||||
|
|
||||||
SHOW COLLATION LIKE 'utf8_general_ci';
|
|
||||||
|
|
||||||
--enable_query_log
|
|
||||||
|
@ -101,7 +101,6 @@ sub init_pattern {
|
|||||||
|
|
||||||
sub collect_test_cases ($$) {
|
sub collect_test_cases ($$) {
|
||||||
my $suites= shift; # Semicolon separated list of test suites
|
my $suites= shift; # Semicolon separated list of test suites
|
||||||
my %found_suites;
|
|
||||||
my $opt_cases= shift;
|
my $opt_cases= shift;
|
||||||
my $cases= []; # Array of hash(one hash for each testcase)
|
my $cases= []; # Array of hash(one hash for each testcase)
|
||||||
|
|
||||||
@ -115,7 +114,6 @@ sub collect_test_cases ($$) {
|
|||||||
["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
|
["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
|
||||||
"ha_innodb_plugin.sl"],
|
"ha_innodb_plugin.sl"],
|
||||||
NOT_REQUIRED);
|
NOT_REQUIRED);
|
||||||
|
|
||||||
$do_innodb_plugin= ($::mysql_version_id >= 50100 &&
|
$do_innodb_plugin= ($::mysql_version_id >= 50100 &&
|
||||||
!(IS_WINDOWS && $::opt_embedded_server) &&
|
!(IS_WINDOWS && $::opt_embedded_server) &&
|
||||||
$lib_innodb_plugin);
|
$lib_innodb_plugin);
|
||||||
@ -123,7 +121,6 @@ sub collect_test_cases ($$) {
|
|||||||
foreach my $suite (split(",", $suites))
|
foreach my $suite (split(",", $suites))
|
||||||
{
|
{
|
||||||
push(@$cases, collect_one_suite($suite, $opt_cases));
|
push(@$cases, collect_one_suite($suite, $opt_cases));
|
||||||
$found_suites{$suite}= 1;
|
|
||||||
last if $some_test_found;
|
last if $some_test_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,12 +133,6 @@ sub collect_test_cases ($$) {
|
|||||||
{
|
{
|
||||||
my $found= 0;
|
my $found= 0;
|
||||||
my ($sname, $tname, $extension)= split_testname($test_name_spec);
|
my ($sname, $tname, $extension)= split_testname($test_name_spec);
|
||||||
if (defined($sname) && !defined($found_suites{$sname}))
|
|
||||||
{
|
|
||||||
$found_suites{$sname}= 1;
|
|
||||||
push(@$cases, collect_one_suite($sname));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $test ( @$cases )
|
foreach my $test ( @$cases )
|
||||||
{
|
{
|
||||||
# test->{name} is always in suite.name format
|
# test->{name} is always in suite.name format
|
||||||
@ -247,7 +238,7 @@ sub split_testname {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub collect_one_suite($)
|
sub collect_one_suite
|
||||||
{
|
{
|
||||||
my $suite= shift; # Test suite name
|
my $suite= shift; # Test suite name
|
||||||
my $opt_cases= shift;
|
my $opt_cases= shift;
|
||||||
@ -767,7 +758,6 @@ sub process_opts_file {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Collect information about a single test case
|
# Collect information about a single test case
|
||||||
|
@ -388,7 +388,7 @@ MSG
|
|||||||
}
|
}
|
||||||
elsif (@$extra_warnings)
|
elsif (@$extra_warnings)
|
||||||
{
|
{
|
||||||
mtr_error("There were errors/warnings in server logs after running test cases.");
|
mtr_error("There where errors/warnings in server logs after running test cases.");
|
||||||
}
|
}
|
||||||
elsif ($fail)
|
elsif ($fail)
|
||||||
{
|
{
|
||||||
|
@ -178,6 +178,7 @@ our @opt_extra_mysqltest_opt;
|
|||||||
|
|
||||||
our $opt_compress;
|
our $opt_compress;
|
||||||
our $opt_ssl;
|
our $opt_ssl;
|
||||||
|
our $opt_skip_ssl;
|
||||||
our $opt_ssl_supported;
|
our $opt_ssl_supported;
|
||||||
our $opt_ps_protocol;
|
our $opt_ps_protocol;
|
||||||
our $opt_sp_protocol;
|
our $opt_sp_protocol;
|
||||||
|
@ -126,7 +126,7 @@ my $path_config_file; # The generated config file, var/my.cnf
|
|||||||
# executables will be used by the test suite.
|
# executables will be used by the test suite.
|
||||||
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
|
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
|
||||||
|
|
||||||
my $DEFAULT_SUITES= "main,binlog,federated,rpl,innodb,maria,parts";
|
my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts";
|
||||||
my $opt_suites;
|
my $opt_suites;
|
||||||
|
|
||||||
our $opt_verbose= 0; # Verbose output, enable with --verbose
|
our $opt_verbose= 0; # Verbose output, enable with --verbose
|
||||||
@ -201,10 +201,10 @@ my $opt_mark_progress;
|
|||||||
|
|
||||||
my $opt_sleep;
|
my $opt_sleep;
|
||||||
|
|
||||||
my $opt_testcase_timeout= 15; # minutes
|
my $opt_testcase_timeout= 15; # 15 minutes
|
||||||
my $opt_suite_timeout = 300; # minutes
|
my $opt_suite_timeout = 360; # 6 hours
|
||||||
my $opt_shutdown_timeout= 10; # seconds
|
my $opt_shutdown_timeout= 10; # 10 seconds
|
||||||
my $opt_start_timeout = 180; # seconds
|
my $opt_start_timeout = 180; # 180 seconds
|
||||||
|
|
||||||
sub testcase_timeout { return $opt_testcase_timeout * 60; };
|
sub testcase_timeout { return $opt_testcase_timeout * 60; };
|
||||||
sub suite_timeout { return $opt_suite_timeout * 60; };
|
sub suite_timeout { return $opt_suite_timeout * 60; };
|
||||||
@ -1319,6 +1319,8 @@ sub command_line_setup {
|
|||||||
{
|
{
|
||||||
# Indicate that we are using debugger
|
# Indicate that we are using debugger
|
||||||
$glob_debugger= 1;
|
$glob_debugger= 1;
|
||||||
|
$opt_testcase_timeout= 60*60*24; # Don't abort debugging with timeout
|
||||||
|
$opt_suite_timeout= $opt_testcase_timeout;
|
||||||
$opt_retry= 1;
|
$opt_retry= 1;
|
||||||
$opt_retry_failure= 1;
|
$opt_retry_failure= 1;
|
||||||
|
|
||||||
@ -2151,7 +2153,6 @@ sub environment_setup {
|
|||||||
# Create an environment variable to make it possible
|
# Create an environment variable to make it possible
|
||||||
# to detect that valgrind is being used from test cases
|
# to detect that valgrind is being used from test cases
|
||||||
$ENV{'VALGRIND_TEST'}= $opt_valgrind;
|
$ENV{'VALGRIND_TEST'}= $opt_valgrind;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2908,8 +2909,8 @@ sub mysql_install_db {
|
|||||||
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
|
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
|
||||||
|
|
||||||
my $path_sql= my_find_file($install_basedir,
|
my $path_sql= my_find_file($install_basedir,
|
||||||
["mysql", "sql/share", "share/mysql",
|
["mysql", "sql/share", "share/mariadb",
|
||||||
"share/mariadb", "share", "scripts"],
|
"share/mysql", "share", "scripts"],
|
||||||
"mysql_system_tables.sql",
|
"mysql_system_tables.sql",
|
||||||
NOT_REQUIRED);
|
NOT_REQUIRED);
|
||||||
|
|
||||||
@ -3861,7 +3862,7 @@ sub extract_server_log ($$) {
|
|||||||
my ($error_log, $tname) = @_;
|
my ($error_log, $tname) = @_;
|
||||||
|
|
||||||
# Open the servers .err log file and read all lines
|
# Open the servers .err log file and read all lines
|
||||||
# belonging to current tets into @lines
|
# belonging to current test into @lines
|
||||||
my $Ferr = IO::File->new($error_log)
|
my $Ferr = IO::File->new($error_log)
|
||||||
or mtr_error("Could not open file '$error_log' for reading: $!");
|
or mtr_error("Could not open file '$error_log' for reading: $!");
|
||||||
|
|
||||||
@ -5682,12 +5683,15 @@ Misc options
|
|||||||
servers to exit before finishing the process
|
servers to exit before finishing the process
|
||||||
fast Run as fast as possible, dont't wait for servers
|
fast Run as fast as possible, dont't wait for servers
|
||||||
to shutdown etc.
|
to shutdown etc.
|
||||||
parallel=N Run tests in N parallel threads (default=1)
|
parallel=N Run tests in N parallel threads (default 1)
|
||||||
Use parallel=auto for auto-setting of N
|
Use parallel=auto for auto-setting of N
|
||||||
repeat=N Run each test N number of times
|
repeat=N Run each test N number of times
|
||||||
retry=N Retry tests that fail N times, limit number of failures
|
retry=N Retry tests that fail up to N times (default $opt_retry).
|
||||||
to $opt_retry_failure
|
Retries are also limited by the maximum number of
|
||||||
retry-failure=N Limit number of retries for a failed test
|
failures before stopping, set with the --retry-failure
|
||||||
|
option
|
||||||
|
retry-failure=N When using the --retry option to retry failed tests,
|
||||||
|
stop when N failures have occured (default $opt_retry_failure)
|
||||||
reorder Reorder tests to get fewer server restarts
|
reorder Reorder tests to get fewer server restarts
|
||||||
help Get this help text
|
help Get this help text
|
||||||
|
|
||||||
|
31
mysql-test/r/create-uca.result
Normal file
31
mysql-test/r/create-uca.result
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
drop table if exists t1,t2;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT DEFAULT 12 COMMENT 'column1',
|
||||||
|
c2 INT NULL COMMENT 'column2',
|
||||||
|
c3 INT NOT NULL COMMENT 'column3',
|
||||||
|
c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
|
||||||
|
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
|
||||||
|
c6 VARCHAR(255))
|
||||||
|
COLLATE latin1_bin;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`c1` int(11) DEFAULT '12' COMMENT 'column1',
|
||||||
|
`c2` int(11) DEFAULT NULL COMMENT 'column2',
|
||||||
|
`c3` int(11) NOT NULL COMMENT 'column3',
|
||||||
|
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
|
||||||
|
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
|
||||||
|
`c6` varchar(255) COLLATE latin1_bin DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
|
||||||
|
CREATE TABLE t2 AS SELECT * FROM t1;
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`c1` int(11) DEFAULT '12' COMMENT 'column1',
|
||||||
|
`c2` int(11) DEFAULT NULL COMMENT 'column2',
|
||||||
|
`c3` int(11) NOT NULL COMMENT 'column3',
|
||||||
|
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
|
||||||
|
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
|
||||||
|
`c6` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1,t2;
|
@ -1792,52 +1792,6 @@ t1 CREATE TABLE `t1` (
|
|||||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# --
|
|
||||||
# -- Bug#21380: DEFAULT definition not always transfered by CREATE
|
|
||||||
# -- TABLE/SELECT to the new table.
|
|
||||||
# --
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
DROP TABLE IF EXISTS t2;
|
|
||||||
|
|
||||||
CREATE TABLE t1(
|
|
||||||
c1 INT DEFAULT 12 COMMENT 'column1',
|
|
||||||
c2 INT NULL COMMENT 'column2',
|
|
||||||
c3 INT NOT NULL COMMENT 'column3',
|
|
||||||
c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
|
|
||||||
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
|
|
||||||
c6 VARCHAR(255))
|
|
||||||
COLLATE latin1_bin;
|
|
||||||
|
|
||||||
SHOW CREATE TABLE t1;
|
|
||||||
Table Create Table
|
|
||||||
t1 CREATE TABLE `t1` (
|
|
||||||
`c1` int(11) DEFAULT '12' COMMENT 'column1',
|
|
||||||
`c2` int(11) DEFAULT NULL COMMENT 'column2',
|
|
||||||
`c3` int(11) NOT NULL COMMENT 'column3',
|
|
||||||
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
|
|
||||||
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
|
|
||||||
`c6` varchar(255) COLLATE latin1_bin DEFAULT NULL
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
|
|
||||||
|
|
||||||
CREATE TABLE t2 AS SELECT * FROM t1;
|
|
||||||
|
|
||||||
SHOW CREATE TABLE t2;
|
|
||||||
Table Create Table
|
|
||||||
t2 CREATE TABLE `t2` (
|
|
||||||
`c1` int(11) DEFAULT '12' COMMENT 'column1',
|
|
||||||
`c2` int(11) DEFAULT NULL COMMENT 'column2',
|
|
||||||
`c3` int(11) NOT NULL COMMENT 'column3',
|
|
||||||
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
|
|
||||||
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
|
|
||||||
`c6` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
|
||||||
|
|
||||||
DROP TABLE t2;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
# -- End of test case for Bug#21380.
|
|
||||||
|
|
||||||
# --
|
# --
|
||||||
# -- Bug#18834: ALTER TABLE ADD INDEX on table with two timestamp fields
|
# -- Bug#18834: ALTER TABLE ADD INDEX on table with two timestamp fields
|
||||||
# --
|
# --
|
||||||
|
@ -1211,3 +1211,47 @@ HEX(DAYNAME(19700101))
|
|||||||
0427043504420432043504400433
|
0427043504420432043504400433
|
||||||
SET character_set_connection=latin1;
|
SET character_set_connection=latin1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
Start of 5.1 tests
|
||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a varchar(10) CHARACTER SET ucs2 COLLATE ucs2_czech_ci,
|
||||||
|
key(a)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
('aa'),('bb'),('cc'),('dd'),('ee'),('ff'),('gg'),('hh'),('ii'),
|
||||||
|
('jj'),('kk'),('ll'),('mm'),('nn'),('oo'),('pp'),('rr'),('ss'),
|
||||||
|
('tt'),('uu'),('vv'),('ww'),('xx'),('yy'),('zz');
|
||||||
|
INSERT INTO t1 VALUES ('ca'),('cz'),('ch');
|
||||||
|
INSERT INTO t1 VALUES ('da'),('dz'), (X'0064017E');
|
||||||
|
EXPLAIN SELECT * FROM t1 WHERE a LIKE 'b%';
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index
|
||||||
|
EXPLAIN SELECT * FROM t1 WHERE a LIKE 'c%';
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range a a 23 NULL 30 Using where; Using index
|
||||||
|
SELECT * FROM t1 WHERE a LIKE 'c%';
|
||||||
|
a
|
||||||
|
ca
|
||||||
|
cc
|
||||||
|
cz
|
||||||
|
ch
|
||||||
|
EXPLAIN SELECT * FROM t1 WHERE a LIKE 'ch%';
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index
|
||||||
|
SELECT * FROM t1 WHERE a LIKE 'ch%';
|
||||||
|
a
|
||||||
|
ch
|
||||||
|
ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ucs2 COLLATE ucs2_croatian_ci;
|
||||||
|
EXPLAIN SELECT * FROM t1 WHERE a LIKE 'd%';
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index
|
||||||
|
SELECT hex(concat('d',_ucs2 0x017E,'%'));
|
||||||
|
hex(concat('d',_ucs2 0x017E,'%'))
|
||||||
|
0064017E0025
|
||||||
|
EXPLAIN SELECT * FROM t1 WHERE a LIKE concat('d',_ucs2 0x017E,'%');
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index
|
||||||
|
SELECT hex(a) FROM t1 WHERE a LIKE concat('D',_ucs2 0x017E,'%');
|
||||||
|
hex(a)
|
||||||
|
0064017E
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
drop table if exists t1,t2,t3,t4;
|
||||||
|
drop database if exists mysqltest;
|
||||||
drop table if exists t1,t2;
|
drop table if exists t1,t2;
|
||||||
set names utf8;
|
set names utf8;
|
||||||
select left(_utf8 0xD0B0D0B1D0B2,1);
|
select left(_utf8 0xD0B0D0B1D0B2,1);
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
big5_chinese_ci big5 1 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
cp1250_czech_cs cp1250 34 Yes 2
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
cp1251_general_ci cp1251 51 Yes 0
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
cp866_general_ci cp866 36 Yes 0
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
cp932_japanese_ci cp932 95 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
eucjpms_japanese_ci eucjpms 97 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
euckr_korean_ci euckr 19 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
gb2312_chinese_ci gb2312 24 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
gbk_chinese_ci gbk 28 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
koi8r_general_ci koi8r 7 Yes 0
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
latin2_czech_cs latin2 2 Yes 4
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
sjis_japanese_ci sjis 13 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
tis620_thai_ci tis620 18 Yes Yes 4
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
ucs2_general_ci ucs2 35 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
ujis_japanese_ci ujis 12 Yes Yes 1
|
|
@ -1,2 +0,0 @@
|
|||||||
Collation Charset Id Default Compiled Sortlen
|
|
||||||
utf8_general_ci utf8 33 Yes Yes 1
|
|
@ -3160,15 +3160,6 @@ ALTER TABLE t2 MODIFY a INT NOT NULL;
|
|||||||
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
|
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
DROP TABLE t2,t1;
|
DROP TABLE t2,t1;
|
||||||
CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
|
|
||||||
ENGINE=InnoDB;
|
|
||||||
INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
|
|
||||||
DELETE FROM t1;
|
|
||||||
INSERT INTO t1 VALUES ('DDD');
|
|
||||||
SELECT * FROM t1;
|
|
||||||
a
|
|
||||||
DDD
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
|
CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
|
||||||
AUTO_INCREMENT=42;
|
AUTO_INCREMENT=42;
|
||||||
INSERT INTO t1 VALUES (0),(347),(0);
|
INSERT INTO t1 VALUES (0),(347),(0);
|
||||||
|
10
mysql-test/r/innodb_utf8.result
Normal file
10
mysql-test/r/innodb_utf8.result
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
drop table if exists t1;
|
||||||
|
CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
|
||||||
|
ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
|
||||||
|
DELETE FROM t1;
|
||||||
|
INSERT INTO t1 VALUES ('DDD');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
DDD
|
||||||
|
DROP TABLE t1;
|
@ -319,3 +319,17 @@ SHOW ERRORS;
|
|||||||
Level Code Message
|
Level Code Message
|
||||||
Error 1051 Unknown table 't1'
|
Error 1051 Unknown table 't1'
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
set sql_mode = default;
|
||||||
|
select CAST(a AS DECIMAL(13,5)) FROM (SELECT '' as a) t;
|
||||||
|
CAST(a AS DECIMAL(13,5))
|
||||||
|
0.00000
|
||||||
|
Warnings:
|
||||||
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
|
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||||
|
create table t1 (a integer unsigned);
|
||||||
|
insert into t1 values (1),(-1),(0),(-2);
|
||||||
|
Warnings:
|
||||||
|
Warning 1264 Out of range value for column 'a' at row 2
|
||||||
|
Warning 1264 Out of range value for column 'a' at row 4
|
||||||
|
drop table t1;
|
||||||
|
End of 5.1 tests
|
||||||
|
@ -9,5 +9,4 @@
|
|||||||
# Do not use any TAB characters for whitespace.
|
# Do not use any TAB characters for whitespace.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
federated_server : needs fixup
|
|
||||||
|
|
||||||
|
@ -175,6 +175,8 @@ CREATE TABLE db_bogus.t1 (
|
|||||||
)
|
)
|
||||||
;
|
;
|
||||||
INSERT INTO db_bogus.t1 VALUES ('2','this is bogus');
|
INSERT INTO db_bogus.t1 VALUES ('2','this is bogus');
|
||||||
|
create user test_fed@localhost identified by 'foo';
|
||||||
|
grant all on db_legitimate.* to test_fed@localhost;
|
||||||
create server 's1' foreign data wrapper 'mysql' options
|
create server 's1' foreign data wrapper 'mysql' options
|
||||||
(HOST '127.0.0.1',
|
(HOST '127.0.0.1',
|
||||||
DATABASE 'db_legitimate',
|
DATABASE 'db_legitimate',
|
||||||
@ -211,15 +213,14 @@ id name
|
|||||||
alter server s1 options (database 'db_bogus');
|
alter server s1 options (database 'db_bogus');
|
||||||
flush tables;
|
flush tables;
|
||||||
select * from federated.t1;
|
select * from federated.t1;
|
||||||
id name
|
ERROR HY000: There was a problem processing the query on the foreign data source. Data source error: : 1044 : Access denied for user 'test_fed'@'localhost' to databa
|
||||||
2 this is bogus
|
|
||||||
drop server if exists 's1';
|
drop server if exists 's1';
|
||||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||||
create server 's1' foreign data wrapper 'mysql' options
|
create server 's1' foreign data wrapper 'mysql' options
|
||||||
(HOST '127.0.0.1',
|
(HOST '127.0.0.1',
|
||||||
DATABASE 'db_legitimate',
|
DATABASE 'db_legitimate',
|
||||||
USER 'root',
|
USER 'test_fed',
|
||||||
PASSWORD '',
|
PASSWORD 'foo',
|
||||||
PORT SLAVE_PORT,
|
PORT SLAVE_PORT,
|
||||||
SOCKET '',
|
SOCKET '',
|
||||||
OWNER 'root');
|
OWNER 'root');
|
||||||
@ -228,8 +229,8 @@ drop server 's1';
|
|||||||
create server 's1' foreign data wrapper 'mysql' options
|
create server 's1' foreign data wrapper 'mysql' options
|
||||||
(HOST '127.0.0.1',
|
(HOST '127.0.0.1',
|
||||||
DATABASE 'db_legitimate',
|
DATABASE 'db_legitimate',
|
||||||
USER 'root',
|
USER 'test_fed',
|
||||||
PASSWORD '',
|
PASSWORD 'foo',
|
||||||
PORT SLAVE_PORT,
|
PORT SLAVE_PORT,
|
||||||
SOCKET '',
|
SOCKET '',
|
||||||
OWNER 'root');
|
OWNER 'root');
|
||||||
@ -237,6 +238,7 @@ flush tables;
|
|||||||
select * from federated.t1;
|
select * from federated.t1;
|
||||||
id name
|
id name
|
||||||
1 this is legitimate
|
1 this is legitimate
|
||||||
|
drop user test_fed@localhost;
|
||||||
drop database db_legitimate;
|
drop database db_legitimate;
|
||||||
drop database db_bogus;
|
drop database db_bogus;
|
||||||
drop user guest_super@localhost;
|
drop user guest_super@localhost;
|
||||||
@ -275,6 +277,6 @@ call p1();
|
|||||||
drop procedure p1;
|
drop procedure p1;
|
||||||
drop server if exists s;
|
drop server if exists s;
|
||||||
DROP TABLE IF EXISTS federated.t1;
|
DROP TABLE IF EXISTS federated.t1;
|
||||||
DROP DATABASE federated;
|
DROP DATABASE IF EXISTS federated;
|
||||||
DROP TABLE IF EXISTS federated.t1;
|
DROP TABLE IF EXISTS federated.t1;
|
||||||
DROP DATABASE federated;
|
DROP DATABASE IF EXISTS federated;
|
||||||
|
@ -239,6 +239,7 @@ alter server s1 options (database 'db_bogus');
|
|||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
flush tables;
|
flush tables;
|
||||||
|
--error ER_QUERY_ON_FOREIGN_DATA_SOURCE
|
||||||
select * from federated.t1;
|
select * from federated.t1;
|
||||||
|
|
||||||
connection conn_select;
|
connection conn_select;
|
||||||
@ -249,8 +250,8 @@ drop server if exists 's1';
|
|||||||
eval create server 's1' foreign data wrapper 'mysql' options
|
eval create server 's1' foreign data wrapper 'mysql' options
|
||||||
(HOST '127.0.0.1',
|
(HOST '127.0.0.1',
|
||||||
DATABASE 'db_legitimate',
|
DATABASE 'db_legitimate',
|
||||||
USER 'root',
|
USER 'test_fed',
|
||||||
PASSWORD '',
|
PASSWORD 'foo',
|
||||||
PORT $SLAVE_MYPORT,
|
PORT $SLAVE_MYPORT,
|
||||||
SOCKET '',
|
SOCKET '',
|
||||||
OWNER 'root');
|
OWNER 'root');
|
||||||
@ -261,8 +262,8 @@ drop server 's1';
|
|||||||
eval create server 's1' foreign data wrapper 'mysql' options
|
eval create server 's1' foreign data wrapper 'mysql' options
|
||||||
(HOST '127.0.0.1',
|
(HOST '127.0.0.1',
|
||||||
DATABASE 'db_legitimate',
|
DATABASE 'db_legitimate',
|
||||||
USER 'root',
|
USER 'test_fed',
|
||||||
PASSWORD '',
|
PASSWORD 'foo',
|
||||||
PORT $SLAVE_MYPORT,
|
PORT $SLAVE_MYPORT,
|
||||||
SOCKET '',
|
SOCKET '',
|
||||||
OWNER 'root');
|
OWNER 'root');
|
||||||
@ -273,6 +274,7 @@ select * from federated.t1;
|
|||||||
|
|
||||||
# clean up test
|
# clean up test
|
||||||
connection slave;
|
connection slave;
|
||||||
|
drop user test_fed@localhost;
|
||||||
drop database db_legitimate;
|
drop database db_legitimate;
|
||||||
drop database db_bogus;
|
drop database db_bogus;
|
||||||
|
|
||||||
|
@ -3372,9 +3372,9 @@ NULL NULL 1
|
|||||||
-1.00 -1 5
|
-1.00 -1 5
|
||||||
-3333.33 -3333.3333 29
|
-3333.33 -3333.3333 29
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
SHOW CREATE VIEW v1;
|
SHOW CREATE VIEW v1;
|
||||||
View Create View character_set_client collation_connection
|
View Create View character_set_client collation_connection
|
||||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||||
@ -3389,9 +3389,9 @@ NULL NULL 1
|
|||||||
-1.00 -1 5
|
-1.00 -1 5
|
||||||
-3333.33 -3333.3333 29
|
-3333.33 -3333.3333 29
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
|
|
||||||
|
|
||||||
@ -3408,11 +3408,11 @@ NULL NULL 1
|
|||||||
-1.00 -1 5
|
-1.00 -1 5
|
||||||
-3333.33 -3333.3333 28
|
-3333.33 -3333.3333 28
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||||
Warning 1292 Truncated incorrect DECIMAL value: '-1'
|
Warning 1292 Truncated incorrect DECIMAL value: '-1'
|
||||||
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
|
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
|
||||||
@ -3430,11 +3430,11 @@ NULL NULL 1
|
|||||||
-1.00 -1 |