1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
This commit is contained in:
Magnus Svensson
2008-08-08 20:10:43 +02:00
233 changed files with 11458 additions and 16401 deletions

View File

@ -2101,6 +2101,37 @@ static bool add_line(String &buffer,char *line,char *in_string,
continue;
}
}
else if (!*ml_comment && !*in_string &&
(end_of_line - pos) >= 10 &&
!my_strnncoll(charset_info, (uchar*) pos, 10,
(const uchar*) "delimiter ", 10))
{
// Flush previously accepted characters
if (out != line)
{
buffer.append(line, (uint32) (out - line));
out= line;
}
// Flush possible comments in the buffer
if (!buffer.is_empty())
{
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
DBUG_RETURN(1);
buffer.length(0);
}
/*
Delimiter wants the get rest of the given line as argument to
allow one to change ';' to ';;' and back
*/
buffer.append(pos);
if (com_delimiter(&buffer, pos) > 0)
DBUG_RETURN(1);
buffer.length(0);
break;
}
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
{
// Found a statement. Continue parsing after the delimiter

View File

@ -170,6 +170,8 @@ static void timer_output(void);
static ulonglong timer_now(void);
static ulong connection_retry_sleep= 100000; /* Microseconds */
/* Precompiled re's */
static my_regex_t ps_re; /* the query can be run using PS protocol */
static my_regex_t sp_re; /* the query can be run as a SP */
@ -276,6 +278,7 @@ enum enum_commands {
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
Q_UNKNOWN, /* Unknown command. */
@ -368,6 +371,9 @@ const char *command_names[]=
"change_user",
"mkdir",
"rmdir",
"list_files",
"list_files_write_file",
"list_files_append_file",
"send_shutdown",
"shutdown_server",
@ -654,6 +660,9 @@ void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val);
void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val);
void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING* ds_input);
static int match_expected_error(struct st_command *command,
unsigned int err_errno,
const char *err_sqlstate);
void handle_error(struct st_command*,
unsigned int err_errno, const char *err_error,
const char *err_sqlstate, DYNAMIC_STRING *ds);
@ -1010,30 +1019,26 @@ void check_command_args(struct st_command *command,
DBUG_VOID_RETURN;
}
void handle_command_error(struct st_command *command, uint error)
{
DBUG_ENTER("handle_command_error");
DBUG_PRINT("enter", ("error: %d", error));
if (error != 0)
{
uint i;
int i;
if (command->abort_on_error)
die("command \"%.*s\" failed with error %d",
command->first_word_len, command->query, error);
for (i= 0; i < command->expected_errors.count; i++)
{
DBUG_PRINT("info", ("expected error: %d",
command->expected_errors.err[i].code.errnum));
if ((command->expected_errors.err[i].type == ERR_ERRNO) &&
(command->expected_errors.err[i].code.errnum == error))
i= match_expected_error(command, error, NULL);
if (i >= 0)
{
DBUG_PRINT("info", ("command \"%.*s\" failed with expected error: %d",
command->first_word_len, command->query, error));
DBUG_VOID_RETURN;
}
}
die("command \"%.*s\" failed with wrong error: %d",
command->first_word_len, command->query, error);
}
@ -2601,8 +2606,8 @@ void do_exec(struct st_command *command)
error= pclose(res_file);
if (error > 0)
{
uint status= WEXITSTATUS(error), i;
my_bool ok= 0;
uint status= WEXITSTATUS(error);
int i;
if (command->abort_on_error)
{
@ -2614,19 +2619,13 @@ void do_exec(struct st_command *command)
DBUG_PRINT("info",
("error: %d, status: %d", error, status));
for (i= 0; i < command->expected_errors.count; i++)
{
DBUG_PRINT("info", ("expected error: %d",
command->expected_errors.err[i].code.errnum));
if ((command->expected_errors.err[i].type == ERR_ERRNO) &&
(command->expected_errors.err[i].code.errnum == status))
{
ok= 1;
i= match_expected_error(command, status, NULL);
if (i >= 0)
DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d",
command->first_argument, status));
}
}
if (!ok)
else
{
dynstr_free(&ds_cmd);
die("command \"%s\" failed with wrong error: %d",
@ -2976,6 +2975,126 @@ void do_rmdir(struct st_command *command)
}
/*
SYNOPSIS
get_list_files
ds output
ds_dirname dir to list
ds_wild wild-card file pattern (can be empty)
DESCRIPTION
list all entries in directory (matching ds_wild if given)
*/
static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
const DYNAMIC_STRING *ds_wild)
{
uint i;
MY_DIR *dir_info;
FILEINFO *file;
DBUG_ENTER("get_list_files");
DBUG_PRINT("info", ("listing directory: %s", ds_dirname->str));
/* Note that my_dir sorts the list if not given any flags */
if (!(dir_info= my_dir(ds_dirname->str, MYF(0))))
DBUG_RETURN(1);
for (i= 0; i < (uint) dir_info->number_off_files; i++)
{
file= dir_info->dir_entry + i;
if (file->name[0] == '.' &&
(file->name[1] == '\0' ||
(file->name[1] == '.' && file->name[2] == '\0')))
continue; /* . or .. */
if (ds_wild && ds_wild->length &&
wild_compare(file->name, ds_wild->str, 0))
continue;
dynstr_append(ds, file->name);
dynstr_append(ds, "\n");
}
my_dirend(dir_info);
DBUG_RETURN(0);
}
/*
SYNOPSIS
do_list_files
command called command
DESCRIPTION
list_files <dir_name> [<file_name>]
List files and directories in directory <dir_name> (like `ls`)
[Matching <file_name>, where wild-cards are allowed]
*/
static void do_list_files(struct st_command *command)
{
int error;
static DYNAMIC_STRING ds_dirname;
static DYNAMIC_STRING ds_wild;
const struct command_arg list_files_args[] = {
{"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to list"},
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
};
DBUG_ENTER("do_list_files");
check_command_args(command, command->first_argument,
list_files_args,
sizeof(list_files_args)/sizeof(struct command_arg), ' ');
error= get_list_files(&ds_res, &ds_dirname, &ds_wild);
handle_command_error(command, error);
dynstr_free(&ds_dirname);
dynstr_free(&ds_wild);
DBUG_VOID_RETURN;
}
/*
SYNOPSIS
do_list_files_write_file_command
command called command
append append file, or create new
DESCRIPTION
list_files_{write|append}_file <filename> <dir_name> [<match_file>]
List files and directories in directory <dir_name> (like `ls`)
[Matching <match_file>, where wild-cards are allowed]
Note: File will be truncated if exists and append is not true.
*/
static void do_list_files_write_file_command(struct st_command *command,
my_bool append)
{
int error;
static DYNAMIC_STRING ds_content;
static DYNAMIC_STRING ds_filename;
static DYNAMIC_STRING ds_dirname;
static DYNAMIC_STRING ds_wild;
const struct command_arg list_files_args[] = {
{"filename", ARG_STRING, TRUE, &ds_filename, "Filename for write"},
{"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to list"},
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
};
DBUG_ENTER("do_list_files_write_file");
check_command_args(command, command->first_argument,
list_files_args,
sizeof(list_files_args)/sizeof(struct command_arg), ' ');
init_dynamic_string(&ds_content, "", 1024, 1024);
error= get_list_files(&ds_content, &ds_dirname, &ds_wild);
handle_command_error(command, error);
str_to_file2(ds_filename.str, ds_content.str, ds_content.length, append);
dynstr_free(&ds_content);
dynstr_free(&ds_filename);
dynstr_free(&ds_dirname);
dynstr_free(&ds_wild);
DBUG_VOID_RETURN;
}
/*
Read characters from line buffer or file. This is needed to allow
my_ungetc() to buffer MAX_DELIMITER_LENGTH characters for a file
@ -4458,7 +4577,6 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
int port, const char *sock)
{
int failed_attempts= 0;
static ulong connection_retry_sleep= 100000; /* Microseconds */
DBUG_ENTER("safe_connect");
while(!mysql_real_connect(mysql, host,user, pass, db, port, sock,
@ -4525,6 +4643,7 @@ int connect_n_handle_errors(struct st_command *command,
const char* db, int port, const char* sock)
{
DYNAMIC_STRING *ds;
int failed_attempts= 0;
ds= &ds_res;
@ -4553,9 +4672,41 @@ int connect_n_handle_errors(struct st_command *command,
dynstr_append_mem(ds, delimiter, delimiter_length);
dynstr_append_mem(ds, "\n", 1);
}
if (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
CLIENT_MULTI_STATEMENTS))
{
/*
If we have used up all our connections check whether this
is expected (by --error). If so, handle the error right away.
Otherwise, give it some extra time to rule out race-conditions.
If extra-time doesn't help, we have an unexpected error and
must abort -- just proceeding to handle_error() when second
and third chances are used up will handle that for us.
There are various user-limits of which only max_user_connections
and max_connections_per_hour apply at connect time. For the
the second to create a race in our logic, we'd need a limits
test that runs without a FLUSH for longer than an hour, so we'll
stay clear of trying to work out which exact user-limit was
exceeded.
*/
if (((mysql_errno(con) == ER_TOO_MANY_USER_CONNECTIONS) ||
(mysql_errno(con) == ER_USER_LIMIT_REACHED)) &&
(failed_attempts++ < opt_max_connect_retries))
{
int i;
i= match_expected_error(command, mysql_errno(con), mysql_sqlstate(con));
if (i >= 0)
goto do_handle_error; /* expected error, handle */
my_sleep(connection_retry_sleep); /* unexpected error, wait */
continue; /* and give it 1 more chance */
}
do_handle_error:
var_set_errno(mysql_errno(con));
handle_error(command, mysql_errno(con), mysql_error(con),
mysql_sqlstate(con), ds);
@ -6265,6 +6416,56 @@ end:
}
/*
Check whether given error is in list of expected errors
SYNOPSIS
match_expected_error()
PARAMETERS
command the current command (and its expect-list)
err_errno error number of the error that actually occurred
err_sqlstate SQL-state that was thrown, or NULL for impossible
(file-ops, diff, etc.)
RETURNS
-1 for not in list, index in list of expected errors otherwise
NOTE
If caller needs to know whether the list was empty, they should
check command->expected_errors.count.
*/
static int match_expected_error(struct st_command *command,
unsigned int err_errno,
const char *err_sqlstate)
{
uint i;
for (i= 0 ; (uint) i < command->expected_errors.count ; i++)
{
if ((command->expected_errors.err[i].type == ERR_ERRNO) &&
(command->expected_errors.err[i].code.errnum == err_errno))
return i;
if (command->expected_errors.err[i].type == ERR_SQLSTATE)
{
/*
NULL is quite likely, but not in conjunction with a SQL-state expect!
*/
if (unlikely(err_sqlstate == NULL))
die("expecting a SQL-state (%s) from query '%s' which cannot produce one...",
command->expected_errors.err[i].code.sqlstate, command->query);
if (strncmp(command->expected_errors.err[i].code.sqlstate,
err_sqlstate, SQLSTATE_LENGTH) == 0)
return i;
}
}
return -1;
}
/*
Handle errors which occurred during execution
@ -6285,7 +6486,7 @@ void handle_error(struct st_command *command,
unsigned int err_errno, const char *err_error,
const char *err_sqlstate, DYNAMIC_STRING *ds)
{
uint i;
int i;
DBUG_ENTER("handle_error");
@ -6311,13 +6512,10 @@ void handle_error(struct st_command *command,
DBUG_PRINT("info", ("expected_errors.count: %d",
command->expected_errors.count));
for (i= 0 ; (uint) i < command->expected_errors.count ; i++)
{
if (((command->expected_errors.err[i].type == ERR_ERRNO) &&
(command->expected_errors.err[i].code.errnum == err_errno)) ||
((command->expected_errors.err[i].type == ERR_SQLSTATE) &&
(strncmp(command->expected_errors.err[i].code.sqlstate,
err_sqlstate, SQLSTATE_LENGTH) == 0)))
i= match_expected_error(command, err_errno, err_sqlstate);
if (i >= 0)
{
if (!disable_result_log)
{
@ -6339,7 +6537,6 @@ void handle_error(struct st_command *command,
/* OK */
DBUG_VOID_RETURN;
}
}
DBUG_PRINT("info",("i: %d expected_errors: %d", i,
command->expected_errors.count));
@ -6353,7 +6550,7 @@ void handle_error(struct st_command *command,
dynstr_append_mem(ds, "\n", 1);
}
if (i)
if (command->expected_errors.count > 0)
{
if (command->expected_errors.err[0].type == ERR_ERRNO)
die("query '%s' failed with wrong errno %d: '%s', instead of %d...",
@ -7375,6 +7572,13 @@ int main(int argc, char **argv)
case Q_REMOVE_FILE: do_remove_file(command); break;
case Q_MKDIR: do_mkdir(command); break;
case Q_RMDIR: do_rmdir(command); break;
case Q_LIST_FILES: do_list_files(command); break;
case Q_LIST_FILES_WRITE_FILE:
do_list_files_write_file_command(command, FALSE);
break;
case Q_LIST_FILES_APPEND_FILE:
do_list_files_write_file_command(command, TRUE);
break;
case Q_FILE_EXIST: do_file_exist(command); break;
case Q_WRITE_FILE: do_write_file(command); break;
case Q_APPEND_FILE: do_append_file(command); break;

View File

@ -617,19 +617,19 @@ fi
AC_MSG_CHECKING(whether features provided by the user community should be included.)
AC_ARG_ENABLE(community-features,
AC_HELP_STRING(
[--enable-community-features],
[Enable additional features provided by the user community.]),
[--disable-community-features],
[Disable additional features provided by the user community.]),
[ ENABLE_COMMUNITY_FEATURES=$enableval ],
[ ENABLE_COMMUNITY_FEATURES=no ]
[ ENABLE_COMMUNITY_FEATURES=yes ]
)
if test "$ENABLE_COMMUNITY_FEATURES" = "yes"
then
AC_DEFINE([COMMUNITY_SERVER], [1],
[Whether features provided by the user community should be included])
AC_MSG_RESULT([yes, community server])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, enterprise server])
AC_MSG_RESULT([no])
fi
AC_ARG_WITH(server-suffix,

View File

@ -693,6 +693,7 @@ extern char * fn_format(char * to,const char *name,const char *dir,
const char *form, uint flag);
extern size_t strlength(const char *str);
extern void pack_dirname(char * to,const char *from);
extern size_t normalize_dirname(char * to, const char *from);
extern size_t unpack_dirname(char * to,const char *from);
extern size_t cleanup_dirname(char * to,const char *from);
extern size_t system_filename(char * to,const char *from);

View File

@ -447,7 +447,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
if (thd->protocol == &thd->protocol_binary)
{
uint length;
row= (MYSQL_ROWS *)alloc_root(&data->alloc, rows * sizeof(MYSQL_ROWS));
row= (MYSQL_ROWS *)alloc_root(&data->alloc,
(size_t) (rows * sizeof(MYSQL_ROWS)));
end_row= row + rows;
data->data= row;

View File

@ -259,7 +259,7 @@ DELETE FROM t1;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
sync_slave_with_master;
set @@global.slave_exec_mode= default;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
@ -288,3 +288,150 @@ SELECT * FROM t1;
connection master;
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
sync_slave_with_master;
#
# BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars
#
# We have 4 combinations to test with respect to the field length
# (i.e., the number of bytes) of the CHAR fields:
#
# 1. Replicating from CHAR<256 to CHAR<256
# 2. Replicating from CHAR<256 to CHAR>255
# 3. Replicating from CHAR>255 to CHAR<256
# 4. Replicating from CHAR>255 to CHAR>255
# We also make a special case of using the max size of a field on the
# master, i.e. CHAR(255) in UTF-8, giving another three cases.
#
# 5. Replicating UTF-8 CHAR(255) to CHAR(<256)
# 6. Replicating UTF-8 CHAR(255) to CHAR(>255)
# 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
connection master;
CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
sync_slave_with_master;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
sync_slave_with_master;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
sync_slave_with_master;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
sync_slave_with_master;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
--echo [expecting slave to replicate correctly]
connection master;
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
--echo [expecting slave to replicate correctly]
connection master;
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
source include/diff_tables.inc;
--echo [expecting slave to stop]
connection master;
INSERT INTO t3 VALUES (1, "", 1);
INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--echo [expecting slave to replicate correctly]
connection master;
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4;
source include/diff_tables.inc;
--echo [expecting slave to stop]
connection master;
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--echo [expecting slave to stop]
connection master;
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--echo [expecting slave to replicate correctly]
connection master;
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
let $diff_table_1=master:test.t7;
let $diff_table_2=slave:test.t7;
source include/diff_tables.inc;
connection master;
drop table t1, t2, t3, t4, t5, t6, t7;
sync_slave_with_master;

View File

@ -1,4 +1,4 @@
-- require r/have_big5.require
disable_query_log;
show collation like "big5_chinese_ci";
show collation like 'big5_chinese_ci';
enable_query_log;

View File

@ -2,5 +2,5 @@
-- require r/have_binlog_format_mixed.require
disable_query_log;
show variables like "binlog_format";
show variables like 'binlog_format';
enable_query_log;

View File

@ -3,5 +3,5 @@
--require r/have_binlog_format_row.require
--disable_query_log
--replace_result MIXED ROW
show variables like "binlog_format";
show variables like 'binlog_format';
--enable_query_log

View File

@ -4,5 +4,5 @@ source include/have_log_bin.inc;
--require r/have_binlog_format_statement.require
--disable_query_log
--replace_result MIXED STATEMENT
show variables like "binlog_format";
show variables like 'binlog_format';
--enable_query_log

View File

@ -2,5 +2,5 @@
-- require r/have_binlog_format_row.require
disable_query_log;
show variables like "binlog_format";
show variables like 'binlog_format';
enable_query_log;

View File

@ -3,5 +3,5 @@
-- require r/have_binlog_format_statement.require
--disable_query_log
--replace_result ROW STATEMENT
show variables like "binlog_format";
show variables like 'binlog_format';
--enable_query_log

View File

@ -2,5 +2,5 @@
-- require r/have_binlog_format_statement.require
disable_query_log;
show variables like "binlog_format";
show variables like 'binlog_format';
enable_query_log;

View File

@ -1,4 +1,4 @@
--require r/case_sensitive_file_system.require
--disable_query_log
show variables like "lower_case_file_system";
show variables like 'lower_case_file_system';
--enable_query_log

View File

@ -1,4 +1,4 @@
--require r/have_community_features.require
--disable_query_log
show variables like "have_community_features";
show variables like 'have_community_features';
--enable_query_log

View File

@ -1,4 +1,4 @@
-- require r/have_compress.require
disable_query_log;
show variables like "have_compress";
show variables like 'have_compress';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_cp1250_ch.require
disable_query_log;
show collation like "cp1250_czech_cs";
show collation like 'cp1250_czech_cs';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_cp932.require
disable_query_log;
show collation like "cp932_japanese_ci";
show collation like 'cp932_japanese_ci';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_crypt.require
disable_query_log;
show variables like "have_crypt";
show variables like 'have_crypt';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_debug.require
disable_query_log;
select (version() like "%debug%") as debug;
select (version() like '%debug%') as debug;
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_eucjpms.require
disable_query_log;
show collation like "eucjpms_japanese_ci";
show collation like 'eucjpms_japanese_ci';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_euckr.require
disable_query_log;
show collation like "euckr_korean_ci";
show collation like 'euckr_korean_ci';
enable_query_log;

View File

@ -4,7 +4,7 @@
#
--require r/have_dynamic_loading.require
disable_query_log;
show variables like "have_dynamic_loading";
show variables like 'have_dynamic_loading';
enable_query_log;
#
@ -12,5 +12,5 @@ enable_query_log;
#
--require r/have_example_plugin.require
disable_query_log;
eval select LENGTH("$EXAMPLE_PLUGIN") > 0 as "have_example_plugin";
eval select LENGTH('$EXAMPLE_PLUGIN') > 0 as 'have_example_plugin';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_gb2312.require
disable_query_log;
show collation like "gb2312_chinese_ci";
show collation like 'gb2312_chinese_ci';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_gbk.require
disable_query_log;
show collation like "gbk_chinese_ci";
show collation like 'gbk_chinese_ci';
enable_query_log;

View File

@ -1,4 +1,4 @@
--require r/have_geometry.require
--disable_query_log
show variables like "have_geometry";
show variables like 'have_geometry';
--enable_query_log

View File

@ -1,4 +1,4 @@
-- require r/have_latin2_ch.require
disable_query_log;
show collation like "latin2_czech_cs";
show collation like 'latin2_czech_cs';
enable_query_log;

View File

@ -1,7 +1,6 @@
# ==== Purpose ====
#
# Ensure that the server is running with binlogging on and reset the
# binlog.
# Ensure that the server is running with binlogging on
#
# ==== Usage ====
#
@ -9,6 +8,5 @@
-- require r/have_log_bin.require
disable_query_log;
show variables like "log_bin";
RESET MASTER;
show variables like 'log_bin';
enable_query_log;

View File

@ -1,4 +1,4 @@
--require r/lowercase0.require
--disable_query_log
show variables like "lower_case_%";
show variables like 'lower_case_%';
--enable_query_log

View File

@ -1,4 +1,4 @@
--require r/have_ndbapi_examples.require
disable_query_log;
eval select LENGTH("$NDB_EXAMPLES_BINARY") > 0 as "have_ndb_example";
eval select LENGTH('$NDB_EXAMPLES_BINARY') > 0 as 'have_ndb_example';
enable_query_log;

View File

@ -1,5 +1,5 @@
-- require r/have_outfile.require
disable_query_log;
select load_file(concat(@tmpdir,"/outfile.test"));
select load_file(concat(@tmpdir,'/outfile.test'));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_partition.require
disable_query_log;
show variables like "have_partitioning";
show variables like 'have_partitioning';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_query_cache.require
disable_query_log;
show variables like "have_query_cache";
show variables like 'have_query_cache';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_sjis.require
disable_query_log;
show collation like "sjis_japanese_ci";
show collation like 'sjis_japanese_ci';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_ssl.require
disable_query_log;
show variables like "have_ssl";
show variables like 'have_ssl';
enable_query_log;

View File

@ -6,5 +6,5 @@
-- require r/have_symlink.require
disable_query_log;
show variables like "have_symlink";
show variables like 'have_symlink';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_tis620.require
disable_query_log;
show collation like "tis620_thai_ci";
show collation like 'tis620_thai_ci';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_ucs2.require
disable_query_log;
show collation like "ucs2_general_ci";
show collation like 'ucs2_general_ci';
enable_query_log;

View File

@ -4,7 +4,7 @@
#
--require r/have_dynamic_loading.require
disable_query_log;
show variables like "have_dynamic_loading";
show variables like 'have_dynamic_loading';
enable_query_log;
#
@ -12,5 +12,5 @@ enable_query_log;
#
--require r/have_udf_example.require
disable_query_log;
eval select LENGTH("$UDF_EXAMPLE_LIB") > 0 as "have_udf_example_lib";
eval select LENGTH('$UDF_EXAMPLE_LIB') > 0 as 'have_udf_example_lib';
enable_query_log;

View File

@ -1,4 +1,4 @@
-- require r/have_ujis.require
disable_query_log;
show collation like "ujis_japanese_ci";
show collation like 'ujis_japanese_ci';
enable_query_log;

View File

@ -1104,6 +1104,24 @@ set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
set global innodb_commit_concurrency=0;
set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
#
# Bug #37830: ORDER BY ASC/DESC - no difference
#
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
ENGINE=InnoDB;
INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
# should be range access
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
# should produce '8 7 6 5 4' for a
SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
DROP TABLE t1;
--echo End of 5.0 tests
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY

View File

@ -1,4 +1,4 @@
############## mysql-test\t\query_prealloc_size_basic.test ###############
################# mysql-test\t\query_prealloc_size_basic.test ##################
# #
# Variable Name: query_prealloc_size #
# Scope: GLOBAL | SESSION #
@ -18,10 +18,13 @@
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# Reference: #
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
# Last Modification: #
# 2008-07-14 hhunger removed values for 64 bit platforms. #
# #
################################################################################
--source include/load_sysvars.inc
@ -67,30 +70,32 @@ SELECT @@session.query_prealloc_size = 8192;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
##################################################################################
################################################################################
# Change the value of query_prealloc_size to a valid value for GLOBAL Scope #
##################################################################################
################################################################################
SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 4294967295;
SELECT @@global.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory.
#SET @@global.query_prealloc_size = 4294967295;
#SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ;
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###################################################################################
##################################################################################
# Change the value of query_prealloc_size to a valid value for SESSION Scope #
###################################################################################
##################################################################################
SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = 4294967295;
SELECT @@session.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory.
#SET @@session.query_prealloc_size = 4294967295;
#SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ;
@ -109,8 +114,9 @@ SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = -1024;
SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 429496729533;
SELECT @@global.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory.
#SET @@global.query_prealloc_size = 429496729533;
#SELECT @@global.query_prealloc_size ;
--Error ER_PARSE_ERROR
@ -188,18 +194,19 @@ SELECT @@global.query_prealloc_size ;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
####################################################################################
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
################################################################################
SET @@global.query_prealloc_size = 10;
SELECT @@query_prealloc_size = @@global.query_prealloc_size ;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
##############################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to #
# to the same session variable #
##############################################################################
SET @@query_prealloc_size = 100;
SELECT @@query_prealloc_size = @@local.query_prealloc_size ;
@ -207,9 +214,9 @@ SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
###################################################################################
################################################################################
# Check if query_prealloc_size can be accessed with and without @@ sign #
###################################################################################
################################################################################
SET query_prealloc_size = 1;
SELECT @@query_prealloc_size ;
@ -237,3 +244,4 @@ SELECT @@session.query_prealloc_size ;
#############################################################
# END OF query_prealloc_size TESTS #
#############################################################

View File

@ -0,0 +1,26 @@
# ==== Purpose ====
#
# Wait for slave SQL error, skip the erroneous statement and restart
# slave
#
# ==== Usage ====
#
# let show_sql_error=0|1;
# source include/wait_for_slave_sql_error_and_skip.inc;
echo --source include/wait_for_slave_sql_error_and_skip.inc;
connection slave;
source include/wait_for_slave_sql_error.inc;
if ($show_sql_error)
{
let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
echo Last_SQL_Error = $error;
}
# wait for SQL thread to stop after the error
source include/wait_for_slave_sql_to_stop.inc;
# skip the erroneous statement
set global sql_slave_skip_counter=1;
source include/start_slave.inc;
connection master;

View File

@ -148,13 +148,14 @@ my $opt_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
my $opt_record;
my $opt_report_features;
our $opt_check_testcases= 1;
my $opt_mark_progress;
my $opt_sleep;
my $opt_testcase_timeout= 15; # minutes
my $opt_suite_timeout = 180; # minutes
my $opt_suite_timeout = 300; # minutes
my $opt_shutdown_timeout= 10; # seconds
my $opt_start_timeout = 180; # seconds
@ -1662,7 +1663,8 @@ sub environment_setup {
# ----------------------------------------------------
my $file_mysql_fix_privilege_tables=
mtr_file_exists("$basedir/scripts/mysql_fix_privilege_tables.sql",
"$basedir/share/mysql_fix_privilege_tables.sql");
"$basedir/share/mysql_fix_privilege_tables.sql",
"$basedir/share/mysql/mysql_fix_privilege_tables.sql");
$ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
# ----------------------------------------------------
@ -2911,6 +2913,7 @@ sub run_testcase ($) {
if (defined $value){
mtr_verbose("Restoring $option to $value");
$ENV{$option}= $value;
} else {
mtr_verbose("Removing $option");
delete($ENV{$option});

View File

@ -1,5 +1,6 @@
set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
drop table if exists t1;
create table t1 (
`a&b` int,
`a<b` int,

View File

@ -45,7 +45,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';*' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*' at line 1
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!98765' AND b = 'bar'' at line 1
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*";

View File

@ -569,4 +569,10 @@ insert into t1 values (),(),(),(),(),(),(),(),(),();
select a from t1 where a not in (a,a,a) group by a;
a
drop table t1;
create table t1 (id int);
select * from t1 where NOT id in (select null union all select 1);
id
select * from t1 where NOT id in (null, 1);
id
drop table t1;
End of 5.1 tests

View File

@ -310,6 +310,20 @@ drop table t1;
SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
NAME_CONST('var', 'value') COLLATE latin1_general_cs
value
select @@session.time_zone into @save_tz;
set @@session.time_zone='UTC';
select uuid() into @my_uuid;
select mid(@my_uuid,15,1);
mid(@my_uuid,15,1)
1
select 24 * 60 * 60 * 1000 * 1000 * 10 into @my_uuid_one_day;
select concat('0',mid(@my_uuid,16,3),mid(@my_uuid,10,4),left(@my_uuid,8)) into @my_uuidate;
select floor(conv(@my_uuidate,16,10)/@my_uuid_one_day) into @my_uuid_date;
select 141427 + datediff(curdate(),'1970-01-01') into @my_uuid_synthetic;
select @my_uuid_date - @my_uuid_synthetic;
@my_uuid_date - @my_uuid_synthetic
0
set @@session.time_zone=@save_tz;
End of 5.0 tests
select connection_id() > 0;
connection_id() > 0

View File

@ -1,3 +1,5 @@
drop view if exists v1;
drop table if exists t1,t4;
create table t4 (
pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
) engine=innodb;
@ -70,3 +72,25 @@ explain select distinct f1, f2 from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
drop table t1;
create table t1(pk int primary key) engine=innodb;
create view v1 as select pk from t1 where pk < 20;
insert into t1 values (1), (2), (3), (4);
select distinct pk from v1;
pk
1
2
3
4
insert into t1 values (5), (6), (7);
select distinct pk from v1;
pk
1
2
3
4
5
6
7
drop view v1;
drop table t1;
End of 5.1 tests

View File

@ -1362,6 +1362,21 @@ set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
set global innodb_commit_concurrency=0;
set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
ENGINE=InnoDB;
INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index t1_b PRIMARY 4 NULL 8 Using where
SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
a b c
8 1 1
7 1 1
6 1 1
5 1 1
4 1 1
DROP TABLE t1;
End of 5.0 tests
CREATE TABLE `t2` (
`k` int(11) NOT NULL auto_increment,

View File

@ -1,6 +1,6 @@
** Setup **
SET @default_max_user_connections = @@max_user_connections;
SET @default_max_user_connections = @@global.max_user_connections;
Set Global max_user_connections=2;
'#--------------------FN_DYNVARS_114_01-------------------------#'
** Connecting conn1 using username 'root' **
@ -9,10 +9,11 @@ Set Global max_user_connections=2;
ERROR 42000: User root already has more than 'max_user_connections' active connections
Expected error "too many connections"
** Disconnecting conn1 **
** Poll till disconnected conn1 disappears from processlist
'#--------------------FN_DYNVARS_114_02-------------------------#'
Set Global max_user_connections=3;
** Connecting conn5 using username 'root' **
** Connecting conn6 using username 'root' **
** Connection default **
** Disconnecting conn5, conn6 **
SET GLOBAL max_user_connections = @default_max_user_connections;
SET @@global.max_user_connections = @default_max_user_connections;

View File

@ -627,7 +627,7 @@ a b
4 4
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 197
master-bin.000001 206
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
@ -637,7 +637,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 212
master-bin.000001 221
drop table t1, t2;
set @@session.binlog_format= @sav_binlog_format;
drop table if exists t1, t2, t3;

View File

@ -38,8 +38,6 @@ t2
t3
Tables_in_test
t1
delimiter
1
_
Test delimiter : from command line
a

View File

@ -1,3 +1,4 @@
reset master;
create table t1 (a int);
insert into t1 values (1);
insert into t1 values (2);

View File

@ -14,6 +14,7 @@ select otto from (select 1 as otto) as t1;
otto
1
mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22...
mysqltest: At line 1: expecting a SQL-state (00000) from query 'remove_file MYSQLTEST_VARDIR/tmp/test_nonexistent.tmp' which cannot produce one...
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22: 'Unknown column 'friedrich' in 'field list'', instead of 00000...
@ -723,6 +724,9 @@ drop table t1;
mysqltest: At line 1: change user failed: Unknown database 'inexistent'
mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO)
mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES)
file1.txt
file1.txt
file2.txt
SELECT 'c:\\a.txt' AS col;
col
z

View File

@ -284,6 +284,74 @@ Field Type Null Key Default Extra
DROP TABLE table_25930_a;
DROP TABLE table_25930_b;
SET @@sql_mode=@save_sql_mode;
DROP PROCEDURE IF EXISTS p26030;
select "non terminated"$$
non terminated
non terminated
select "terminated";$$
terminated
terminated
select "non terminated, space" $$
non terminated, space
non terminated, space
select "terminated, space"; $$
terminated, space
terminated, space
select "non terminated, comment" /* comment */$$
non terminated, comment
non terminated, comment
select "terminated, comment"; /* comment */$$
terminated, comment
terminated, comment
select "stmt 1";select "stmt 2 non terminated"$$
stmt 1
stmt 1
stmt 2 non terminated
stmt 2 non terminated
select "stmt 1";select "stmt 2 terminated";$$
stmt 1
stmt 1
stmt 2 terminated
stmt 2 terminated
select "stmt 1";select "stmt 2 non terminated, space" $$
stmt 1
stmt 1
stmt 2 non terminated, space
stmt 2 non terminated, space
select "stmt 1";select "stmt 2 terminated, space"; $$
stmt 1
stmt 1
stmt 2 terminated, space
stmt 2 terminated, space
select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$
stmt 1
stmt 1
stmt 2 non terminated, comment
stmt 2 non terminated, comment
select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$
stmt 1
stmt 1
stmt 2 terminated, comment
stmt 2 terminated, comment
select "stmt 1"; select "space, stmt 2"$$
stmt 1
stmt 1
space, stmt 2
space, stmt 2
select "stmt 1";/* comment */select "comment, stmt 2"$$
stmt 1
stmt 1
comment, stmt 2
comment, stmt 2
DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030()
$$
1
1
DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030()
$$
1
1
DROP PROCEDURE p26030;
select pi(3.14);
ERROR 42000: Incorrect parameter count in the call to native function 'pi'
select tan();

View File

@ -0,0 +1,306 @@
use test;
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
;
1
1
prepare stmt from
"
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
"
;
execute stmt;
1
1
drop view if exists view_overflow;
CREATE VIEW view_overflow AS
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
;
SELECT * from view_overflow;
1
1
drop view view_overflow;
drop procedure if exists proc_overflow;
CREATE PROCEDURE proc_overflow()
BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
select 1;
select 2;
select 3;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END $$
call proc_overflow();
1
1
2
2
3
3
drop procedure proc_overflow;
drop function if exists func_overflow;
create function func_overflow() returns int
BEGIN
DECLARE x int default 0;
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
SET x=x+1;
SET x=x+2;
SET x=x+3;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
return x;
END $$
select func_overflow();
func_overflow()
6
drop function func_overflow;
drop table if exists table_overflow;
create table table_overflow(a int, b int);
create trigger trigger_overflow before insert on table_overflow
for each row
BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
SET NEW.b := NEW.a;
SET NEW.b := NEW.b + 1;
SET NEW.b := NEW.b + 2;
SET NEW.b := NEW.b + 3;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END $$
insert into table_overflow set a=10;
insert into table_overflow set a=20;
select * from table_overflow;
a b
10 16
20 26
drop table table_overflow;
drop procedure if exists proc_35577;
CREATE PROCEDURE proc_35577()
BEGIN
DECLARE z_done INT DEFAULT 0;
DECLARE t_done VARCHAR(5000);
outer_loop: LOOP
IF t_done=1 THEN
LEAVE outer_loop;
END IF;
inner_block:BEGIN
DECLARE z_done INT DEFAULT 0;
SET z_done = 0;
inner_loop: LOOP
IF z_done=1 THEN
LEAVE inner_loop;
END IF;
IF (t_done = 'a') THEN
IF (t_done <> 0) THEN
IF ( t_done > 0) THEN
IF (t_done = 'a') THEN
SET t_done = 'a';
ELSEIF (t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
END IF;
END IF;
END IF;
END IF;
END LOOP inner_loop;
END inner_block;
END LOOP outer_loop;
END $$
drop procedure proc_35577;
drop procedure if exists p_37269;
create procedure p_37269()
begin
declare done int default 0;
declare varb int default 0;
declare vara int default 0;
repeat
select now();
until done end repeat;
while varb do
select now();
begin
select now();
repeat
select now();
until done end repeat;
if vara then
select now();
repeat
select now();
loop
select now();
end loop;
repeat
select now();
label1: while varb do
select now();
end while label1;
if vara then
select now();
repeat
select now();
until done end repeat;
begin
select now();
while varb do
select now();
label1: while varb do
select now();
end while label1;
if vara then
select now();
while varb do
select now();
loop
select now();
end loop;
repeat
select now();
loop
select now();
while varb do
select now();
end while;
repeat
select now();
label1: loop
select now();
if vara then
select now();
end if;
end loop label1;
until done end repeat;
end loop;
until done end repeat;
end while;
end if;
end while;
end;
end if;
until done end repeat;
until done end repeat;
end if;
end;
end while;
end $$
drop procedure p_37269;
drop procedure if exists p_37228;
create procedure p_37228 ()
BEGIN
DECLARE v INT DEFAULT 123;
IF (v > 1) THEN SET v = 1;
ELSEIF (v < 10) THEN SET v = 10;
ELSEIF (v < 11) THEN SET v = 11;
ELSEIF (v < 12) THEN SET v = 12;
ELSEIF (v < 13) THEN SET v = 13;
ELSEIF (v < 14) THEN SET v = 14;
ELSEIF (v < 15) THEN SET v = 15;
ELSEIF (v < 16) THEN SET v = 16;
ELSEIF (v < 17) THEN SET v = 17;
ELSEIF (v < 18) THEN SET v = 18;
ELSEIF (v < 19) THEN SET v = 19;
ELSEIF (v < 20) THEN SET v = 20;
ELSEIF (v < 21) THEN SET v = 21;
ELSEIF (v < 22) THEN SET v = 22;
ELSEIF (v < 23) THEN SET v = 23;
ELSEIF (v < 24) THEN SET v = 24;
ELSEIF (v < 25) THEN SET v = 25;
ELSEIF (v < 26) THEN SET v = 26;
ELSEIF (v < 27) THEN SET v = 27;
ELSEIF (v < 28) THEN SET v = 28;
ELSEIF (v < 29) THEN SET v = 29;
ELSEIF (v < 30) THEN SET v = 30;
ELSEIF (v < 31) THEN SET v = 31;
ELSEIF (v < 32) THEN SET v = 32;
ELSEIF (v < 33) THEN SET v = 33;
ELSEIF (v < 34) THEN SET v = 34;
ELSEIF (v < 35) THEN SET v = 35;
ELSEIF (v < 36) THEN SET v = 36;
ELSEIF (v < 37) THEN SET v = 37;
ELSEIF (v < 38) THEN SET v = 38;
ELSEIF (v < 39) THEN SET v = 39;
END IF;
END $$
drop procedure p_37228;

View File

@ -1131,7 +1131,7 @@ NULL
2
explain partitions select * from t1 where a is null or a < 0 or a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 4 Using where
drop table t1;
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20))
ENGINE=MyISAM DEFAULT CHARSET=latin1

View File

@ -69,25 +69,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a is null or (a >= 5 and a <= 7);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 7 Using where
1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a is not null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 1 and a < 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 5 Using where
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 3 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 4 Using where
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a > 2 and a < 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a > 3 and a <= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 4 Using where
1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a > 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where

View File

@ -31,7 +31,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t2 where a=1 and b=1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 3 Using where
create table t3 (
a int
)
@ -89,25 +89,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions select * from t5
where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t5 where (a=10 and b=2) or (a=10 and b=3)
or (a=10 and b = 4);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t5 where (c=1 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t5 where (c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
(c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
(b=2 and c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
create table t6 (a int not null) partition by LIST(a) (
partition p1 values in (1),
partition p3 values in (3),
@ -145,7 +145,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1
explain partitions select * from t6 where a >= 3 and a <= 8;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t6 where a > 3 and a < 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@ -187,7 +187,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1
explain partitions select * from t6 where a >= 3 and a <= 8;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t6 where a > 3 and a < 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@ -342,7 +342,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions
select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE X p1,p2 ALL a NULL NULL NULL 2 Using where
1 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where
1 SIMPLE Y p1,p2 ref a a 4 test.X.a 2
drop table t1;
create table t1 (a int) partition by hash(a) partitions 20;
@ -355,7 +355,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a > 1 and a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1 where a >= 1 and a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2,p3 ALL NULL NULL NULL NULL 3 Using where
@ -445,22 +445,22 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010
explain partitions select * from t2 where a < 801 and a > 200;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 800 Using where
1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
explain partitions select * from t2 where a < 801 and a > 800;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where
1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 1010 Using where
explain partitions select * from t2 where a > 600;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
explain partitions select * from t2 where a > 600 and b = 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
explain partitions select * from t2 where a > 600 and b = 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
explain partitions select * from t2 where a > 600 and b = 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
explain partitions select * from t2 where b = 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
@ -515,19 +515,19 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 910
explain partitions select * from t2 where a = 101;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 110 Using where
1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 910 Using where
explain partitions select * from t2 where a = 550;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 200 Using where
1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 910 Using where
explain partitions select * from t2 where a = 833;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where
1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 910 Using where
explain partitions select * from t2 where (a = 100 OR a = 900);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 310 Using where
1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 910 Using where
explain partitions select * from t2 where (a > 100 AND a < 600);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3 ALL NULL NULL NULL NULL 710 Using where
1 SIMPLE t2 p0,p1,p2,p3 ALL NULL NULL NULL NULL 910 Using where
explain partitions select * from t2 where b = 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ref b b 5 const 76 Using where
@ -813,17 +813,17 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions select * from t1
where a >= 18446744073709551000-1 and a <= 18446744073709551000+1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1
where a between 18446744073709551001 and 18446744073709551002;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a = 18446744073709551000;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a = 18446744073709551613;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a = 18446744073709551614;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@ -850,10 +850,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a=0xFE;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t2 where a=0xFE;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@ -862,22 +862,22 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a < 64 AND a >= 63;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t2 where a < 64 AND a >= 63;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a <= 64 AND a >= 63;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 6 Using where
explain partitions select * from t2 where a <= 64 AND a >= 63;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 4 Using where
1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 6 Using where
drop table t1;
drop table t2;
create table t1(a bigint unsigned not null) partition by range(a+0) (

View File

@ -57,13 +57,13 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull system NULL NULL NULL NULL 1
explain partitions select * from t1 where a >= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1 where a < 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
explain partitions select * from t1 where a <= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1 where a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@ -96,16 +96,16 @@ select * from t1 where a > 1;
a b
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
explain partitions select * from t1 where a >= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 6 Using where
explain partitions select * from t1 where a < 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
explain partitions select * from t1 where a <= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 6 Using where
explain partitions select * from t1 where a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables

View File

@ -85,9 +85,9 @@ NULL
NULL
NULL
prepare stmt6 from 'select 1; select2';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1
prepare stmt6 from 'insert into t1 values (5,"five"); select2';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1
explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1
create table t2

View File

@ -290,7 +290,7 @@ SUCCESS
# Test 7-b: dependent FUNCTION has changed
#
# Note, this scenario is not supported, subject of Bug#12093
# Note, this scenario is supported, subject of Bug#12093
#
drop trigger t1_ai;
create trigger t1_ai after insert on t1 for each row
@ -305,8 +305,7 @@ select @var;
drop function f1;
create function f1 (a int) returns int return 0;
execute stmt using @var;
ERROR 42000: FUNCTION test.f1 does not exist
call p_verify_reprepare_count(0);
call p_verify_reprepare_count(1);
SUCCESS
drop function f1;
@ -359,8 +358,14 @@ a
drop view v1;
create view v1 as select a from t2;
set @var=8;
# XXX: bug, the SQL statement in the trigger is still
# pointing at table 't3', since the view was expanded
# at first statement execution.
# Repreparation of the main statement doesn't cause repreparation
# of trigger statements.
execute stmt using @var;
call p_verify_reprepare_count(0);
ERROR 42S02: Table 'test.t3' doesn't exist
call p_verify_reprepare_count(1);
SUCCESS
#
@ -377,7 +382,6 @@ select * from t3;
a
6
7
8
flush table t1;
set @var=9;
execute stmt using @var;
@ -392,7 +396,6 @@ select * from t3;
a
6
7
8
drop view v1;
drop table t1,t2,t3;
# Test 7-d: dependent TABLE has changed
@ -798,14 +801,17 @@ SUCCESS
drop function f1;
create function f1() returns int return 2;
# XXX: Bug#12093. We only get a different error
# XXX: Used to be another manifestation of Bug#12093.
# We only used to get a different error
# message because the non-existing procedure error is masked
# by the view.
execute stmt;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
f1()
2
execute stmt;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
call p_verify_reprepare_count(0);
f1()
2
call p_verify_reprepare_count(1);
SUCCESS
# Part 18b: dependent procedure has changed (referred to via a function)
@ -831,19 +837,20 @@ SUCCESS
drop procedure p1;
create procedure p1(out x int) select max(a) from t2 into x;
# XXX: bug. The prelocked list is not invalidated
# and we keep opening table t1, whereas the procedure
# XXX: used to be a bug. The prelocked list was not invalidated
# and we kept opening table t1, whereas the procedure
# is now referring to table t2
execute stmt;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
call p_verify_reprepare_count(0);
f1()
6
call p_verify_reprepare_count(1);
SUCCESS
flush table t1;
execute stmt;
f1()
6
call p_verify_reprepare_count(1);
call p_verify_reprepare_count(0);
SUCCESS
execute stmt;
@ -1528,7 +1535,6 @@ drop view v_27690_1;
drop table v_27690_2;
deallocate prepare stmt;
#=====================================================================
# TODO: fix the below two bugs and modify their tests
#
# Bug#21294 Executing a prepared statement that executes
# a stored function which was recreat
@ -1541,12 +1547,14 @@ f1()
drop function f1;
create function f1() returns int return 10;
execute stmt;
ERROR 42000: FUNCTION test.f1 does not exist
f1()
10
drop function f1;
create function f1() returns int return 20;
execute stmt;
ERROR 42000: FUNCTION test.f1 does not exist
call p_verify_reprepare_count(0);
f1()
20
call p_verify_reprepare_count(2);
SUCCESS
drop function f1;
@ -1573,19 +1581,21 @@ execute stmt_sp;
a
drop function f_12093_unrelated;
drop procedure p_12093_unrelated;
# XXX: bug
# XXX: used to be a bug
execute stmt_sf;
ERROR 42000: FUNCTION test.f_12093 does not exist
# XXX: bug
f_12093()
0
# XXX: used to be a bug
execute stmt_sp;
ERROR 42000: PROCEDURE test.p_12093 does not exist
# XXX: bug
a
# XXX: used to be a bug
execute stmt_sf;
ERROR 42000: FUNCTION test.f_12093 does not exist
# XXX: bug
f_12093()
0
# XXX: used to be a bug
execute stmt_sp;
ERROR 42000: PROCEDURE test.p_12093 does not exist
call p_verify_reprepare_count(0);
a
call p_verify_reprepare_count(2);
SUCCESS
drop table t_12093;

View File

@ -460,7 +460,7 @@ create schema mysqltest;
end|
execute stmt;
ERROR 42000: PROCEDURE test.p1 does not exist
call p_verify_reprepare_count(0);
call p_verify_reprepare_count(1);
SUCCESS
execute stmt;

View File

@ -35,10 +35,6 @@ SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
SET @@global.query_prealloc_size = 4294967295;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
@ -48,10 +44,6 @@ SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
8192
SET @@session.query_prealloc_size = 4294967295;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
4294966272
SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
@ -69,37 +61,31 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
SET @@global.query_prealloc_size = 429496729533;
Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '429496729533'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
SET @@global.query_prealloc_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
8192
SET @@global.query_prealloc_size = test;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
8192
SET @@global.query_prealloc_size = "test";
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
8192
SET @@global.query_prealloc_size = 'test';
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
8192
SET @@global.query_prealloc_size = ON;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
8192
SET @@session.query_prealloc_size = 0;
Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '0'

View File

@ -35,10 +35,6 @@ SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
SET @@global.query_prealloc_size = 4294967295;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
4294966272
SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
@ -48,10 +44,6 @@ SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
8192
SET @@session.query_prealloc_size = 4294967295;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
4294966272
SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ;
@@session.query_prealloc_size
@ -69,35 +61,31 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '0'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
8192
SET @@global.query_prealloc_size = 429496729533;
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
429496728576
SET @@global.query_prealloc_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
429496728576
8192
SET @@global.query_prealloc_size = test;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
429496728576
8192
SET @@global.query_prealloc_size = "test";
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
429496728576
8192
SET @@global.query_prealloc_size = 'test';
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
429496728576
8192
SET @@global.query_prealloc_size = ON;
ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
SELECT @@global.query_prealloc_size ;
@@global.query_prealloc_size
429496728576
8192
SET @@session.query_prealloc_size = 0;
Warnings:
Warning 1292 Truncated incorrect query_prealloc_size value: '0'

View File

@ -797,7 +797,7 @@ bug11834_2()
10
drop function bug11834_1;
execute stmt;
ERROR 42000: FUNCTION test.bug11834_2 does not exist
ERROR 42000: FUNCTION test.bug11834_1 does not exist
deallocate prepare stmt;
drop function bug11834_2;
DROP FUNCTION IF EXISTS bug12953|
@ -1046,7 +1046,8 @@ select bug12329();
bug12329()
101
execute stmt1;
ERROR 42S02: Table 'test.t2' doesn't exist
bug12329()
101
deallocate prepare stmt1;
drop function bug12329;
drop table t1, t2;

View File

@ -4398,3 +4398,4 @@ INSERT INTO t1 VALUES (1), (3);
SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
a b
DROP TABLE t1,t2;
End of 5.0 tests.

View File

@ -0,0 +1,12 @@
CREATE TABLE t1(id INT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d;
SET SESSION debug="d,subselect_exec_fail";
SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1;
SUM(EXISTS(SELECT RAND() FROM t1))
0
SELECT REVERSE(EXISTS(SELECT RAND() FROM t1));
REVERSE(EXISTS(SELECT RAND() FROM t1))
0
SET SESSION debug=DEFAULT;
DROP TABLE t1;

View File

@ -95,3 +95,34 @@ table_28127_b CREATE TABLE `table_28127_b` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table table_28127_a;
drop table table_28127_b;
select 0b01000001;
0b01000001
A
select 0x41;
0x41
A
select b'01000001';
b'01000001'
A
select x'41', 0+x'41';
x'41' 0+x'41'
A 65
select N'abc', length(N'abc');
abc length(N'abc')
abc 3
select N'', length(N'');
length(N'')
0
select '', length('');
length('')
0
select b'', 0+b'';
b'' 0+b''
0
select x'', 0+x'';
x'' 0+x''
0
select 0x;
ERROR 42S22: Unknown column '0x' in 'field list'
select 0b;
ERROR 42S22: Unknown column '0b' in 'field list'

View File

@ -66,4 +66,28 @@ a
1
1
3
drop table t1;
CREATE TABLE char128_utf8 (
i1 INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
CREATE TABLE char63_utf8 (
i1 INT NOT NULL,
c CHAR(63) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
BINLOG '
MuNkSA8BAAAAZgAAAGoAAAAAAAQANS4xLjI1LXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAy42RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
';
BINLOG '
3u9kSBMBAAAANgAAAJYBAAAAABAAAAAAAAAABHRlc3QAC2NoYXI2M191dGY4AAMD/gMC/r0A
3u9kSBcBAAAAKgAAAMABAAAQABAAAAAAAAEAA//4AQAAAAMxMjMBAAAA
';
SELECT * FROM char63_utf8;
i1 c i2
1 123 1
BINLOG '
iONkSBMBAAAANwAAAJkBAAAAABAAAAAAAAAABHRlc3QADGNoYXIxMjhfdXRmOAADA/4DAv6AAA==
iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
';
ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info
drop table t1, char63_utf8, char128_utf8;

View File

@ -104,6 +104,49 @@ Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
# the above line should fail and 5 should not be in the binlog.
select * from t1;
# Test that BUG#37426 is triggered.
# clean up
drop table t1;
CREATE TABLE char128_utf8 (
i1 INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
CREATE TABLE char63_utf8 (
i1 INT NOT NULL,
c CHAR(63) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
#
# This is the format description log event
#
BINLOG '
MuNkSA8BAAAAZgAAAGoAAAAAAAQANS4xLjI1LXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAy42RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
';
# ... this event corresponding to
#
# INSERT INTO char63_utf8 VALUES ( 1, "123", 1 )
#
# The binlog event below shall not trigger the bug check
BINLOG '
3u9kSBMBAAAANgAAAJYBAAAAABAAAAAAAAAABHRlc3QAC2NoYXI2M191dGY4AAMD/gMC/r0A
3u9kSBcBAAAAKgAAAMABAAAQABAAAAAAAAEAA//4AQAAAAMxMjMBAAAA
';
SELECT * FROM char63_utf8;
# ... and this is an event corresponding to
#
# INSERT INTO char128_utf8 VALUES ( 1, "123", 1 )
#
# The binlog event below shall trigger the bug check and produce an error
#
error ER_UNKNOWN_ERROR;
BINLOG '
iONkSBMBAAAANwAAAJkBAAAAABAAAAAAAAAABHRlc3QADGNoYXIxMjhfdXRmOAADA/4DAv6AAA==
iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
';
drop table t1, char63_utf8, char128_utf8;

View File

@ -0,0 +1,8 @@
[row]
--binlog-format=row
[stmt]
--binlog-format=statement
[mix]
--binlog-format=mixed

View File

@ -0,0 +1,17 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE char128_utf8 (
i1 INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
SELECT * FROM char128_utf8;
i1 c i2
1 123 1
SELECT * FROM char128_utf8;
i1 c i2
1 123 1

View File

@ -0,0 +1,22 @@
#############################################################
# Author: Mats Kindahl <mats@mysql.com>
# Date: 2008-06-18
# Purpose: Test for BUG#37426
# RBR breaks for CHAR() UTF8 fields > 85 chars
#############################################################
source include/master-slave.inc;
source include/have_binlog_format_row.inc;
connection master;
CREATE TABLE char128_utf8 (
i1 INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
SELECT * FROM char128_utf8;
sync_slave_with_master;
SELECT * FROM char128_utf8;

View File

@ -3635,13 +3635,9 @@ SELECT count(*) into cnt from t2;
set @count = cnt;
SELECT @count;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
set @count = cnt;
SELECT @count;
END' at line 2
ERROR 42S22: Unknown column 'cnt' in 'field list'
CALL sp1( 10 );
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
DROP PROCEDURE IF EXISTS sp1;
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( cnt int(20) )
END
SELECT count(*) into cnt from t2;

View File

@ -3636,13 +3636,9 @@ SELECT count(*) into cnt from t2;
set @count = cnt;
SELECT @count;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
set @count = cnt;
SELECT @count;
END' at line 2
ERROR 42S22: Unknown column 'cnt' in 'field list'
CALL sp1( 10 );
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
DROP PROCEDURE IF EXISTS sp1;
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( cnt int(20) )
END
SELECT count(*) into cnt from t2;

View File

@ -3636,13 +3636,9 @@ SELECT count(*) into cnt from t2;
set @count = cnt;
SELECT @count;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
set @count = cnt;
SELECT @count;
END' at line 2
ERROR 42S22: Unknown column 'cnt' in 'field list'
CALL sp1( 10 );
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
DROP PROCEDURE IF EXISTS sp1;
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( cnt int(20) )
END
SELECT count(*) into cnt from t2;

View File

@ -3635,13 +3635,9 @@ SELECT count(*) into cnt from t2;
set @count = cnt;
SELECT @count;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
set @count = cnt;
SELECT @count;
END' at line 2
ERROR 42S22: Unknown column 'cnt' in 'field list'
CALL sp1( 10 );
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
DROP PROCEDURE IF EXISTS sp1;
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( cnt int(20) )
END
SELECT count(*) into cnt from t2;

View File

@ -2862,8 +2862,20 @@ DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
# missing BEGIN
# PLEASE NOTE:
# this test client has the MULTI_QUERY capability,
# so that the following request (starting at 'CREATE' and ending at the //
# delimiter) is interpreted as follows:
# 1) it's a multi query
# 2) the first query is a valid CREATE PROCEDURE statement, and the
# procedure consist of only one SELECT statement
# 3) the second query is a SET statement, which is broken since it's
# referencing an unknown column 'cnt'
# 4) the next query (SELECT @count) is not parsed or executed, since 3)
# failed
delimiter //;
--error ER_PARSE_ERROR
--error ER_BAD_FIELD_ERROR
CREATE PROCEDURE sp1( cnt int(20) )
SELECT count(*) into cnt from t2;
set @count = cnt;
@ -2871,11 +2883,10 @@ CREATE PROCEDURE sp1( cnt int(20) )
END//
delimiter ;//
--error ER_SP_DOES_NOT_EXIST
CALL sp1( 10 );
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
DROP PROCEDURE sp1;
--enable_warnings
# wrong order of BEGIN and END

View File

@ -10,11 +10,6 @@
# 2008-06-06 mleich Create this this variant for the embedded server.
#
let $value= query_get_value(SHOW VARIABLES LIKE 'version_compile_os',Value,1);
if (`SELECT '$value' LIKE 'apple-darwin%'`)
{
skip Bug#37380 Test funcs_1.is_columns_myisam_embedded fails on OS X;
}
if (`SELECT VERSION() NOT LIKE '%embedded%'`)
{
--skip Test requires: embedded server

View File

@ -13,6 +13,13 @@
USE test;
--source suite/funcs_1/include/tb3.inc
# This test cannot be used for the embedded server because we check here
# privilgeges.
--source include/not_embedded.inc
USE test;
--source suite/funcs_1/include/tb3.inc
--disable_abort_on_error
###########################################

View File

@ -8,6 +8,9 @@
USE test;
--source suite/funcs_1/include/tb3.inc
USE test;
--source suite/funcs_1/include/tb3.inc
# General setup for Trigger tests
let $message= Testcase: 3.5:;
--source include/show_msg.inc

View File

@ -13,6 +13,14 @@ eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
USE test;
--source suite/funcs_1/include/tb3.inc
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
--disable_abort_on_error
##############################################

View File

@ -1,14 +1,96 @@
#################################################################################
# Author: Serge Kozlov #
# Date: 09/21/2005 #
# Date: 2005-09-21 #
# Purpose: used by ../t/*_charset.test #
# Require: set $engine_type= [NDB,MyISAM,InnoDB,etc] before calling #
# #
# Last modification: Matthias Leich #
# Date: 2008-07-02 #
# Purpose: Fix Bug#37160 funcs_2: The tests do not check if optional character #
# sets exist. #
# Add checking of prerequisites + minor cleanup #
#################################################################################
#
#
#
# Check that all character sets needed are available
# Note(mleich):
# It is intentional that the common solution with
# "--source include/have_<character set>.inc"
# is not applied.
# - We currently do not have such a prerequisite test for every character set
# /collation needed.
# - There is also no real value in mentioning the first missing character set
# /collation within the "skip message" because it is most probably only
# one of many.
#
# Hint: 5 character_set_names per source line if possible
if (`SELECT COUNT(*) <> 36 FROM information_schema.character_sets
WHERE CHARACTER_SET_NAME IN (
'armscii8', 'ascii' , 'big5' , 'binary' , 'cp1250',
'cp1251' , 'cp1256' , 'cp1257' , 'cp850' , 'cp852' ,
'cp866' , 'cp932' , 'dec8' , 'eucjpms', 'euckr' ,
'gb2312' , 'gbk' , 'geostd8', 'greek' , 'hebrew',
'hp8' , 'keybcs2', 'koi8r' , 'koi8u' , 'latin1',
'latin2' , 'latin5' , 'latin7' , 'macce' , 'macroman',
'sjis' , 'swe7' , 'tis620' , 'ucs2' , 'ujis',
'utf8'
)`)
{
--skip Not all character sets required for this test are present
}
# Check that all collations needed are available
# Hint: 4 collation_names per source line if possible
if (`SELECT COUNT(*) <> 123 FROM information_schema.collations
WHERE collation_name IN (
'armscii8_bin', 'armscii8_general_ci', 'ascii_bin', 'ascii_general_ci',
'big5_bin', 'big5_chinese_ci', 'cp1250_bin', 'cp1250_croatian_ci',
'cp1250_czech_cs', 'cp1250_general_ci', 'cp1251_bin', 'cp1251_bulgarian_ci',
'cp1251_general_ci', 'cp1251_general_cs', 'cp1251_ukrainian_ci', 'cp1256_bin',
'cp1256_general_ci', 'cp1257_bin', 'cp1257_general_ci', 'cp1257_lithuanian_ci',
'cp850_bin', 'cp850_general_ci', 'cp852_bin', 'cp852_general_ci',
'cp866_bin', 'cp866_general_ci', 'cp932_bin', 'cp932_japanese_ci',
'dec8_bin', 'dec8_swedish_ci', 'eucjpms_bin', 'eucjpms_japanese_ci',
'euckr_bin', 'euckr_korean_ci', 'gb2312_bin', 'gb2312_chinese_ci',
'gbk_bin', 'gbk_chinese_ci', 'geostd8_bin', 'geostd8_general_ci',
'greek_bin', 'greek_general_ci', 'hebrew_bin', 'hebrew_general_ci',
'hp8_bin', 'hp8_english_ci', 'keybcs2_bin', 'keybcs2_general_ci',
'koi8r_bin', 'koi8r_general_ci', 'koi8u_bin', 'koi8u_general_ci',
'latin1_bin', 'latin1_danish_ci', 'latin1_general_ci', 'latin1_general_cs',
'latin1_german1_ci', 'latin1_german2_ci', 'latin1_spanish_ci', 'latin1_swedish_ci',
'latin2_bin', 'latin2_croatian_ci', 'latin2_czech_cs', 'latin2_general_ci',
'latin2_hungarian_ci', 'latin5_bin', 'latin5_turkish_ci', 'latin7_bin',
'latin7_estonian_cs', 'latin7_general_ci', 'latin7_general_cs', 'macce_bin',
'macce_general_ci', 'macroman_bin', 'macroman_general_ci', 'sjis_bin',
'sjis_japanese_ci', 'swe7_bin', 'swe7_swedish_ci', 'tis620_bin',
'tis620_thai_ci', 'ucs2_bin', 'ucs2_czech_ci', 'ucs2_danish_ci',
'ucs2_estonian_ci', 'ucs2_general_ci', 'ucs2_hungarian_ci', 'ucs2_icelandic_ci',
'ucs2_latvian_ci', 'ucs2_lithuanian_ci', 'ucs2_persian_ci', 'ucs2_polish_ci',
'ucs2_roman_ci', 'ucs2_romanian_ci', 'ucs2_slovak_ci', 'ucs2_slovenian_ci',
'ucs2_spanish2_ci', 'ucs2_spanish_ci', 'ucs2_swedish_ci', 'ucs2_turkish_ci',
'ucs2_unicode_ci', 'ujis_bin', 'ujis_japanese_ci', 'utf8_bin',
'utf8_czech_ci', 'utf8_danish_ci', 'utf8_estonian_ci', 'utf8_general_ci',
'utf8_hungarian_ci', 'utf8_icelandic_ci', 'utf8_latvian_ci', 'utf8_lithuanian_ci',
'utf8_persian_ci', 'utf8_polish_ci', 'utf8_roman_ci', 'utf8_romanian_ci',
'utf8_slovak_ci', 'utf8_slovenian_ci', 'utf8_spanish2_ci', 'utf8_spanish_ci',
'utf8_swedish_ci', 'utf8_turkish_ci', 'utf8_unicode_ci'
)`)
{
--skip Not all collations required for this test are present
}
################################
let $check_std_csets= 1;
let $check_ucs2_csets= 1;
let $check_utf8_csets= 1;
#
# Check all charsets/collation combinations
#
################################
let $check_std_csets= 1;
let $check_ucs2_csets= 1;
let $check_utf8_csets= 1;

View File

@ -1,8 +1,10 @@
#################################################################################
################################################################################
# Author: Serge Kozlov #
# Date: 09/21/2005 #
# Date: 2005-09-21 #
# Purpose: Testing the charsets for InnoDB engine #
#################################################################################
# #
# Checking of other prerequisites is in charset_master.test #
################################################################################
--source include/have_innodb.inc

View File

@ -1,8 +1,10 @@
#################################################################################
################################################################################
# Author: Serge Kozlov #
# Date: 09/21/2005 #
# Date: 2005-09-21 #
# Purpose: Testing the charsets for Memory engine #
#################################################################################
# #
# Checking of other prerequisites is in charset_master.test #
################################################################################
let $engine_type= Memory;
--source suite/funcs_2/charset/charset_master.test

View File

@ -1,8 +1,10 @@
#################################################################################
################################################################################
# Author: Serge Kozlov #
# Date: 09/21/2005 #
# Date: 2005-09-21 #
# Purpose: Testing the charsets for MyISAM engine #
#################################################################################
# #
# Checking of other prerequisites is in charset_master.test #
################################################################################
let $engine_type= MyISAM;
--source suite/funcs_2/charset/charset_master.test

View File

@ -1,8 +1,10 @@
#################################################################################
################################################################################
# Author: Serge Kozlov #
# Date: 09/21/2005 #
# Purpose: Testing the charsets for NDB engine #
#################################################################################
# #
# Checking of other prerequisites is in charset_master.test #
################################################################################
--source include/have_ndb.inc
--source include/not_embedded.inc

View File

@ -12,5 +12,6 @@
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
ndb_index_ordered : Bug#38370 The test ndb.ndb_index_ordered fails with the community features on
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open

View File

@ -43,6 +43,8 @@ eval select * from $t4 order by colint;
eval select * from $t5 order by colint;
eval select * from $t6 order by colint;
if (!$drop_partition_not_supported)
{
eval alter table $t1 drop partition p0;
eval alter table $t2 drop partition p0;
eval alter table $t4 drop partition p0;
@ -55,3 +57,4 @@ eval select * from $t3 order by col1;
eval select * from $t4 order by colint;
eval select * from $t5 order by colint;
eval select * from $t6 order by colint;
}

View File

@ -92,16 +92,13 @@ $partitioning;
#----------- PARTITION BY RANGE
if ($with_partitioning)
{
--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1)
let $partitioning= PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN ($max_row_div4),
PARTITION partc VALUES LESS THAN ($max_row_div2),
PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4),
PARTITION parte VALUES LESS THAN ($max_row),
PARTITION partf VALUES LESS THAN $MAX_VALUE)';
let $partitioning= `SELECT @aux`;
--enable_query_log
PARTITION partf VALUES LESS THAN $MAX_VALUE);
}
eval CREATE TABLE t1 (
$column_list
@ -113,15 +110,11 @@ $partitioning;
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
let $partitioning= PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN ($max_row_div4),
PARTITION partc VALUES LESS THAN ($max_row_div2),
PARTITION partd VALUES LESS THAN $MAX_VALUE)';
let $partitioning= `SELECT @aux`;
--enable_query_log
PARTITION partd VALUES LESS THAN $MAX_VALUE);
}
eval CREATE TABLE t1 (
$column_list
@ -133,8 +126,7 @@ $partitioning;
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
if ($with_partitioning)
{
--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN ($max_row_div4)
@ -142,9 +134,7 @@ PARTITION part2 VALUES LESS THAN ($max_row_div4)
PARTITION part3 VALUES LESS THAN ($max_row_div2)
(SUBPARTITION subpart31, SUBPARTITION subpart32),
PARTITION part4 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart41, SUBPARTITION subpart42))';
let $partitioning= `SELECT @aux`;
--enable_query_log
(SUBPARTITION subpart41, SUBPARTITION subpart42));
}
eval CREATE TABLE t1 (
$column_list
@ -176,15 +166,11 @@ $partitioning;
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,2)))
let $partitioning= PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL))';
let $partitioning= `SELECT @aux`;
--enable_query_log
PARTITION part3 VALUES IN (NULL));
}
eval CREATE TABLE t1 (
$column_list

View File

@ -6,22 +6,27 @@ partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
show create table t1;
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535);
--sorted_result
select * from t1;
select * from t1 where a=-2;
delete from t1 where a=-2;
--sorted_result
select * from t1;
select * from t1 where a=18446744073709551615;
delete from t1 where a=18446744073709551615;
--sorted_result
select * from t1;
drop table t1;
eval create table t2 (a bigint unsigned not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
partition by key (a) partitions 8;
show create table t2;
insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
--sorted_result
select * from t2;
select * from t2 where a=18446744073709551615;
delete from t2 where a=18446744073709551615;
--sorted_result
select * from t2;
delete from t2;
let $count=$maxrows;
@ -37,11 +42,13 @@ select count(*) from t2;
drop table t2;
eval create table t3 (a bigint not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
partition by key (a) partitions 7;
show create table t3;
insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0);
--sorted_result
select * from t3;
select * from t3 where a=9223372036854775806;
delete from t3 where a=9223372036854775806;
--sorted_result
select * from t3;
drop table t3;

View File

@ -11,9 +11,6 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-05-12 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
if ($no_debug)
@ -27,25 +24,29 @@ let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
if ($do_file_tests)
{
let $ls_file= $MYSQLD_DATADIR/test/tmp2;
# List the files belonging to the table t1
--exec ls $MYSQLD_DATADIR/test/t1* > $MYSQLD_DATADIR/test/tmp2 || true
--list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
--chmod 0644 $ls_file
if ($with_directories)
{
--exec ls $MYSQLTEST_VARDIR/tmp/t1* >> $MYSQLD_DATADIR/test/tmp2 || true
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1*
}
eval SET @aux = CONCAT('load_file(''$MYSQLD_DATADIR','/test/tmp2'')');
let $file_list= `SELECT @aux`;
eval SET @aux = load_file('$ls_file');
# clean up
remove_file $ls_file;
}
if (!$do_file_tests)
{
let $file_list= '--- not determined ---';
SET @aux = '--- not determined ---';
}
# UPDATE the current filelist of the table t1 within t0_definition
# Note: This list should be empty, because the table t1 was dropped !
eval INSERT INTO t0_definition SET state = 'old', file_list = $file_list
ON DUPLICATE KEY UPDATE file_list = $file_list;
# eval UPDATE t0_definition SET file_list = $file_list WHERE state = 'old';
eval INSERT INTO t0_definition SET state = 'old', file_list = @aux
ON DUPLICATE KEY UPDATE file_list = @aux;
# eval UPDATE t0_definition SET file_list = @aux WHERE state = 'old';
# Check if filelist is empty.
let $found_garbage= `SELECT file_list <> '' FROM t0_definition WHERE state = 'old'`;

View File

@ -6,19 +6,23 @@ partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
show create table t1;
insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535);
--sorted_result
select * from t1;
select * from t1 where a=4294967293;
delete from t1 where a=4294967293;
--sorted_result
select * from t1;
drop table t1;
eval create table t2 (a int unsigned not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
partition by key (a) partitions 8;
show create table t2;
insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292);
--sorted_result
select * from t2;
select * from t2 where a=4294967293;
delete from t2 where a=4294967293;
--sorted_result
select * from t2;
delete from t2;
let $count=$maxrows;
@ -34,11 +38,13 @@ select count(*) from t2;
drop table t2;
eval create table t3 (a int not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
partition by key (a) partitions 7;
show create table t3;
insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0);
--sorted_result
select * from t3;
select * from t3 where a=2147483645;
delete from t3 where a=2147483645;
--sorted_result
select * from t3;
drop table t3;

View File

@ -11,5 +11,5 @@ if ($ls)
{
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--exec ls $MYSQLD_DATADIR/test/t1*
--list_files $MYSQLD_DATADIR/test t1*
}

View File

@ -37,17 +37,16 @@ let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT
let $show_file= $MYSQLD_DATADIR/test/tmp1;
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $show_file 2>&1 || true
if ($do_file_tests)
{
# List the files belonging to the table t1
let $ls_file= $MYSQLD_DATADIR/test/tmp2;
let $err_file= $MYSQLD_DATADIR/test/err2;
--exec ls $MYSQLD_DATADIR/test/t1* > $ls_file 2>$err_file || true
--list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
--chmod 0644 $ls_file
if ($with_directories)
{
--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true
--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1*
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
}
eval SET @aux = load_file('$ls_file');
}

View File

@ -14,9 +14,6 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
if ($no_debug)
@ -39,12 +36,12 @@ if ($do_file_tests)
{
# List the files belonging to the table t1
let $ls_file= $MYSQLD_DATADIR/test/tmp2;
let $err_file= $MYSQLD_DATADIR/test/err2;
--exec ls $MYSQLD_DATADIR/test/t1* > $ls_file 2>$err_file || true
--list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
--chmod 0644 $ls_file
if ($with_directories)
{
--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true
--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1*
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
}
eval SET @aux = load_file('$ls_file');
}

View File

@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
show create table t1;
insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535);
--sorted_result
select * from t1;
select * from t1 where a=16777213;
delete from t1 where a=16777213;
--sorted_result
select * from t1;
drop table t1;
@ -16,9 +18,11 @@ eval create table t2 (a mediumint unsigned not null, primary key(a)) engine=$eng
partition by key (a) partitions 8;
show create table t2;
insert into t2 values (16777215), (16777214), (16777213), (16777212);
--sorted_result
select * from t2;
select * from t2 where a=16777213;
delete from t2 where a=16777213;
--sorted_result
select * from t2;
delete from t2;
let $count=$maxrows;
@ -34,11 +38,13 @@ select count(*) from t2;
drop table t2;
eval create table t3 (a mediumint not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
partition by key (a) partitions 7;
show create table t3;
insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0);
--sorted_result
select * from t3;
select * from t3 where a=8388605;
delete from t3 where a=8388605;
--sorted_result
select * from t3;
drop table t3;

View File

@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
show create table t1;
insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256);
--sorted_result
select * from t1;
select * from t1 where a=65533;
delete from t1 where a=65533;
--sorted_result
select * from t1;
drop table t1;
@ -16,9 +18,11 @@ eval create table t2 (a smallint unsigned not null, primary key(a)) engine=$engi
partition by key (a) partitions 8;
show create table t2;
insert into t2 values (65535), (65534), (65533), (65532);
--sorted_result
select * from t2;
select * from t2 where a=65533;
delete from t2 where a=65533;
--sorted_result
select * from t2;
delete from t2;
let $count=$maxrows;
@ -34,11 +38,13 @@ select count(*) from t2;
drop table t2;
eval create table t3 (a smallint not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
partition by key (a) partitions 7;
show create table t3;
insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0);
--sorted_result
select * from t3;
select * from t3 where a=32765;
delete from t3 where a=32765;
--sorted_result
select * from t3;
drop table t3;

Some files were not shown because too many files have changed in this diff Show More