merge 5.1-rep+2 -> 5.1-rep+2-delivery1
This commit is contained in:
commit
f59e43a163
@ -196,6 +196,10 @@ test-bt-fast:
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
|
||||
|
||||
test-bt-fast:
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=ps --ps-protocol --report-features
|
||||
|
||||
test-bt-debug:
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=debug --force --timer \
|
||||
@ -203,6 +207,8 @@ test-bt-debug:
|
||||
|
||||
test-bt-debug-fast:
|
||||
|
||||
test-bt-debug-fast:
|
||||
|
||||
# Keep these for a while
|
||||
test-pl: test
|
||||
test-full-pl: test-full
|
||||
|
@ -1280,21 +1280,35 @@ sig_handler handle_sigint(int sig)
|
||||
MYSQL *kill_mysql= NULL;
|
||||
|
||||
/* terminate if no query being executed, or we already tried interrupting */
|
||||
if (!executing_query || interrupted_query)
|
||||
/* terminate if no query being executed, or we already tried interrupting */
|
||||
if (!executing_query || (interrupted_query == 2))
|
||||
{
|
||||
tee_fprintf(stdout, "Ctrl-C -- exit!\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
kill_mysql= mysql_init(kill_mysql);
|
||||
if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
|
||||
"", opt_mysql_port, opt_mysql_unix_port,0))
|
||||
{
|
||||
tee_fprintf(stdout, "Ctrl-C -- sorry, cannot connect to server to kill query, giving up ...\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
interrupted_query++;
|
||||
|
||||
/* mysqld < 5 does not understand KILL QUERY, skip to KILL CONNECTION */
|
||||
if ((interrupted_query == 1) && (mysql_get_server_version(&mysql) < 50000))
|
||||
interrupted_query= 2;
|
||||
|
||||
/* kill_buffer is always big enough because max length of %lu is 15 */
|
||||
sprintf(kill_buffer, "KILL /*!50000 QUERY */ %lu", mysql_thread_id(&mysql));
|
||||
mysql_real_query(kill_mysql, kill_buffer, strlen(kill_buffer));
|
||||
sprintf(kill_buffer, "KILL %s%lu",
|
||||
(interrupted_query == 1) ? "QUERY " : "",
|
||||
mysql_thread_id(&mysql));
|
||||
tee_fprintf(stdout, "Ctrl-C -- sending \"%s\" to server ...\n", kill_buffer);
|
||||
mysql_real_query(kill_mysql, kill_buffer, (uint) strlen(kill_buffer));
|
||||
mysql_close(kill_mysql);
|
||||
tee_fprintf(stdout, "Query aborted by Ctrl+C\n");
|
||||
|
||||
interrupted_query= 1;
|
||||
tee_fprintf(stdout, "Ctrl-C -- query aborted.\n");
|
||||
|
||||
return;
|
||||
|
||||
|
@ -78,6 +78,9 @@ static const char* host = 0;
|
||||
static int port= 0;
|
||||
static uint my_end_arg;
|
||||
static const char* sock= 0;
|
||||
#ifdef HAVE_SMEM
|
||||
static char *shared_memory_base_name= 0;
|
||||
#endif
|
||||
static const char* user = 0;
|
||||
static char* pass = 0;
|
||||
static char *charset= 0;
|
||||
@ -439,6 +442,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
|
||||
{
|
||||
error("Could not construct local filename %s%s.",
|
||||
target_dir_name,bname);
|
||||
my_free(fname, MYF(0));
|
||||
delete ce;
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
}
|
||||
@ -446,9 +450,15 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
|
||||
rec.fname= fname;
|
||||
rec.event= ce;
|
||||
|
||||
/*
|
||||
fname is freed in process_event()
|
||||
after Execute_load_query_log_event or Execute_load_log_event
|
||||
will have been processed, otherwise in Load_log_processor::destroy()
|
||||
*/
|
||||
if (set_dynamic(&file_names, (uchar*)&rec, file_id))
|
||||
{
|
||||
error("Out of memory.");
|
||||
my_free(fname, MYF(0));
|
||||
delete ce;
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
}
|
||||
@ -828,7 +838,17 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
print_event_info->common_header_len=
|
||||
glob_description_event->common_header_len;
|
||||
ev->print(result_file, print_event_info);
|
||||
ev->temp_buf= 0; // as the event ref is zeroed
|
||||
if (!remote_opt)
|
||||
{
|
||||
ev->free_temp_buf(); // free memory allocated in dump_local_log_entries
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
disassociate but not free dump_remote_log_entries time memory
|
||||
*/
|
||||
ev->temp_buf= 0;
|
||||
}
|
||||
/*
|
||||
We don't want this event to be deleted now, so let's hide it (I
|
||||
(Guilhem) should later see if this triggers a non-serious Valgrind
|
||||
@ -992,13 +1012,13 @@ static struct my_option my_long_options[] =
|
||||
/* 'unspec' is not mentioned because it is just a placeholder. */
|
||||
"Determine when the output statements should be base64-encoded BINLOG "
|
||||
"statements: 'never' disables it and works only for binlogs without "
|
||||
"row-based events; 'auto' is the default and prints base64 only when "
|
||||
"necessary (i.e., for row-based events and format description events); "
|
||||
"'decode-rows' suppresses BINLOG statements for row events, but does "
|
||||
"not exit as an error if a row event is found, unlike 'never'; "
|
||||
"'always' prints base64 whenever possible. 'always' is for debugging "
|
||||
"only and should not be used in a production system. The default is "
|
||||
"'auto'. --base64-output is a short form for --base64-output=always."
|
||||
"row-based events; 'decode-rows' decodes row events into commented SQL "
|
||||
"statements if the --verbose option is also given; 'auto' prints base64 "
|
||||
"only when necessary (i.e., for row-based events and format description "
|
||||
"events); 'always' prints base64 whenever possible. 'always' is for "
|
||||
"debugging only and should not be used in a production system. If this "
|
||||
"argument is not given, the default is 'auto'; if it is given with no "
|
||||
"argument, 'always' is used."
|
||||
,(uchar**) &opt_base64_output_mode_str,
|
||||
(uchar**) &opt_base64_output_mode_str,
|
||||
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -1077,6 +1097,12 @@ static struct my_option my_long_options[] =
|
||||
{"set-charset", OPT_SET_CHARSET,
|
||||
"Add 'SET NAMES character_set' to the output.", (uchar**) &charset,
|
||||
(uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
|
||||
(uchar**) &shared_memory_base_name,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"short-form", 's', "Just show regular queries: no extra info and no "
|
||||
"row-based events. This is for testing only, and should not be used in "
|
||||
"production systems. If you want to suppress base64-output, consider "
|
||||
@ -1378,6 +1404,11 @@ static Exit_status safe_connect()
|
||||
|
||||
if (opt_protocol)
|
||||
mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
|
||||
#ifdef HAVE_SMEM
|
||||
if (shared_memory_base_name)
|
||||
mysql_options(mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
|
||||
shared_memory_base_name);
|
||||
#endif
|
||||
if (!mysql_real_connect(mysql, host, user, pass, 0, port, sock, 0))
|
||||
{
|
||||
error("Failed on connect: %s", mysql_error(mysql));
|
||||
|
@ -81,6 +81,9 @@ enum {
|
||||
static int record= 0, opt_sleep= -1;
|
||||
static char *opt_db= 0, *opt_pass= 0;
|
||||
const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./";
|
||||
#ifdef HAVE_SMEM
|
||||
static char *shared_memory_base_name=0;
|
||||
#endif
|
||||
const char *opt_logdir= "";
|
||||
const char *opt_include= 0, *opt_charsets_dir;
|
||||
static int opt_port= 0;
|
||||
@ -4896,6 +4899,8 @@ do_handle_error:
|
||||
<opts> - options to use for the connection
|
||||
* SSL - use SSL if available
|
||||
* COMPRESS - use compression if available
|
||||
* SHM - use shared memory if available
|
||||
* PIPE - use named pipe if available
|
||||
|
||||
*/
|
||||
|
||||
@ -4904,6 +4909,7 @@ void do_connect(struct st_command *command)
|
||||
int con_port= opt_port;
|
||||
char *con_options;
|
||||
my_bool con_ssl= 0, con_compress= 0;
|
||||
my_bool con_pipe= 0, con_shm= 0;
|
||||
struct st_connection* con_slot;
|
||||
|
||||
static DYNAMIC_STRING ds_connection_name;
|
||||
@ -4914,6 +4920,9 @@ void do_connect(struct st_command *command)
|
||||
static DYNAMIC_STRING ds_port;
|
||||
static DYNAMIC_STRING ds_sock;
|
||||
static DYNAMIC_STRING ds_options;
|
||||
#ifdef HAVE_SMEM
|
||||
static DYNAMIC_STRING ds_shm;
|
||||
#endif
|
||||
const struct command_arg connect_args[] = {
|
||||
{ "connection name", ARG_STRING, TRUE, &ds_connection_name, "Name of the connection" },
|
||||
{ "host", ARG_STRING, TRUE, &ds_host, "Host to connect to" },
|
||||
@ -4941,6 +4950,11 @@ void do_connect(struct st_command *command)
|
||||
die("Illegal argument for port: '%s'", ds_port.str);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
/* Shared memory */
|
||||
init_dynamic_string(&ds_shm, ds_sock.str, 0, 0);
|
||||
#endif
|
||||
|
||||
/* Sock */
|
||||
if (ds_sock.length)
|
||||
{
|
||||
@ -4979,6 +4993,10 @@ void do_connect(struct st_command *command)
|
||||
con_ssl= 1;
|
||||
else if (!strncmp(con_options, "COMPRESS", 8))
|
||||
con_compress= 1;
|
||||
else if (!strncmp(con_options, "PIPE", 4))
|
||||
con_pipe= 1;
|
||||
else if (!strncmp(con_options, "SHM", 3))
|
||||
con_shm= 1;
|
||||
else
|
||||
die("Illegal option to connect: %.*s",
|
||||
(int) (end - con_options), con_options);
|
||||
@ -5026,6 +5044,31 @@ void do_connect(struct st_command *command)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __WIN__
|
||||
if (con_pipe)
|
||||
{
|
||||
uint protocol= MYSQL_PROTOCOL_PIPE;
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
if (con_shm)
|
||||
{
|
||||
uint protocol= MYSQL_PROTOCOL_MEMORY;
|
||||
if (!ds_shm.length)
|
||||
die("Missing shared memory base name");
|
||||
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str);
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
||||
}
|
||||
else if(shared_memory_base_name)
|
||||
{
|
||||
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
|
||||
shared_memory_base_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Use default db name */
|
||||
if (ds_database.length == 0)
|
||||
dynstr_set(&ds_database, opt_db);
|
||||
@ -5058,6 +5101,9 @@ void do_connect(struct st_command *command)
|
||||
dynstr_free(&ds_port);
|
||||
dynstr_free(&ds_sock);
|
||||
dynstr_free(&ds_options);
|
||||
#ifdef HAVE_SMEM
|
||||
dynstr_free(&ds_shm);
|
||||
#endif
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -5724,6 +5770,12 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"server-file", 'F', "Read embedded server arguments from file.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
|
||||
(uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Suppress all normal output. Synonym for --quiet.",
|
||||
(uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
|
||||
@ -6913,35 +6965,39 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
||||
Need to grab affected rows information before getting
|
||||
warnings here
|
||||
*/
|
||||
if (!disable_info)
|
||||
affected_rows= mysql_affected_rows(mysql);
|
||||
|
||||
if (!disable_warnings)
|
||||
{
|
||||
/* Get the warnings from execute */
|
||||
ulonglong affected_rows;
|
||||
LINT_INIT(affected_rows);
|
||||
|
||||
/* Append warnings to ds - if there are any */
|
||||
if (append_warnings(&ds_execute_warnings, mysql) ||
|
||||
ds_execute_warnings.length ||
|
||||
ds_prepare_warnings.length ||
|
||||
ds_warnings->length)
|
||||
if (!disable_info)
|
||||
affected_rows= mysql_affected_rows(mysql);
|
||||
|
||||
if (!disable_warnings)
|
||||
{
|
||||
dynstr_append_mem(ds, "Warnings:\n", 10);
|
||||
if (ds_warnings->length)
|
||||
dynstr_append_mem(ds, ds_warnings->str,
|
||||
ds_warnings->length);
|
||||
if (ds_prepare_warnings.length)
|
||||
dynstr_append_mem(ds, ds_prepare_warnings.str,
|
||||
ds_prepare_warnings.length);
|
||||
if (ds_execute_warnings.length)
|
||||
dynstr_append_mem(ds, ds_execute_warnings.str,
|
||||
ds_execute_warnings.length);
|
||||
/* Get the warnings from execute */
|
||||
|
||||
/* Append warnings to ds - if there are any */
|
||||
if (append_warnings(&ds_execute_warnings, mysql) ||
|
||||
ds_execute_warnings.length ||
|
||||
ds_prepare_warnings.length ||
|
||||
ds_warnings->length)
|
||||
{
|
||||
dynstr_append_mem(ds, "Warnings:\n", 10);
|
||||
if (ds_warnings->length)
|
||||
dynstr_append_mem(ds, ds_warnings->str,
|
||||
ds_warnings->length);
|
||||
if (ds_prepare_warnings.length)
|
||||
dynstr_append_mem(ds, ds_prepare_warnings.str,
|
||||
ds_prepare_warnings.length);
|
||||
if (ds_execute_warnings.length)
|
||||
dynstr_append_mem(ds, ds_execute_warnings.str,
|
||||
ds_execute_warnings.length);
|
||||
}
|
||||
}
|
||||
|
||||
if (!disable_info)
|
||||
append_info(ds, affected_rows, mysql_info(mysql));
|
||||
}
|
||||
|
||||
if (!disable_info)
|
||||
append_info(ds, affected_rows, mysql_info(mysql));
|
||||
|
||||
}
|
||||
|
||||
end:
|
||||
@ -7673,6 +7729,11 @@ int main(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
if (shared_memory_base_name)
|
||||
mysql_options(&con->mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
|
||||
#endif
|
||||
|
||||
if (!(con->name = my_strdup("default", MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
|
@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
|
||||
#
|
||||
# When changing major version number please also check switch statement
|
||||
# in mysqlbinlog::check_master_version().
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.41)
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.42)
|
||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <time.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#else
|
||||
|
@ -432,6 +432,10 @@ typedef struct st_mi_check_param
|
||||
const char *db_name, *table_name;
|
||||
const char *op_name;
|
||||
enum_mi_stats_method stats_method;
|
||||
#ifdef THREAD
|
||||
pthread_mutex_t print_msg_mutex;
|
||||
my_bool need_print_msg_lock;
|
||||
#endif
|
||||
} MI_CHECK;
|
||||
|
||||
typedef struct st_sort_ft_buf
|
||||
|
@ -557,6 +557,16 @@ unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
|
||||
char *to,const char *from,
|
||||
unsigned long length);
|
||||
void STDCALL mysql_debug(const char *debug);
|
||||
char * STDCALL mysql_odbc_escape_string(MYSQL *mysql,
|
||||
char *to,
|
||||
unsigned long to_length,
|
||||
const char *from,
|
||||
unsigned long from_length,
|
||||
void *param,
|
||||
char *
|
||||
(*extend_buffer)
|
||||
(void *, char *to,
|
||||
unsigned long *length));
|
||||
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
|
||||
unsigned int STDCALL mysql_thread_safe(void);
|
||||
my_bool STDCALL mysql_embedded(void);
|
||||
|
@ -518,6 +518,16 @@ unsigned long mysql_real_escape_string(MYSQL *mysql,
|
||||
char *to,const char *from,
|
||||
unsigned long length);
|
||||
void mysql_debug(const char *debug);
|
||||
char * mysql_odbc_escape_string(MYSQL *mysql,
|
||||
char *to,
|
||||
unsigned long to_length,
|
||||
const char *from,
|
||||
unsigned long from_length,
|
||||
void *param,
|
||||
char *
|
||||
(*extend_buffer)
|
||||
(void *, char *to,
|
||||
unsigned long *length));
|
||||
void myodbc_remove_escape(MYSQL *mysql,char *name);
|
||||
unsigned int mysql_thread_safe(void);
|
||||
my_bool mysql_embedded(void);
|
||||
|
@ -44,7 +44,7 @@ enum enum_vio_type
|
||||
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
|
||||
#ifdef __WIN__
|
||||
Vio* vio_new_win32pipe(HANDLE hPipe);
|
||||
Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map,
|
||||
Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
|
||||
HANDLE handle_map,
|
||||
HANDLE event_server_wrote,
|
||||
HANDLE event_server_read,
|
||||
@ -221,7 +221,11 @@ struct st_vio
|
||||
HANDLE event_conn_closed;
|
||||
size_t shared_memory_remain;
|
||||
char *shared_memory_pos;
|
||||
NET *net;
|
||||
#endif /* HAVE_SMEM */
|
||||
#ifdef _WIN32
|
||||
OVERLAPPED pipe_overlapped;
|
||||
DWORD read_timeout_millis;
|
||||
DWORD write_timeout_millis;
|
||||
#endif
|
||||
};
|
||||
#endif /* vio_violite_h_ */
|
||||
|
@ -1629,6 +1629,20 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
|
||||
return (uint) escape_string_for_mysql(mysql->charset, to, 0, from, length);
|
||||
}
|
||||
|
||||
|
||||
char * STDCALL
|
||||
mysql_odbc_escape_string(MYSQL *mysql __attribute__((unused)),
|
||||
char *to __attribute__((unused)),
|
||||
ulong to_length __attribute__((unused)),
|
||||
const char *from __attribute__((unused)),
|
||||
ulong from_length __attribute__((unused)),
|
||||
void *param __attribute__((unused)),
|
||||
char * (*extend_buffer)(void *, char *, ulong *)
|
||||
__attribute__((unused)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void STDCALL
|
||||
myodbc_remove_escape(MYSQL *mysql,char *name)
|
||||
{
|
||||
|
@ -78,6 +78,7 @@ EXPORTS
|
||||
mysql_next_result
|
||||
mysql_num_fields
|
||||
mysql_num_rows
|
||||
mysql_odbc_escape_string
|
||||
mysql_options
|
||||
mysql_stmt_param_count
|
||||
mysql_stmt_param_metadata
|
||||
|
@ -50,6 +50,7 @@ EXPORTS
|
||||
mysql_next_result
|
||||
mysql_num_fields
|
||||
mysql_num_rows
|
||||
mysql_odbc_escape_string
|
||||
mysql_options
|
||||
mysql_ping
|
||||
mysql_query
|
||||
|
@ -18,6 +18,7 @@ main.plugin_load @solaris # Bug#42144
|
||||
|
||||
ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
|
||||
|
||||
rpl.rpl_cross_version* # Bug #43913 2009-10-26 joro rpl_cross_version can't pass on conflicts complainig clash with --slave-load-tm
|
||||
rpl.rpl_get_master_version_and_clock* # Bug#46931 2009-08-26 alik rpl.rpl_get_master_version_and_clock fails on hpux11.31
|
||||
rpl.rpl_innodb_bug28430* @solaris # Bug#46029
|
||||
rpl.rpl_row_create_table* # Bug#45576: rpl_row_create_table fails on PB2
|
||||
|
@ -48,6 +48,16 @@ DROP TABLE IF EXISTS tmp2, t;
|
||||
--enable_warnings
|
||||
|
||||
SELECT GET_LOCK("a",10);
|
||||
|
||||
#
|
||||
# BUG48216 Replication fails on all slaves after upgrade to 5.0.86 on master
|
||||
#
|
||||
# When the session is closed, any temporary tables of the session are dropped
|
||||
# and are binlogged. But it will be binlogged with a wrong database name when
|
||||
# the length of the database name('drop-temp-table-test') is greater than the
|
||||
# current database name('test').
|
||||
#
|
||||
USE test;
|
||||
disconnect con1;
|
||||
|
||||
connection con2;
|
||||
|
@ -179,7 +179,9 @@ begin
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
--disable_warnings
|
||||
insert into t1 (last_id) values (0);
|
||||
--enable_warnings
|
||||
|
||||
drop trigger t1_bi;
|
||||
|
||||
@ -512,7 +514,9 @@ set sql_log_bin=0;
|
||||
insert into t2 (id) values(5),(6),(7);
|
||||
delete from t2 where id>=5;
|
||||
set sql_log_bin=1;
|
||||
--disable_warnings
|
||||
insert into t1 select insid();
|
||||
--enable_warnings
|
||||
select * from t1 order by id;
|
||||
select * from t2 order by id;
|
||||
|
||||
|
@ -158,4 +158,65 @@ LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
|
||||
# BUG#48297: Schema name is ignored when LOAD DATA is written into binlog,
|
||||
# replication aborts
|
||||
-- source include/master-slave-reset.inc
|
||||
|
||||
-- let $db1= b48297_db1
|
||||
-- let $db2= b42897_db2
|
||||
|
||||
-- connection master
|
||||
|
||||
-- disable_warnings
|
||||
-- eval drop database if exists $db1
|
||||
-- eval drop database if exists $db2
|
||||
-- enable_warnings
|
||||
|
||||
-- eval create database $db1
|
||||
-- eval create database $db2
|
||||
|
||||
-- eval use $db1
|
||||
-- eval CREATE TABLE t1 (c1 VARCHAR(256)) engine=$engine_type;
|
||||
|
||||
-- eval use $db2
|
||||
|
||||
-- echo ### assertion: works with cross-referenced database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
-- eval use $db1
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- echo ### assertion: works with fully qualified name on current database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
-- echo ### assertion: works without fully qualified name on current database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
|
||||
|
||||
-- echo ### create connection without default database
|
||||
-- echo ### connect (conn2,localhost,root,,*NO-ONE*);
|
||||
connect (conn2,localhost,root,,*NO-ONE*);
|
||||
-- connection conn2
|
||||
-- echo ### assertion: works without stating the default database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- echo ### disconnect and switch back to master connection
|
||||
-- disconnect conn2
|
||||
-- connection master
|
||||
|
||||
-- sync_slave_with_master
|
||||
-- eval use $db1
|
||||
|
||||
let $diff_table_1=master:$db1.t1;
|
||||
let $diff_table_2=slave:$db1.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
-- connection master
|
||||
|
||||
-- eval DROP DATABASE $db1
|
||||
-- eval DROP DATABASE $db2
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@ -22,6 +22,7 @@ source include/show_slave_status2.inc;
|
||||
reset slave;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
change master to master_user='root';
|
||||
start slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status2.inc;
|
||||
|
@ -36,7 +36,7 @@ SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sleep 5;
|
||||
--source include/wait_for_ndb_to_binlog.inc
|
||||
--echo
|
||||
--echo **** Data Insert Validation Slave Section test.t1 ****
|
||||
--echo
|
||||
@ -56,12 +56,10 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
|
||||
--echo
|
||||
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
|
||||
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
|
||||
# Sleep is needed for NDB to allow time for
|
||||
# Injector thread to populate the bin log.
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sleep 5;
|
||||
--source include/wait_for_ndb_to_binlog.inc
|
||||
--echo
|
||||
--echo **** Data Update Validation Slave Section test.t1 ****
|
||||
--echo
|
||||
@ -132,7 +130,7 @@ FROM test.t2 WHERE c1=2;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sleep 5;
|
||||
--source include/wait_for_ndb_to_binlog.inc
|
||||
--echo
|
||||
--echo **** Data Insert Validation Slave Section test.t2 ****
|
||||
--echo
|
||||
@ -155,12 +153,10 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
||||
FROM test.t2 WHERE c1=1;
|
||||
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
||||
FROM test.t2 WHERE c1=2;
|
||||
# Sleep is needed for NDB to allow time for
|
||||
# Injector thread to populate the bin log.
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
sleep 5;
|
||||
--source include/wait_for_ndb_to_binlog.inc
|
||||
--echo
|
||||
--echo **** Data Update Validation Slave Section test.t2 ****
|
||||
--echo
|
||||
|
@ -3,10 +3,7 @@
|
||||
# Original Date: Aug/15/2005 #
|
||||
# Update: 08/29/2005 Comment out sleep. Only needed for debugging #
|
||||
#############################################################################
|
||||
# Note: Many lines are commented out in this test case. These were used for #
|
||||
# creating the test case and debugging and are being left for #
|
||||
# debugging, but they can not be used for the regular testing as the #
|
||||
# Time changes and is not deteministic, so instead we dump both the #
|
||||
# Note: Time changes and is not deteministic, so instead we dump both the #
|
||||
# master and slave and diff the dumps. If the dumps differ then the #
|
||||
# test case will fail. To run during diff failuers, comment out the #
|
||||
# diff. #
|
||||
@ -26,7 +23,6 @@ DROP TABLE IF EXISTS test.t1;
|
||||
|
||||
--enable_warnings
|
||||
|
||||
|
||||
eval CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=$engine_type;
|
||||
|
||||
delimiter |;
|
||||
@ -44,33 +40,24 @@ END|
|
||||
delimiter ;|
|
||||
|
||||
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
|
||||
sleep 6;
|
||||
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
|
||||
sleep 6;
|
||||
|
||||
#Select in this test are used for debugging
|
||||
#select * from test.t1;
|
||||
#connection slave;
|
||||
#select * from test.t1;
|
||||
|
||||
connection master;
|
||||
SET AUTOCOMMIT=0;
|
||||
START TRANSACTION;
|
||||
INSERT INTO test.t1 VALUES (null,test.f1());
|
||||
ROLLBACK;
|
||||
SET AUTOCOMMIT=1;
|
||||
#select * from test.t1;
|
||||
#sleep 6;
|
||||
|
||||
#connection slave;
|
||||
#select * from test.t1;
|
||||
# Sync master and slave for all engines except NDB
|
||||
if (`SELECT UPPER(LEFT('$engine_type', 3)) != 'NDB'`) {
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
}
|
||||
# Sync master and slave for NDB engine
|
||||
let $wait_time= 6;
|
||||
--source include/wait_for_ndb_to_binlog.inc
|
||||
|
||||
#connection master;
|
||||
|
||||
#used for debugging
|
||||
#show binlog events;
|
||||
|
||||
# time to dump the databases and so we can see if they match
|
||||
# Time to dump the databases and so we can see if they match
|
||||
|
||||
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_master.sql
|
||||
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_slave.sql
|
||||
@ -87,5 +74,8 @@ DROP TABLE test.t1;
|
||||
|
||||
diff_files $MYSQLTEST_VARDIR/tmp/func003_master.sql $MYSQLTEST_VARDIR/tmp/func003_slave.sql;
|
||||
|
||||
# Clean up
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/func003_master.sql;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/func003_slave.sql;
|
||||
|
||||
# End of 5.0 test case
|
||||
|
@ -41,10 +41,7 @@ CALL test.p2();
|
||||
SELECT release_lock("test");
|
||||
SELECT * FROM test.t1;
|
||||
#show binlog events;
|
||||
# Added sleep for use with NDB to ensure that
|
||||
# the injector thread will populate log before
|
||||
# we switch to the slave.
|
||||
sleep 5;
|
||||
--source include/wait_for_ndb_to_binlog.inc
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
SELECT * FROM test.t1;
|
||||
|
@ -68,8 +68,8 @@ enable_query_log;
|
||||
connection slave;
|
||||
lock tables t1 read;
|
||||
start slave;
|
||||
#hope this is long enough for I/O thread to fetch over 16K relay log data
|
||||
sleep 3;
|
||||
connection master;
|
||||
--source include/sync_slave_io_with_master.inc
|
||||
unlock tables;
|
||||
|
||||
#test handling of aborted connection in the middle of update
|
||||
@ -93,7 +93,7 @@ kill @id;
|
||||
# We don't drop t3 as this is a temporary table
|
||||
drop table t2;
|
||||
connection master;
|
||||
--error 1053,2013
|
||||
--error 1317,2013
|
||||
reap;
|
||||
connection slave;
|
||||
# The SQL slave thread should now have stopped because the query was killed on
|
||||
|
@ -35,9 +35,8 @@ INSERT INTO test.t2 VALUES (1, 0.0);
|
||||
#show binlog events;
|
||||
select * from test.t1;
|
||||
select * from test.t2;
|
||||
# Have to sleep for a few seconds to allow
|
||||
# NDB injector thread to populate binlog
|
||||
sleep 10;
|
||||
let $wait_time= 10;
|
||||
--source include/wait_for_ndb_to_binlog.inc
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select * from test.t1;
|
||||
|
4
mysql-test/include/have_case_insensitive_fs.inc
Normal file
4
mysql-test/include/have_case_insensitive_fs.inc
Normal file
@ -0,0 +1,4 @@
|
||||
--require r/case_insensitive_fs.require
|
||||
--disable_query_log
|
||||
show variables like 'lower_case_file_system';
|
||||
--enable_query_log
|
@ -6,12 +6,29 @@
|
||||
# Since we expect STOP SLAVE to produce a warning as the slave is
|
||||
# stopped (the server was started with skip-slave-start), we disable
|
||||
# warnings when doing STOP SLAVE.
|
||||
#
|
||||
# $no_change_master If true, no change master will be done nor any reset slave.
|
||||
# This is to avoid touching the relay-log.info file allowing
|
||||
# the test to create one itself.
|
||||
# $skip_slave_start If true, the slave will not be started
|
||||
|
||||
connection slave;
|
||||
|
||||
#we expect STOP SLAVE to produce a warning as the slave is stopped
|
||||
#(the server was started with skip-slave-start)
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
--disable_query_log
|
||||
if (!$no_change_master) {
|
||||
eval CHANGE MASTER TO MASTER_USER='root',
|
||||
MASTER_CONNECT_RETRY=1,
|
||||
MASTER_HOST='127.0.0.1',
|
||||
MASTER_PORT=$MASTER_MYPORT;
|
||||
}
|
||||
--enable_query_log
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
--enable_warnings
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
@ -20,17 +37,39 @@ use test;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
|
||||
--disable_query_log
|
||||
reset slave;
|
||||
if (!$no_change_master) {
|
||||
reset slave;
|
||||
}
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
reset slave;
|
||||
|
||||
--disable_warnings
|
||||
# the first RESET SLAVE may produce a warning about non-existent
|
||||
# 'ndb_apply_status' table, because this table is created
|
||||
# asynchronously at the server startup and may not exist yet
|
||||
# if RESET SLAVE comes too soon after the server startup
|
||||
if (!$no_change_master) {
|
||||
reset slave;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
# Clean up old test tables
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
|
||||
--disable_query_log
|
||||
#eval CHANGE MASTER TO MASTER_USER='root',
|
||||
# MASTER_CONNECT_RETRY=1,
|
||||
# MASTER_HOST='127.0.0.1',
|
||||
# MASTER_PORT=$MASTER_MYPORT;
|
||||
reset master;
|
||||
--enable_query_log
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
|
||||
if (!$skip_slave_start) {
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
# Replication tests need binlog
|
||||
#
|
||||
# $skip_slave_start If true, the slave will not be started
|
||||
source include/have_log_bin.inc;
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
@ -8,7 +10,10 @@ connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
-- source include/master-slave-reset.inc
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
if (!$skip_slave_start) {
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
}
|
||||
|
||||
# Set the default connection to 'master'
|
||||
connection master;
|
||||
|
@ -1,4 +1,4 @@
|
||||
--require r/not_ndb_default.require
|
||||
disable_query_log;
|
||||
select convert(@@table_type using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
|
||||
select convert(@@storage_engine using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
|
||||
enable_query_log;
|
||||
|
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
@ -0,0 +1,41 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Several test primitives from mysql-test/extra/rpl_tests
|
||||
# shared for test cases for MyISAM, InnoDB, NDB and other
|
||||
# engines. But for NDB all events will be added by NDB
|
||||
# injector and now there are no way to detect the state of
|
||||
# NDB injector therefore this primitive waits 5 sec
|
||||
# if engine type is NDB.
|
||||
# In future that should be fixed by waiting of proper
|
||||
# state of NDB injector.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# let $engine_type= NDB;
|
||||
# --source include/wait_for_ndb_to_binlog.inc
|
||||
#
|
||||
# ==== Parameters =====
|
||||
#
|
||||
# $engine_type
|
||||
# Type of engine. If type is NDB then it waits $wait_time sec
|
||||
#
|
||||
# $wait_time
|
||||
# Test will wait $wait_time seconds
|
||||
|
||||
let $_wait_time= 5;
|
||||
|
||||
if (!$wait_time) {
|
||||
let $_wait_time= $wait_time;
|
||||
}
|
||||
|
||||
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
|
||||
while (!$_wait_time) {
|
||||
let $_wait_time_internal= 10;
|
||||
while (!$_wait_time_internal) {
|
||||
sleep 0.1;
|
||||
dec $_wait_time_internal;
|
||||
}
|
||||
dec $_wait_time;
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ use Carp;
|
||||
|
||||
use My::Config;
|
||||
use My::Find;
|
||||
use My::Platform;
|
||||
|
||||
use File::Basename;
|
||||
|
||||
@ -218,6 +219,12 @@ my @mysqld_rules=
|
||||
{ 'ssl-key' => \&fix_ssl_server_key },
|
||||
);
|
||||
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
# For simplicity, we use the same names for shared memory and
|
||||
# named pipes.
|
||||
push(@mysqld_rules, {'shared-memory-base-name' => \&fix_socket});
|
||||
}
|
||||
|
||||
sub fix_ndb_mgmd_port {
|
||||
my ($self, $config, $group_name, $group)= @_;
|
||||
@ -347,6 +354,16 @@ sub post_check_client_group {
|
||||
}
|
||||
$config->insert($client_group_name, $name_to, $option->value())
|
||||
}
|
||||
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
# Shared memory base may or may not be defined (e.g not defined in embedded)
|
||||
my $shm = $group_to_copy_from->option("shared-memory-base-name");
|
||||
if (defined $shm)
|
||||
{
|
||||
$config->insert($client_group_name,"shared-memory-base-name", $shm->value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -393,6 +410,7 @@ sub post_check_embedded_group {
|
||||
(
|
||||
'#log-error', # Embedded server writes stderr to mysqltest's log file
|
||||
'slave-net-timeout', # Embedded server are not build with replication
|
||||
'shared-memory-base-name', # No shared memory for embedded
|
||||
);
|
||||
|
||||
foreach my $option ( $mysqld->options(), $first_mysqld->options() ) {
|
||||
|
@ -50,9 +50,6 @@
|
||||
is killed.
|
||||
*/
|
||||
|
||||
/* Requires Windows 2000 or higher */
|
||||
#define _WIN32_WINNT 0x0500
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <tlhelp32.h>
|
||||
|
@ -518,10 +518,8 @@ sub collect_one_suite($)
|
||||
next if ($test->{'name'} eq 'sys_vars.innodb_lock_wait_timeout_basic');
|
||||
# Diff around innodb_thread_concurrency variable
|
||||
next if ($test->{'name'} eq 'sys_vars.innodb_thread_concurrency_basic');
|
||||
# Disable for Innodb Plugin until the fix for Plugin is received
|
||||
# Can't work with InnoPlug. Test framework needs to be re-designed.
|
||||
next if ($test->{'name'} eq 'main.innodb_bug46000');
|
||||
# Disable for Innodb Plugin until the fix for Plugin is received
|
||||
next if ($test->{'name'} eq 'main.innodb_bug44369');
|
||||
# Copy test options
|
||||
my $new_test= My::Test->new();
|
||||
while (my ($key, $value) = each(%$test))
|
||||
|
@ -4024,15 +4024,26 @@ sub mysqld_arguments ($$$$) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($mysql_version_id < 50200)
|
||||
{
|
||||
mtr_add_arg($args, "%s--master-user=root", $prefix);
|
||||
mtr_add_arg($args, "%s--master-connect-retry=1", $prefix);
|
||||
mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix);
|
||||
mtr_add_arg($args, "%s--master-password=", $prefix);
|
||||
mtr_add_arg($args, "%s--master-port=%d", $prefix,
|
||||
$master->[0]->{'port'}); # First master
|
||||
}
|
||||
# NOTE: the backport (see BUG#48048) originally removed the
|
||||
# commented out lines below. However, given that they are
|
||||
# protected with a version check (< 50200) now, it should be
|
||||
# safe to keep them. The problem is that the backported patch
|
||||
# was into a 5.1 GA codebase - mysql-5.1-rep+2 tree - so
|
||||
# version is 501XX, consequently check becomes worthless. It
|
||||
# should be safe to uncomment them when merging up to 5.5.
|
||||
#
|
||||
# RQG semisync test runs on the 5.1 GA tree and needs MTR v1.
|
||||
# This was causing the test to fail (slave would not start
|
||||
# due to unrecognized option(s)).
|
||||
# if ($mysql_version_id < 50200)
|
||||
# {
|
||||
# mtr_add_arg($args, "%s--master-user=root", $prefix);
|
||||
# mtr_add_arg($args, "%s--master-connect-retry=1", $prefix);
|
||||
# mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix);
|
||||
# mtr_add_arg($args, "%s--master-password=", $prefix);
|
||||
# mtr_add_arg($args, "%s--master-port=%d", $prefix,
|
||||
# $master->[0]->{'port'}); # First master
|
||||
# }
|
||||
my $slave_server_id= 2 + $idx;
|
||||
my $slave_rpl_rank= $slave_server_id;
|
||||
mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
|
||||
|
@ -68,7 +68,7 @@ use My::File::Path; # Patched version of File::Path
|
||||
use File::Basename;
|
||||
use File::Copy;
|
||||
use File::Find;
|
||||
use File::Temp qw / tempdir /;
|
||||
use File::Temp qw /tempdir/;
|
||||
use File::Spec::Functions qw / splitdir /;
|
||||
use My::Platform;
|
||||
use My::SafeProcess;
|
||||
|
@ -1330,4 +1330,12 @@ ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx','a5','a6','a7','a8','a9',
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 0
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (f1 TIMESTAMP NULL DEFAULT NULL,
|
||||
f2 INT(11) DEFAULT NULL) ENGINE=MYISAM DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES (NULL, NULL), ("2009-10-09 11:46:19", 2);
|
||||
this should affect no rows as there is no real change
|
||||
ALTER TABLE t1 CHANGE COLUMN f1 f1_no_real_change TIMESTAMP NULL DEFAULT NULL;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -19,81 +19,10 @@ test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL
|
||||
test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL
|
||||
test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL
|
||||
create table t2 select * from t1 procedure analyse();
|
||||
select * from t2;
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
|
||||
test.t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL
|
||||
test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL
|
||||
test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL
|
||||
test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL
|
||||
drop table t1,t2;
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT
|
||||
drop table t1;
|
||||
EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
create table t1 (a int not null);
|
||||
create table t2 select * from t1 where 0=1 procedure analyse();
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`Field_name` varbinary(255) NOT NULL DEFAULT '',
|
||||
`Min_value` varbinary(255) DEFAULT NULL,
|
||||
`Max_value` varbinary(255) DEFAULT NULL,
|
||||
`Min_length` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Max_length` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Empties_or_zeros` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Nulls` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Avg_value_or_avg_length` varbinary(255) NOT NULL DEFAULT '',
|
||||
`Std` varbinary(255) DEFAULT NULL,
|
||||
`Optimal_fieldtype` varbinary(64) NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t1 where 0=1 procedure analyse();
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
insert into t1 values(1);
|
||||
drop table t2;
|
||||
create table t2 select * from t1 where 0=1 procedure analyse();
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`Field_name` varbinary(255) NOT NULL DEFAULT '',
|
||||
`Min_value` varbinary(255) DEFAULT NULL,
|
||||
`Max_value` varbinary(255) DEFAULT NULL,
|
||||
`Min_length` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Max_length` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Empties_or_zeros` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Nulls` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Avg_value_or_avg_length` varbinary(255) NOT NULL DEFAULT '',
|
||||
`Std` varbinary(255) DEFAULT NULL,
|
||||
`Optimal_fieldtype` varbinary(64) NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t2;
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
insert into t2 select * from t1 procedure analyse();
|
||||
select * from t2;
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.a 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL
|
||||
insert into t1 values(2);
|
||||
drop table t2;
|
||||
create table t2 select * from t1 where 0=1 procedure analyse();
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`Field_name` varbinary(255) NOT NULL DEFAULT '',
|
||||
`Min_value` varbinary(255) DEFAULT NULL,
|
||||
`Max_value` varbinary(255) DEFAULT NULL,
|
||||
`Min_length` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Max_length` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Empties_or_zeros` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Nulls` bigint(11) NOT NULL DEFAULT '0',
|
||||
`Avg_value_or_avg_length` varbinary(255) NOT NULL DEFAULT '',
|
||||
`Std` varbinary(255) DEFAULT NULL,
|
||||
`Optimal_fieldtype` varbinary(64) NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t2;
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
insert into t2 select * from t1 procedure analyse();
|
||||
select * from t2;
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.a 1 2 1 1 0 0 1.5000 0.5000 ENUM('1','2') NOT NULL
|
||||
drop table t1,t2;
|
||||
create table t1 (v varchar(128));
|
||||
insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd');
|
||||
select * from t1 procedure analyse();
|
||||
@ -157,3 +86,40 @@ SELECT * FROM (SELECT * FROM t1) d PROCEDURE ANALYSE();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
#
|
||||
# Bug #48293: crash with procedure analyse, view with > 10 columns,
|
||||
# having clause...
|
||||
#
|
||||
CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT,
|
||||
f INT, g INT, h INT, i INT, j INT,k INT);
|
||||
INSERT INTO t1 VALUES (),();
|
||||
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
|
||||
#should have a derived table
|
||||
EXPLAIN SELECT * FROM v1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||
#should not crash
|
||||
SELECT * FROM v1 PROCEDURE analyse();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and view
|
||||
#should not crash
|
||||
SELECT * FROM t1 a, v1, t1 b PROCEDURE analyse();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and view
|
||||
#should not crash
|
||||
SELECT * FROM (SELECT * FROM t1 having a > 1) x PROCEDURE analyse();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
#should not crash
|
||||
SELECT * FROM t1 a, (SELECT * FROM t1 having a > 1) x, t1 b PROCEDURE analyse();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
#should not crash
|
||||
SELECT 1 FROM t1 group by a having a > 1 order by 1 PROCEDURE analyse();
|
||||
ERROR HY000: Can't use ORDER clause with this procedure
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
# should not crash
|
||||
CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE();
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1,29 +0,0 @@
|
||||
#
|
||||
# Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
|
||||
# without error
|
||||
#
|
||||
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (a,b) VALUES (1070109,99);
|
||||
CREATE TABLE t2 (b int, a int, PRIMARY KEY (b)) ENGINE=InnoDB;
|
||||
INSERT INTO t2 (b,a) VALUES (7,1070109);
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1070109 99
|
||||
BEGIN;
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
b
|
||||
7
|
||||
BEGIN;
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
INSERT INTO t1 (a) VALUES ((SELECT a FROM t2 WHERE b=7));
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
UPDATE t1 SET a='7000000' WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
DELETE FROM t1 WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1070109 99
|
||||
DROP TABLE t2, t1;
|
||||
End of 5.0 tests
|
2
mysql-test/r/case_insensitive_fs.require
Normal file
2
mysql-test/r/case_insensitive_fs.require
Normal file
@ -0,0 +1,2 @@
|
||||
Variable_name Value
|
||||
lower_case_file_system ON
|
@ -41,6 +41,14 @@ efgh efgh
|
||||
ijkl ijkl
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#45645 Mysql server close all connection and restart using lower function
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8 COLLATE utf8_test_ci;
|
||||
INSERT INTO t1 (a) VALUES ('hello!');
|
||||
SELECT * FROM t1 WHERE LOWER(a)=LOWER('N');
|
||||
a
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#43827 Server closes connections and restarts
|
||||
#
|
||||
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
|
||||
|
26
mysql-test/r/deprecated_features.result
Normal file
26
mysql-test/r/deprecated_features.result
Normal file
@ -0,0 +1,26 @@
|
||||
set global log_bin_trust_routine_creators=1;
|
||||
ERROR HY000: Unknown system variable 'log_bin_trust_routine_creators'
|
||||
set table_type='MyISAM';
|
||||
ERROR HY000: Unknown system variable 'table_type'
|
||||
select @@table_type='MyISAM';
|
||||
ERROR HY000: Unknown system variable 'table_type'
|
||||
backup table t1 to 'data.txt';
|
||||
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 'backup table t1 to 'data.txt'' at line 1
|
||||
restore table t1 from 'data.txt';
|
||||
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 'restore table t1 from 'data.txt'' at line 1
|
||||
show plugin;
|
||||
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 'plugin' at line 1
|
||||
load table t1 from master;
|
||||
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 'table t1 from master' at line 1
|
||||
load data from master;
|
||||
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 master' at line 1
|
||||
SHOW INNODB STATUS;
|
||||
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 'INNODB STATUS' at line 1
|
||||
create table t1 (t6 timestamp(6));
|
||||
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 '(6))' at line 1
|
||||
create table t1 (t6 timestamp) type=myisam;
|
||||
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 'type=myisam' at line 1
|
||||
show table types;
|
||||
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 'types' at line 1
|
||||
show mutex status;
|
||||
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 'mutex status' at line 1
|
@ -194,4 +194,20 @@ dt
|
||||
2001-01-01 01:01:01
|
||||
2001-01-01 01:01:01
|
||||
drop tables t1, t2;
|
||||
#
|
||||
# Bug#48295:
|
||||
# explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
|
||||
#
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1
|
||||
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
|
||||
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests.
|
||||
|
@ -4,11 +4,9 @@ show variables like 'log_bin%';
|
||||
Variable_name Value
|
||||
log_bin OFF
|
||||
log_bin_trust_function_creators ON
|
||||
log_bin_trust_routine_creators ON
|
||||
flush logs;
|
||||
show variables like 'log_bin%';
|
||||
Variable_name Value
|
||||
log_bin OFF
|
||||
log_bin_trust_function_creators ON
|
||||
log_bin_trust_routine_creators ON
|
||||
set global expire_logs_days = 0;
|
||||
|
@ -1487,4 +1487,43 @@ MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
|
||||
COUNT(*)
|
||||
2
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #48258: Assertion failed when using a spatial index
|
||||
#
|
||||
CREATE TABLE t1(a LINESTRING NOT NULL, SPATIAL KEY(a));
|
||||
INSERT INTO t1 VALUES
|
||||
(GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')),
|
||||
(GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'));
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
|
||||
SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
1
|
||||
1
|
||||
1
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
|
||||
SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
1
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
|
||||
SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
1
|
||||
1
|
||||
1
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
|
||||
SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
1
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
|
||||
SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
|
||||
1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
|
@ -972,6 +972,18 @@ select min(`col002`) from t1 union select `col002` from t1;
|
||||
min(`col002`)
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #47780: crash when comparing GIS items from subquery
|
||||
#
|
||||
CREATE TABLE t1(a INT, b MULTIPOLYGON);
|
||||
INSERT INTO t1 VALUES
|
||||
(0,
|
||||
GEOMFROMTEXT(
|
||||
'multipolygon(((1 2,3 4,5 6,7 8,9 8),(7 6,5 4,3 2,1 2,3 4)))'));
|
||||
# must not crash
|
||||
SELECT 1 FROM t1 WHERE a <> (SELECT GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
|
||||
create view v1 as select * from t1;
|
||||
|
@ -1007,8 +1007,8 @@ DROP TABLE mysqltest1.t2;
|
||||
SHOW GRANTS;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
|
||||
RENAME TABLE t1 TO t2;
|
||||
RENAME TABLE t2 TO t1;
|
||||
ALTER TABLE t1 RENAME TO t2;
|
||||
@ -1018,8 +1018,8 @@ REVOKE DROP, INSERT ON mysqltest1.t2 FROM mysqltest_1@localhost;
|
||||
SHOW GRANTS;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
|
||||
GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
|
||||
RENAME TABLE t1 TO t2;
|
||||
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
|
||||
ALTER TABLE t1 RENAME TO t2;
|
||||
|
@ -154,4 +154,42 @@ SELECT * FROM mysqltest_1.t1;
|
||||
a
|
||||
DROP USER 'mysqltest1'@'%';
|
||||
DROP DATABASE mysqltest_1;
|
||||
#
|
||||
# Bug#41597 - After rename of user, there are additional grants
|
||||
# when grants are reapplied.
|
||||
#
|
||||
CREATE DATABASE temp;
|
||||
CREATE TABLE temp.t1(a INT, b VARCHAR(10));
|
||||
INSERT INTO temp.t1 VALUES(1, 'name1');
|
||||
INSERT INTO temp.t1 VALUES(2, 'name2');
|
||||
INSERT INTO temp.t1 VALUES(3, 'name3');
|
||||
CREATE USER 'user1'@'%';
|
||||
RENAME USER 'user1'@'%' TO 'user2'@'%';
|
||||
# Show privileges after rename and BEFORE grant
|
||||
SHOW GRANTS FOR 'user2'@'%';
|
||||
Grants for user2@%
|
||||
GRANT USAGE ON *.* TO 'user2'@'%'
|
||||
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%';
|
||||
# Show privileges after rename and grant
|
||||
SHOW GRANTS FOR 'user2'@'%';
|
||||
Grants for user2@%
|
||||
GRANT USAGE ON *.* TO 'user2'@'%'
|
||||
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%'
|
||||
# Connect as the renamed user
|
||||
SHOW GRANTS;
|
||||
Grants for user2@%
|
||||
GRANT USAGE ON *.* TO 'user2'@'%'
|
||||
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%'
|
||||
SELECT a FROM temp.t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
# Check for additional privileges by accessing a
|
||||
# non privileged column. We shouldn't be able to
|
||||
# access this column.
|
||||
SELECT b FROM temp.t1;
|
||||
ERROR 42000: SELECT command denied to user 'user2'@'localhost' for column 'b' in table 't1'
|
||||
DROP USER 'user2'@'%';
|
||||
DROP DATABASE temp;
|
||||
End of 5.0 tests
|
||||
|
16
mysql-test/r/grant_lowercase_fs.result
Normal file
16
mysql-test/r/grant_lowercase_fs.result
Normal file
@ -0,0 +1,16 @@
|
||||
create database db1;
|
||||
GRANT CREATE ON db1.* to user_1@localhost;
|
||||
GRANT SELECT ON db1.* to USER_1@localhost;
|
||||
CREATE TABLE t1(f1 int);
|
||||
SELECT * FROM t1;
|
||||
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
|
||||
SELECT * FROM t1;
|
||||
f1
|
||||
CREATE TABLE t2(f1 int);
|
||||
ERROR 42000: CREATE command denied to user 'USER_1'@'localhost' for table 't2'
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
|
||||
DROP USER user_1@localhost;
|
||||
DROP USER USER_1@localhost;
|
||||
DROP DATABASE db1;
|
||||
use test;
|
@ -867,6 +867,7 @@ INSERT INTO t2 SELECT NULL FROM t1;
|
||||
Got one of the listed errors
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (null);
|
||||
INSERT INTO t1 VALUES (null);
|
||||
@ -882,6 +883,12 @@ d1
|
||||
INSERT INTO t1 VALUES(null);
|
||||
Got one of the listed errors
|
||||
ALTER TABLE t1 AUTO_INCREMENT = 3;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`d1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`d1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1;
|
||||
d1
|
||||
@ -889,3 +896,233 @@ d1
|
||||
3
|
||||
4
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
INSERT INTO t1 VALUES (-127, 'innodb');
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
-127 innodb
|
||||
-1 innodb
|
||||
1 NULL
|
||||
2 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (-127, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 NULL
|
||||
2 innodb
|
||||
3 innodb
|
||||
4 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
INSERT INTO t1 VALUES (-32767, 'innodb');
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` smallint(6) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
-32767 innodb
|
||||
-1 innodb
|
||||
1 NULL
|
||||
2 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (-32757, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 NULL
|
||||
2 innodb
|
||||
3 innodb
|
||||
4 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
INSERT INTO t1 VALUES (-8388607, 'innodb');
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` mediumint(9) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
-8388607 innodb
|
||||
-1 innodb
|
||||
1 NULL
|
||||
2 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (-8388607, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 NULL
|
||||
2 innodb
|
||||
3 innodb
|
||||
4 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
INSERT INTO t1 VALUES (-2147483647, 'innodb');
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
-2147483647 innodb
|
||||
-1 innodb
|
||||
1 NULL
|
||||
2 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (-2147483647, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 NULL
|
||||
2 innodb
|
||||
3 innodb
|
||||
4 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
-9223372036854775807 innodb
|
||||
-1 innodb
|
||||
1 NULL
|
||||
2 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (-1, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 NULL
|
||||
2 innodb
|
||||
3 innodb
|
||||
4 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE T1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
|
||||
CREATE INDEX i1 on T1(c2);
|
||||
SHOW CREATE TABLE T1;
|
||||
Table Create Table
|
||||
T1 CREATE TABLE `T1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`),
|
||||
KEY `i1` (`c2`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
|
||||
INSERT INTO T1 (c2) values (0);
|
||||
SELECT * FROM T1;
|
||||
c1 c2
|
||||
10 0
|
||||
DROP TABLE T1;
|
||||
|
@ -2,13 +2,13 @@ create table bug44369 (DB_ROW_ID int) engine=innodb;
|
||||
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
|
||||
create table bug44369 (db_row_id int) engine=innodb;
|
||||
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1005 Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
|
||||
Warning 1005 Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
|
||||
Error 1005 Can't create table 'test.bug44369' (errno: -1)
|
||||
create table bug44369 (db_TRX_Id int) engine=innodb;
|
||||
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1005 Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
|
||||
Warning 1005 Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
|
||||
Error 1005 Can't create table 'test.bug44369' (errno: -1)
|
||||
|
@ -2,16 +2,16 @@ create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
|
||||
ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
|
||||
create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
|
||||
ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
|
||||
Warning 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
|
||||
Error 1005 Can't create table 'test.bug46000' (errno: -1)
|
||||
create table bug46000(id int) engine=innodb;
|
||||
create index GEN_CLUST_INDEX on bug46000(id);
|
||||
ERROR HY000: Can't create table '#sql-temporary' (errno: -1)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
|
||||
Warning 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
|
||||
Error 1005 Can't create table '#sql-temporary' (errno: -1)
|
||||
create index idx on bug46000(id);
|
||||
drop table bug46000;
|
||||
|
13
mysql-test/r/innodb_bug47777.result
Normal file
13
mysql-test/r/innodb_bug47777.result
Normal file
@ -0,0 +1,13 @@
|
||||
create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
|
||||
insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'));
|
||||
select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
|
||||
count(*)
|
||||
1
|
||||
update bug47777 set c2=GeomFromText('POINT(1 1)');
|
||||
select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
|
||||
count(*)
|
||||
0
|
||||
select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)');
|
||||
count(*)
|
||||
1
|
||||
drop table bug47777;
|
357
mysql-test/r/innodb_lock_wait_timeout_1.result
Normal file
357
mysql-test/r/innodb_lock_wait_timeout_1.result
Normal file
@ -0,0 +1,357 @@
|
||||
#
|
||||
# Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
|
||||
# without error
|
||||
#
|
||||
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (a,b) VALUES (1070109,99);
|
||||
CREATE TABLE t2 (b int, a int, PRIMARY KEY (b)) ENGINE=InnoDB;
|
||||
INSERT INTO t2 (b,a) VALUES (7,1070109);
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1070109 99
|
||||
BEGIN;
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
b
|
||||
7
|
||||
BEGIN;
|
||||
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
INSERT INTO t1 (a) VALUES ((SELECT a FROM t2 WHERE b=7));
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
UPDATE t1 SET a='7000000' WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
DELETE FROM t1 WHERE a=(SELECT a FROM t2 WHERE b=7);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1070109 99
|
||||
DROP TABLE t2, t1;
|
||||
# End of 5.0 tests
|
||||
#
|
||||
# Bug#46539 Various crashes on INSERT IGNORE SELECT + SELECT
|
||||
# FOR UPDATE
|
||||
#
|
||||
drop table if exists t1;
|
||||
create table t1 (a int primary key auto_increment,
|
||||
b int, index(b)) engine=innodb;
|
||||
insert into t1 (b) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
set autocommit=0;
|
||||
begin;
|
||||
select * from t1 where b=5 for update;
|
||||
a b
|
||||
5 5
|
||||
insert ignore into t1 (b) select a as b from t1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
# Cleanup
|
||||
#
|
||||
commit;
|
||||
set autocommit=default;
|
||||
drop table t1;
|
||||
#
|
||||
# Bug#41756 Strange error messages about locks from InnoDB
|
||||
#
|
||||
drop table if exists t1;
|
||||
# In the default transaction isolation mode, and/or with
|
||||
# innodb_locks_unsafe_for_binlog=OFF, handler::unlock_row()
|
||||
# in InnoDB does nothing.
|
||||
# Thus in order to reproduce the condition that led to the
|
||||
# warning, one needs to relax isolation by either
|
||||
# setting a weaker tx_isolation value, or by turning on
|
||||
# the unsafe replication switch.
|
||||
# For testing purposes, choose to tweak the isolation level,
|
||||
# since it's settable at runtime, unlike
|
||||
# innodb_locks_unsafe_for_binlog, which is
|
||||
# only a command-line switch.
|
||||
#
|
||||
set @@session.tx_isolation="read-committed";
|
||||
# Prepare data. We need a table with a unique index,
|
||||
# for join_read_key to be used. The other column
|
||||
# allows to control what passes WHERE clause filter.
|
||||
create table t1 (a int primary key, b int) engine=innodb;
|
||||
# Let's make sure t1 has sufficient amount of rows
|
||||
# to exclude JT_ALL access method when reading it,
|
||||
# i.e. make sure that JT_EQ_REF(a) is always preferred.
|
||||
insert into t1 values (1,1), (2,null), (3,1), (4,1),
|
||||
(5,1), (6,1), (7,1), (8,1), (9,1), (10,1),
|
||||
(11,1), (12,1), (13,1), (14,1), (15,1),
|
||||
(16,1), (17,1), (18,1), (19,1), (20,1);
|
||||
#
|
||||
# Demonstrate that for the SELECT statement
|
||||
# used later in the test JT_EQ_REF access method is used.
|
||||
#
|
||||
explain
|
||||
select 1 from t1 natural join (select 2 as a, 1 as b union all
|
||||
select 2 as a, 2 as b) as t2 for update;
|
||||
id 1
|
||||
select_type PRIMARY
|
||||
table <derived2>
|
||||
type ALL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows 2
|
||||
Extra
|
||||
id 1
|
||||
select_type PRIMARY
|
||||
table t1
|
||||
type eq_ref
|
||||
possible_keys PRIMARY
|
||||
key PRIMARY
|
||||
key_len 4
|
||||
ref t2.a
|
||||
rows 1
|
||||
Extra Using where
|
||||
id 2
|
||||
select_type DERIVED
|
||||
table NULL
|
||||
type NULL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows NULL
|
||||
Extra No tables used
|
||||
id 3
|
||||
select_type UNION
|
||||
table NULL
|
||||
type NULL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows NULL
|
||||
Extra No tables used
|
||||
id NULL
|
||||
select_type UNION RESULT
|
||||
table <union2,3>
|
||||
type ALL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows NULL
|
||||
Extra
|
||||
#
|
||||
# Demonstrate that the reported SELECT statement
|
||||
# no longer produces warnings.
|
||||
#
|
||||
select 1 from t1 natural join (select 2 as a, 1 as b union all
|
||||
select 2 as a, 2 as b) as t2 for update;
|
||||
1
|
||||
commit;
|
||||
#
|
||||
# Demonstrate that due to lack of inter-sweep "reset" function,
|
||||
# we keep some non-matching records locked, even though we know
|
||||
# we could unlock them.
|
||||
# To do that, show that if there is only one distinct value
|
||||
# for a in t2 (a=2), we will keep record (2,null) in t1 locked.
|
||||
# But if we add another value for "a" to t2, say 6,
|
||||
# join_read_key cache will be pruned at least once,
|
||||
# and thus record (2, null) in t1 will get unlocked.
|
||||
#
|
||||
begin;
|
||||
select 1 from t1 natural join (select 2 as a, 1 as b union all
|
||||
select 2 as a, 2 as b) as t2 for update;
|
||||
1
|
||||
#
|
||||
# Switching to connection con1
|
||||
# We should be able to delete all records from t1 except (2, null),
|
||||
# since they were not locked.
|
||||
begin;
|
||||
# Delete in series of 3 records so that full scan
|
||||
# is not used and we're not blocked on record (2,null)
|
||||
delete from t1 where a in (1,3,4);
|
||||
delete from t1 where a in (5,6,7);
|
||||
delete from t1 where a in (8,9,10);
|
||||
delete from t1 where a in (11,12,13);
|
||||
delete from t1 where a in (14,15,16);
|
||||
delete from t1 where a in (17,18);
|
||||
delete from t1 where a in (19,20);
|
||||
#
|
||||
# Record (2, null) is locked. This is actually unnecessary,
|
||||
# because the previous select returned no rows.
|
||||
# Just demonstrate the effect.
|
||||
#
|
||||
delete from t1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
rollback;
|
||||
#
|
||||
# Switching to connection default
|
||||
#
|
||||
# Show that the original contents of t1 is intact:
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
2 NULL
|
||||
3 1
|
||||
4 1
|
||||
5 1
|
||||
6 1
|
||||
7 1
|
||||
8 1
|
||||
9 1
|
||||
10 1
|
||||
11 1
|
||||
12 1
|
||||
13 1
|
||||
14 1
|
||||
15 1
|
||||
16 1
|
||||
17 1
|
||||
18 1
|
||||
19 1
|
||||
20 1
|
||||
commit;
|
||||
#
|
||||
# Have a one more record in t2 to show that
|
||||
# if join_read_key cache is purned, the current
|
||||
# row under the cursor is unlocked (provided, this row didn't
|
||||
# match the partial WHERE clause, of course).
|
||||
# Sic: the result of this test dependent on the order of retrieval
|
||||
# of records --echo # from the derived table, if !
|
||||
# We use DELETE to disable the JOIN CACHE. This DELETE modifies no
|
||||
# records. It also should leave no InnoDB row locks.
|
||||
#
|
||||
begin;
|
||||
delete t1.* from t1 natural join (select 2 as a, 2 as b union all
|
||||
select 0 as a, 0 as b) as t2;
|
||||
# Demonstrate that nothing was deleted form t1
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
2 NULL
|
||||
3 1
|
||||
4 1
|
||||
5 1
|
||||
6 1
|
||||
7 1
|
||||
8 1
|
||||
9 1
|
||||
10 1
|
||||
11 1
|
||||
12 1
|
||||
13 1
|
||||
14 1
|
||||
15 1
|
||||
16 1
|
||||
17 1
|
||||
18 1
|
||||
19 1
|
||||
20 1
|
||||
#
|
||||
# Switching to connection con1
|
||||
begin;
|
||||
# Since there is another distinct record in the derived table
|
||||
# the previous matching record in t1 -- (2,null) -- was unlocked.
|
||||
delete from t1;
|
||||
# We will need the contents of the table again.
|
||||
rollback;
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
2 NULL
|
||||
3 1
|
||||
4 1
|
||||
5 1
|
||||
6 1
|
||||
7 1
|
||||
8 1
|
||||
9 1
|
||||
10 1
|
||||
11 1
|
||||
12 1
|
||||
13 1
|
||||
14 1
|
||||
15 1
|
||||
16 1
|
||||
17 1
|
||||
18 1
|
||||
19 1
|
||||
20 1
|
||||
commit;
|
||||
#
|
||||
# Switching to connection default
|
||||
rollback;
|
||||
begin;
|
||||
#
|
||||
# Before this patch, we could wrongly unlock a record
|
||||
# that was cached and later used in a join. Demonstrate that
|
||||
# this is no longer the case.
|
||||
# Sic: this test is also order-dependent (i.e. the
|
||||
# the bug would show up only if the first record in the union
|
||||
# is retreived and processed first.
|
||||
#
|
||||
# Verify that JT_EQ_REF is used.
|
||||
explain
|
||||
select 1 from t1 natural join (select 3 as a, 2 as b union all
|
||||
select 3 as a, 1 as b) as t2 for update;
|
||||
id 1
|
||||
select_type PRIMARY
|
||||
table <derived2>
|
||||
type ALL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows 2
|
||||
Extra
|
||||
id 1
|
||||
select_type PRIMARY
|
||||
table t1
|
||||
type eq_ref
|
||||
possible_keys PRIMARY
|
||||
key PRIMARY
|
||||
key_len 4
|
||||
ref t2.a
|
||||
rows 1
|
||||
Extra Using where
|
||||
id 2
|
||||
select_type DERIVED
|
||||
table NULL
|
||||
type NULL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows NULL
|
||||
Extra No tables used
|
||||
id 3
|
||||
select_type UNION
|
||||
table NULL
|
||||
type NULL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows NULL
|
||||
Extra No tables used
|
||||
id NULL
|
||||
select_type UNION RESULT
|
||||
table <union2,3>
|
||||
type ALL
|
||||
possible_keys NULL
|
||||
key NULL
|
||||
key_len NULL
|
||||
ref NULL
|
||||
rows NULL
|
||||
Extra
|
||||
# Lock the record.
|
||||
select 1 from t1 natural join (select 3 as a, 2 as b union all
|
||||
select 3 as a, 1 as b) as t2 for update;
|
||||
1
|
||||
1
|
||||
# Switching to connection con1
|
||||
#
|
||||
# We should not be able to delete record (3,1) from t1,
|
||||
# (previously it was possible).
|
||||
#
|
||||
delete from t1 where a=3;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
# Switching to connection default
|
||||
commit;
|
||||
set @@session.tx_isolation=default;
|
||||
drop table t1;
|
||||
#
|
||||
# End of 5.1 tests
|
||||
#
|
@ -2209,4 +2209,46 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(PRIMARY) WHERE b=1 AND c=1 ORDER BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 128 Using where
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #47963: Wrong results when index is used
|
||||
#
|
||||
CREATE TABLE t1(
|
||||
a VARCHAR(5) NOT NULL,
|
||||
b VARCHAR(5) NOT NULL,
|
||||
c DATETIME NOT NULL,
|
||||
KEY (c)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES('TEST', 'TEST', '2009-10-09 00:00:00');
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00' AND c <= '2009-10-09 00:00:00';
|
||||
a b c
|
||||
TEST TEST 2009-10-09 00:00:00
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.0' AND c <= '2009-10-09 00:00:00.0';
|
||||
a b c
|
||||
TEST TEST 2009-10-09 00:00:00
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.0' AND c <= '2009-10-09 00:00:00';
|
||||
a b c
|
||||
TEST TEST 2009-10-09 00:00:00
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00' AND c <= '2009-10-09 00:00:00.0';
|
||||
a b c
|
||||
TEST TEST 2009-10-09 00:00:00
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.000' AND c <= '2009-10-09 00:00:00.000';
|
||||
a b c
|
||||
TEST TEST 2009-10-09 00:00:00
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.00' AND c <= '2009-10-09 00:00:00.001';
|
||||
a b c
|
||||
TEST TEST 2009-10-09 00:00:00
|
||||
SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.001' AND c <= '2009-10-09 00:00:00.00';
|
||||
a b c
|
||||
EXPLAIN SELECT * FROM t1 WHERE a = 'TEST' AND
|
||||
c >= '2009-10-09 00:00:00.001' AND c <= '2009-10-09 00:00:00.00';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -1063,6 +1063,60 @@ a b c d
|
||||
127 NULL 127 NULL
|
||||
128 NULL 128 NULL
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
#
|
||||
# Bug #42116: Mysql crash on specific query
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT);
|
||||
CREATE TABLE t3 (a INT, INDEX (a));
|
||||
CREATE TABLE t4 (a INT);
|
||||
CREATE TABLE t5 (a INT);
|
||||
CREATE TABLE t6 (a INT);
|
||||
INSERT INTO t1 VALUES (1), (1), (1);
|
||||
INSERT INTO t2 VALUES
|
||||
(2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
|
||||
INSERT INTO t3 VALUES
|
||||
(3), (3), (3), (3), (3), (3), (3), (3), (3), (3);
|
||||
EXPLAIN
|
||||
SELECT *
|
||||
FROM
|
||||
t1 JOIN t2 ON t1.a = t2.a
|
||||
LEFT JOIN
|
||||
(
|
||||
(
|
||||
t3 LEFT JOIN t4 ON t3.a = t4.a
|
||||
)
|
||||
LEFT JOIN
|
||||
(
|
||||
t5 LEFT JOIN t6 ON t5.a = t6.a
|
||||
)
|
||||
ON t4.a = t5.a
|
||||
)
|
||||
ON t1.a = t3.a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t3 ref a a 5 test.t1.a 2 Using index
|
||||
1 SIMPLE t4 ALL NULL NULL NULL NULL 0
|
||||
1 SIMPLE t5 ALL NULL NULL NULL NULL 0
|
||||
1 SIMPLE t6 ALL NULL NULL NULL NULL 0
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where; Using join buffer
|
||||
SELECT *
|
||||
FROM
|
||||
t1 JOIN t2 ON t1.a = t2.a
|
||||
LEFT JOIN
|
||||
(
|
||||
(
|
||||
t3 LEFT JOIN t4 ON t3.a = t4.a
|
||||
)
|
||||
LEFT JOIN
|
||||
(
|
||||
t5 LEFT JOIN t6 ON t5.a = t6.a
|
||||
)
|
||||
ON t4.a = t5.a
|
||||
)
|
||||
ON t1.a = t3.a;
|
||||
a a a a a a
|
||||
DROP TABLE t1,t2,t3,t4,t5,t6;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (f1 int);
|
||||
CREATE TABLE t2 (f1 int);
|
||||
|
29
mysql-test/r/locale.result
Normal file
29
mysql-test/r/locale.result
Normal file
@ -0,0 +1,29 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Start of 5.4 tests
|
||||
#
|
||||
# Bug#43207 wrong LC_TIME names for romanian locale
|
||||
#
|
||||
SET NAMES utf8;
|
||||
SET lc_time_names=ro_RO;
|
||||
SELECT DATE_FORMAT('2001-01-01', '%w %a %W');
|
||||
DATE_FORMAT('2001-01-01', '%w %a %W')
|
||||
1 Lu Luni
|
||||
SELECT DATE_FORMAT('2001-01-02', '%w %a %W');
|
||||
DATE_FORMAT('2001-01-02', '%w %a %W')
|
||||
2 Ma Marţi
|
||||
SELECT DATE_FORMAT('2001-01-03', '%w %a %W');
|
||||
DATE_FORMAT('2001-01-03', '%w %a %W')
|
||||
3 Mi Miercuri
|
||||
SELECT DATE_FORMAT('2001-01-04', '%w %a %W');
|
||||
DATE_FORMAT('2001-01-04', '%w %a %W')
|
||||
4 Jo Joi
|
||||
SELECT DATE_FORMAT('2001-01-05', '%w %a %W');
|
||||
DATE_FORMAT('2001-01-05', '%w %a %W')
|
||||
5 Vi Vineri
|
||||
SELECT DATE_FORMAT('2001-01-06', '%w %a %W');
|
||||
DATE_FORMAT('2001-01-06', '%w %a %W')
|
||||
6 Sâ Sâmbătă
|
||||
SELECT DATE_FORMAT('2001-01-07', '%w %a %W');
|
||||
DATE_FORMAT('2001-01-07', '%w %a %W')
|
||||
0 Du Duminică
|
||||
End of 5.4 tests
|
@ -10,3 +10,48 @@ create database D1;
|
||||
ERROR 42000: Access denied for user 'sample'@'localhost' to database 'D1'
|
||||
drop user 'sample'@'localhost';
|
||||
drop database if exists d1;
|
||||
CREATE DATABASE d1;
|
||||
USE d1;
|
||||
CREATE TABLE T1(f1 INT);
|
||||
CREATE TABLE t1(f1 INT);
|
||||
GRANT SELECT ON T1 to user_1@localhost;
|
||||
select * from t1;
|
||||
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
|
||||
select * from T1;
|
||||
f1
|
||||
GRANT SELECT ON t1 to user_1@localhost;
|
||||
select * from information_schema.table_privileges;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user_1'@'localhost' NULL d1 T1 SELECT NO
|
||||
'user_1'@'localhost' NULL d1 t1 SELECT NO
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
|
||||
DROP USER user_1@localhost;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
CREATE DATABASE db1;
|
||||
USE db1;
|
||||
CREATE PROCEDURE p1() BEGIN END;
|
||||
CREATE FUNCTION f1(i INT) RETURNS INT RETURN i+1;
|
||||
GRANT USAGE ON db1.* to user_1@localhost;
|
||||
GRANT EXECUTE ON PROCEDURE db1.P1 to user_1@localhost;
|
||||
GRANT EXECUTE ON FUNCTION db1.f1 to user_1@localhost;
|
||||
GRANT UPDATE ON db1.* to USER_1@localhost;
|
||||
call p1();
|
||||
call P1();
|
||||
select f1(1);
|
||||
f1(1)
|
||||
2
|
||||
call p1();
|
||||
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.p1'
|
||||
call P1();
|
||||
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.p1'
|
||||
select f1(1);
|
||||
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.f1'
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
|
||||
DROP FUNCTION f1;
|
||||
DROP PROCEDURE p1;
|
||||
DROP USER user_1@localhost;
|
||||
DROP USER USER_1@localhost;
|
||||
DROP DATABASE db1;
|
||||
use test;
|
||||
|
@ -2290,6 +2290,12 @@ Table Op Msg_type Msg_text
|
||||
test.t1 repair error myisam_sort_buffer_size is too small
|
||||
test.t1 repair warning Number of rows changed from 0 to 7168
|
||||
test.t1 repair status OK
|
||||
SET myisam_repair_threads=2;
|
||||
REPAIR TABLE t1;
|
||||
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
||||
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -15,31 +15,13 @@ SET SESSION debug="d,crash_before_flush_keys";
|
||||
# Run the crashing query
|
||||
FLUSH TABLE t1;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
# Run MYISAMCHK tool to check the table t1 and repair
|
||||
myisamchk: MyISAM file MYSQLD_DATADIR/test/t1
|
||||
myisamchk: warning: 1 client is using or hasn't closed the table properly
|
||||
myisamchk: error: Size of indexfile is: 1024 Should be: 3072
|
||||
MYISAMCHK: Unknown error 126
|
||||
myisamchk: error: Can't read indexpage from filepos: 1024
|
||||
MyISAM-table 'MYSQLD_DATADIR/test/t1' is corrupted
|
||||
Fix it using switch "-r" or "-o"
|
||||
# Write file to make mysql-test-run.pl start the server
|
||||
# Turn on reconnect
|
||||
# Call script that will poll the server waiting for
|
||||
# it to be back online again
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`a`,`b`),
|
||||
KEY `b` (`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1
|
||||
SELECT * FROM t1 FORCE INDEX (PRIMARY);
|
||||
a b
|
||||
1 2
|
||||
2 3
|
||||
3 4
|
||||
4 5
|
||||
5 6
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check warning 1 client is using or hasn't closed the table properly
|
||||
test.t1 check error Size of indexfile is: 1024 Should be: 3072
|
||||
test.t1 check error Corrupt
|
||||
DROP TABLE t1;
|
||||
|
@ -733,4 +733,24 @@ SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #48131: crash group by with rollup, distinct,
|
||||
# filesort, with temporary tables
|
||||
#
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
CREATE TABLE t2 (b INT);
|
||||
INSERT INTO t2 VALUES (100);
|
||||
SELECT a, b FROM t1, t2 GROUP BY a, b WITH ROLLUP;
|
||||
a b
|
||||
1 100
|
||||
1 NULL
|
||||
2 100
|
||||
2 NULL
|
||||
NULL NULL
|
||||
SELECT DISTINCT b FROM t1, t2 GROUP BY a, b WITH ROLLUP;
|
||||
b
|
||||
100
|
||||
NULL
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
|
@ -1272,10 +1272,9 @@ INSERT INTO t1 VALUES (1, '2009-01-01'), (2, NULL);
|
||||
# test with an invalid date, which lead to item->null_value is set.
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-99' AS DATETIME);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p20090401 ALL NULL NULL NULL NULL 2 Using where
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '2009-04-99'
|
||||
Warning 1292 Incorrect datetime value: '2009-04-99'
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1
|
||||
(a INT NOT NULL AUTO_INCREMENT,
|
||||
|
@ -409,8 +409,6 @@ prepare stmt1 from ' optimize table t1 ' ;
|
||||
prepare stmt1 from ' analyze table t1 ' ;
|
||||
prepare stmt1 from ' checksum table t1 ' ;
|
||||
prepare stmt1 from ' repair table t1 ' ;
|
||||
prepare stmt1 from ' restore table t1 from ''<MYSQLTEST_VARDIR>/tmp/data.txt'' ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' handler t1 open ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt3 from ' commit ' ;
|
||||
|
@ -32,19 +32,19 @@ identified by 'looser' ;
|
||||
show grants for second_user@localhost ;
|
||||
Grants for second_user@localhost
|
||||
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
|
||||
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
|
||||
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
|
||||
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
|
||||
drop table mysqltest.t9 ;
|
||||
show grants for second_user@localhost ;
|
||||
Grants for second_user@localhost
|
||||
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
|
||||
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
|
||||
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
|
||||
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
|
||||
show grants for second_user@localhost ;
|
||||
Grants for second_user@localhost
|
||||
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
|
||||
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
|
||||
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
|
||||
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
|
||||
prepare s_t1 from 'select a as my_col from t1' ;
|
||||
execute s_t1 ;
|
||||
my_col
|
||||
|
@ -1708,6 +1708,7 @@ Qcache_hits 2
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL query_cache_size= default;
|
||||
End of 5.0 tests
|
||||
SET GLOBAL query_cache_size=1024*1024*512;
|
||||
CREATE TABLE t1 (a ENUM('rainbow'));
|
||||
INSERT INTO t1 VALUES (),(),(),(),();
|
||||
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
|
||||
@ -1722,4 +1723,5 @@ SELECT 1 FROM t1 GROUP BY
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL query_cache_size= default;
|
||||
End of 5.1 tests
|
||||
|
@ -1398,3 +1398,209 @@ a < 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t3 range a a 5 NULL 8 Using where; Using index
|
||||
DROP TABLE t1, t2, t3;
|
||||
#
|
||||
# Bug #47123: Endless 100% CPU loop with STRAIGHT_JOIN
|
||||
#
|
||||
CREATE TABLE t1(a INT, KEY(a));
|
||||
INSERT INTO t1 VALUES (1), (NULL);
|
||||
SELECT * FROM t1 WHERE a <> NULL and (a <> NULL or a <= NULL);
|
||||
a
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#47925: regression of range optimizer and date comparison in 5.1.39!
|
||||
#
|
||||
CREATE TABLE t1 ( a DATE, KEY ( a ) );
|
||||
CREATE TABLE t2 ( a DATETIME, KEY ( a ) );
|
||||
# Make optimizer choose range scan
|
||||
INSERT INTO t1 VALUES ('2009-09-22'), ('2009-09-22'), ('2009-09-22');
|
||||
INSERT INTO t1 VALUES ('2009-09-23'), ('2009-09-23'), ('2009-09-23');
|
||||
INSERT INTO t2 VALUES ('2009-09-22 12:00:00'), ('2009-09-22 12:00:00'),
|
||||
('2009-09-22 12:00:00');
|
||||
INSERT INTO t2 VALUES ('2009-09-23 12:00:00'), ('2009-09-23 12:00:00'),
|
||||
('2009-09-23 12:00:00');
|
||||
# DATE vs DATE
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE a >= '2009/09/23';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
X X X range a a X X X X
|
||||
SELECT * FROM t1 WHERE a >= '2009/09/23';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '20090923';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= 20090923;
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '2009-9-23';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '2009.09.23';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '2009:09:23';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
# DATE vs DATETIME
|
||||
EXPLAIN
|
||||
SELECT * FROM t2 WHERE a >= '2009/09/23';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
X X X range a a X X X X
|
||||
SELECT * FROM t2 WHERE a >= '2009/09/23';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '2009/09/23';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '20090923';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= 20090923;
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '2009-9-23';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '2009.09.23';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '2009:09:23';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
# DATETIME vs DATETIME
|
||||
EXPLAIN
|
||||
SELECT * FROM t2 WHERE a >= '2009/09/23 12:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
X X X range a a X X X X
|
||||
SELECT * FROM t2 WHERE a >= '2009/09/23 12:00:00';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '20090923120000';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= 20090923120000;
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '2009-9-23 12:00:00';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '2009.09.23 12:00:00';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
SELECT * FROM t2 WHERE a >= '2009:09:23 12:00:00';
|
||||
a
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
2009-09-23 12:00:00
|
||||
# DATETIME vs DATE
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE a >= '2009/09/23 00:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
X X X range a a X X X X
|
||||
SELECT * FROM t1 WHERE a >= '2009/09/23 00:00:00';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '2009/09/23 00:00:00';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '20090923000000';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= 20090923000000;
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '2009-9-23 00:00:00';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '2009.09.23 00:00:00';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
SELECT * FROM t1 WHERE a >= '2009:09:23 00:00:00';
|
||||
a
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
2009-09-23
|
||||
# Test of the new get_date_from_str implementation
|
||||
# Behavior differs slightly between the trunk and mysql-pe.
|
||||
# The former may give errors for the truncated values, while the latter
|
||||
# gives warnings. The purpose of this test is not to interfere, and only
|
||||
# preserve existing behavior.
|
||||
SELECT str_to_date('2007-10-00', '%Y-%m-%d') >= '' AND
|
||||
str_to_date('2007-10-00', '%Y-%m-%d') <= '2007/10/20';
|
||||
str_to_date('2007-10-00', '%Y-%m-%d') >= '' AND
|
||||
str_to_date('2007-10-00', '%Y-%m-%d') <= '2007/10/20'
|
||||
1
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect date value: ''
|
||||
SELECT str_to_date('2007-20-00', '%Y-%m-%d') >= '2007/10/20' AND
|
||||
str_to_date('2007-20-00', '%Y-%m-%d') <= '';
|
||||
str_to_date('2007-20-00', '%Y-%m-%d') >= '2007/10/20' AND
|
||||
str_to_date('2007-20-00', '%Y-%m-%d') <= ''
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect date value: ''
|
||||
Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
|
||||
Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
|
||||
SELECT str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20';
|
||||
str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20'
|
||||
1
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: ''
|
||||
SELECT str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND '';
|
||||
str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND ''
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
|
||||
SELECT str_to_date('', '%Y-%m-%d');
|
||||
str_to_date('', '%Y-%m-%d')
|
||||
0000-00-00
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.1 tests
|
||||
|
@ -4386,6 +4386,47 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when
|
||||
# forcing a spatial index
|
||||
#
|
||||
CREATE TABLE t1(a LINESTRING NOT NULL, SPATIAL KEY(a));
|
||||
INSERT INTO t1 VALUES
|
||||
(GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')),
|
||||
(GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'));
|
||||
EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 2
|
||||
SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2;
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE t2 ALL a NULL NULL NULL 2
|
||||
SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a);
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #48291 : crash with row() operator,select into @var, and
|
||||
# subquery returning multiple rows
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (2),(3);
|
||||
# Should not crash
|
||||
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
|
||||
ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1))
|
||||
INTO @var0;
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1(a INT, KEY (a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
|
@ -809,7 +809,6 @@ show columns in t1;
|
||||
show slave hosts;
|
||||
show keys in t1;
|
||||
show column types;
|
||||
show table types;
|
||||
show storage engines;
|
||||
show authors;
|
||||
show contributors;
|
||||
@ -1292,11 +1291,6 @@ delete from mysql.db where user='mysqltest_4';
|
||||
delete from mysql.tables_priv where user='mysqltest_4';
|
||||
flush privileges;
|
||||
drop database mysqltest;
|
||||
show full plugin;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW PLUGINS' instead
|
||||
show plugin;
|
||||
show plugins;
|
||||
create database `mysqlttest\1`;
|
||||
create table `mysqlttest\1`.`a\b` (a int);
|
||||
@ -1448,7 +1442,6 @@ DROP PROCEDURE p1;
|
||||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
DROP EVENT ev1;
|
||||
SHOW TABLE TYPES;
|
||||
CREATE USER test_u@localhost;
|
||||
GRANT PROCESS ON *.* TO test_u@localhost;
|
||||
SHOW ENGINE MYISAM MUTEX;
|
||||
|
47
mysql-test/r/sp-bugs.result
Normal file
47
mysql-test/r/sp-bugs.result
Normal file
@ -0,0 +1,47 @@
|
||||
#
|
||||
# Bug #47412: Valgrind warnings / user can read uninitalized memory
|
||||
# using SP variables
|
||||
#
|
||||
CREATE SCHEMA testdb;
|
||||
USE testdb;
|
||||
CREATE FUNCTION f2 () RETURNS INTEGER
|
||||
BEGIN
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @aux = 1;
|
||||
RETURN f_not_exists () ;
|
||||
END|
|
||||
CREATE PROCEDURE p3 ( arg1 VARCHAR(32) )
|
||||
BEGIN
|
||||
CALL p_not_exists ( );
|
||||
END|
|
||||
# should not return valgrind warnings
|
||||
CALL p3 ( f2 () );
|
||||
ERROR 42000: PROCEDURE testdb.p_not_exists does not exist
|
||||
DROP SCHEMA testdb;
|
||||
CREATE SCHEMA testdb;
|
||||
USE testdb;
|
||||
CREATE FUNCTION f2 () RETURNS INTEGER
|
||||
BEGIN
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @aux = 1;
|
||||
RETURN f_not_exists () ;
|
||||
END|
|
||||
CREATE PROCEDURE p3 ( arg2 INTEGER )
|
||||
BEGIN
|
||||
CALL p_not_exists ( );
|
||||
END|
|
||||
# should not return valgrind warnings
|
||||
CALL p3 ( f2 () );
|
||||
ERROR 42000: PROCEDURE testdb.p_not_exists does not exist
|
||||
DROP SCHEMA testdb;
|
||||
CREATE SCHEMA testdb;
|
||||
USE testdb;
|
||||
CREATE FUNCTION f2 () RETURNS INTEGER
|
||||
BEGIN
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @aux = 1;
|
||||
RETURN f_not_exists () ;
|
||||
END|
|
||||
# should not return valgrind warnings
|
||||
SELECT f2 ();
|
||||
f2 ()
|
||||
NULL
|
||||
DROP SCHEMA testdb;
|
||||
End of 5.1 tests
|
@ -155,11 +155,11 @@ Pos Instruction
|
||||
0 stmt 9 "drop temporary table if exists sudoku..."
|
||||
1 stmt 1 "create temporary table sudoku_work ( ..."
|
||||
2 stmt 1 "create temporary table sudoku_schedul..."
|
||||
3 stmt 94 "call sudoku_init()"
|
||||
3 stmt 90 "call sudoku_init()"
|
||||
4 jump_if_not 7(8) p_naive@0
|
||||
5 stmt 4 "update sudoku_work set cnt = 0 where ..."
|
||||
6 jump 8
|
||||
7 stmt 94 "call sudoku_count()"
|
||||
7 stmt 90 "call sudoku_count()"
|
||||
8 stmt 6 "insert into sudoku_schedule (row,col)..."
|
||||
9 set v_scounter@2 0
|
||||
10 set v_i@3 1
|
||||
|
@ -921,10 +921,6 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; EN
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
CREATE FUNCTION bug_13627_f() returns int BEGIN DROP TRIGGER test1; return 1; END |
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN load table t1 from master; END |
|
||||
ERROR 0A000: LOAD TABLE is not allowed in stored procedures
|
||||
CREATE FUNCTION bug_13627_f() returns int BEGIN load table t1 from master; return 1; END |
|
||||
ERROR 0A000: LOAD TABLE is not allowed in stored procedures
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create table t2 (a int); END |
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
CREATE FUNCTION bug_13627_f() returns int BEGIN create table t2 (a int); return 1; END |
|
||||
@ -1115,18 +1111,6 @@ REPAIR TABLE t1;
|
||||
RETURN 1;
|
||||
END|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
CREATE FUNCTION bug13012() RETURNS INT
|
||||
BEGIN
|
||||
BACKUP TABLE t1 TO '/tmp';
|
||||
RETURN 1;
|
||||
END|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
CREATE FUNCTION bug13012() RETURNS INT
|
||||
BEGIN
|
||||
RESTORE TABLE t1 FROM '/tmp';
|
||||
RETURN 1;
|
||||
END|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
create table t1 (a int)|
|
||||
CREATE PROCEDURE bug13012_1() REPAIR TABLE t1|
|
||||
CREATE FUNCTION bug13012_2() RETURNS INT
|
||||
@ -1639,11 +1623,9 @@ DROP TABLE t1|
|
||||
drop procedure if exists p1;
|
||||
create procedure p1()
|
||||
begin
|
||||
create table t1 (a int) type=MyISAM;
|
||||
create table t1 (a int) engine=MyISAM;
|
||||
drop table t1;
|
||||
end|
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 6.0. Please use 'ENGINE=storage_engine' instead
|
||||
call p1();
|
||||
call p1();
|
||||
drop procedure p1;
|
||||
@ -1670,3 +1652,19 @@ NULL
|
||||
SELECT non_existent (a) FROM t1 WHERE b = 999999;
|
||||
ERROR 42000: FUNCTION test.non_existent does not exist
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #47788: Crash in TABLE_LIST::hide_view_error on UPDATE + VIEW +
|
||||
# SP + MERGE + ALTER
|
||||
#
|
||||
CREATE TABLE t1 (pk INT, b INT, KEY (b));
|
||||
CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT * FROM t1;
|
||||
CREATE PROCEDURE p1 (a int) UPDATE IGNORE v1 SET b = a;
|
||||
CALL p1(5);
|
||||
ERROR HY000: The target table v1 of the UPDATE is not updatable
|
||||
ALTER TABLE t1 CHANGE COLUMN b b2 INT;
|
||||
CALL p1(7);
|
||||
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
|
||||
DROP PROCEDURE p1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -4296,19 +4296,10 @@ drop procedure if exists bug13012|
|
||||
create procedure bug13012()
|
||||
BEGIN
|
||||
REPAIR TABLE t1;
|
||||
BACKUP TABLE t1 to '<MYSQLTEST_VARDIR>/tmp/';
|
||||
DROP TABLE t1;
|
||||
RESTORE TABLE t1 FROM '<MYSQLTEST_VARDIR>/tmp/';
|
||||
END|
|
||||
call bug13012()|
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 backup status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore status OK
|
||||
drop procedure bug13012|
|
||||
create view v1 as select * from t1|
|
||||
create procedure bug13012()
|
||||
|
@ -533,9 +533,7 @@ set @@session.max_heap_table_size=default|
|
||||
CREATE DATABASE db_bug7787|
|
||||
use db_bug7787|
|
||||
CREATE PROCEDURE p1()
|
||||
SHOW INNODB STATUS; |
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW ENGINE INNODB STATUS' instead
|
||||
SHOW ENGINE INNODB STATUS; |
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost|
|
||||
DROP DATABASE db_bug7787|
|
||||
drop user user_bug7787@localhost|
|
||||
|
@ -75,7 +75,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
|
||||
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
|
||||
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
|
||||
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
|
||||
ERROR 42S22: Unknown column 'a' in 'field list'
|
||||
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
|
||||
@ -4403,8 +4403,7 @@ FROM t1
|
||||
WHERE a = 230;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 DEPENDENT SUBQUERY st1 index NULL a 5 NULL 2 Using index
|
||||
2 DEPENDENT SUBQUERY st2 index b b 5 NULL 2 Using where; Using index; Using join buffer
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
|
||||
FROM t1
|
||||
WHERE a = 230;
|
||||
@ -4564,4 +4563,18 @@ id g v s
|
||||
51 50 NULL l
|
||||
61 60 NULL l
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1 (a ENUM('rainbow'));
|
||||
INSERT INTO t1 VALUES (),(),(),(),();
|
||||
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a LONGBLOB);
|
||||
INSERT INTO t1 SET a = 'aaaa';
|
||||
INSERT INTO t1 SET a = 'aaaa';
|
||||
SELECT 1 FROM t1 GROUP BY
|
||||
(SELECT LAST_INSERT_ID() FROM t1 ORDER BY MIN(a) ASC LIMIT 1);
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests.
|
||||
|
@ -895,3 +895,72 @@ t1.a < (select t4.a+10
|
||||
from t4, t5 limit 2));
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
drop table t0, t1, t2, t3, t4, t5;
|
||||
#
|
||||
# BUG#48177 - SELECTs with NOT IN subqueries containing NULL
|
||||
# values return too many records
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
i1 int DEFAULT NULL,
|
||||
i2 int DEFAULT NULL
|
||||
) ;
|
||||
INSERT INTO t1 VALUES (1, NULL);
|
||||
INSERT INTO t1 VALUES (2, 3);
|
||||
INSERT INTO t1 VALUES (4, NULL);
|
||||
INSERT INTO t1 VALUES (4, 0);
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
CREATE TABLE t2 (
|
||||
i1 int DEFAULT NULL,
|
||||
i2 int DEFAULT NULL
|
||||
) ;
|
||||
INSERT INTO t2 VALUES (4, NULL);
|
||||
INSERT INTO t2 VALUES (5, 0);
|
||||
|
||||
Data in t1
|
||||
SELECT i1, i2 FROM t1;
|
||||
i1 i2
|
||||
1 NULL
|
||||
2 3
|
||||
4 NULL
|
||||
4 0
|
||||
NULL NULL
|
||||
|
||||
Data in subquery (should be filtered out)
|
||||
SELECT i1, i2 FROM t2 ORDER BY i1;
|
||||
i1 i2
|
||||
4 NULL
|
||||
5 0
|
||||
FLUSH STATUS;
|
||||
|
||||
SELECT i1, i2
|
||||
FROM t1
|
||||
WHERE (i1, i2)
|
||||
NOT IN (SELECT i1, i2 FROM t2);
|
||||
i1 i2
|
||||
1 NULL
|
||||
2 3
|
||||
|
||||
# Check that the subquery only has to be evaluated once
|
||||
# for all-NULL values even though there are two (NULL,NULL) records
|
||||
# Baseline:
|
||||
SHOW STATUS LIKE '%Handler_read_rnd_next';
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 17
|
||||
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
FLUSH STATUS;
|
||||
|
||||
SELECT i1, i2
|
||||
FROM t1
|
||||
WHERE (i1, i2)
|
||||
NOT IN (SELECT i1, i2 FROM t2);
|
||||
i1 i2
|
||||
1 NULL
|
||||
2 3
|
||||
|
||||
# Handler_read_rnd_next should be one more than baseline
|
||||
# (read record from t1, but do not read from t2)
|
||||
SHOW STATUS LIKE '%Handler_read_rnd_next';
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 18
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.1 tests
|
||||
|
@ -161,7 +161,7 @@ procs_priv CREATE TABLE `procs_priv` (
|
||||
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Routine_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
|
||||
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
|
@ -889,28 +889,12 @@ CREATE TABLE b15776 (a year(0));
|
||||
DROP TABLE b15776;
|
||||
CREATE TABLE b15776 (a year(-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 '-2))' at line 1
|
||||
CREATE TABLE b15776 (a timestamp(4294967294));
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
DROP TABLE b15776;
|
||||
CREATE TABLE b15776 (a timestamp(4294967295));
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
DROP TABLE b15776;
|
||||
CREATE TABLE b15776 (a timestamp(4294967296));
|
||||
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
|
||||
CREATE TABLE b15776 (a timestamp(-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 '-1))' at line 1
|
||||
CREATE TABLE b15776 (a timestamp(-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 '-2))' at line 1
|
||||
CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
|
||||
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
|
||||
CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
|
||||
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
|
||||
CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
|
||||
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
|
||||
CREATE TABLE b15776 (a timestamp(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
|
||||
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
|
||||
CREATE TABLE b15776 select cast(null as char(4294967295));
|
||||
show columns from b15776;
|
||||
Field Type Null Key Default Extra
|
||||
|
@ -1495,9 +1495,9 @@ CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
|
||||
INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
|
||||
SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa;
|
||||
aa SUM(b)
|
||||
2.00000000000000000000000000000 10
|
||||
3.00000000000000000000000000000 10
|
||||
4.00000000000000000000000000000 30
|
||||
2.000000000000000000000000000000 10
|
||||
3.000000000000000000000000000000 10
|
||||
4.000000000000000000000000000000 30
|
||||
SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
|
||||
ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30.
|
||||
DROP TABLE t1;
|
||||
@ -1521,13 +1521,13 @@ f1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f1' at row 1
|
||||
Warning 1264 Out of range value for column 'f1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 decimal(65,20) NO 0.00000000000000000000
|
||||
f1 decimal(65,30) NO 0.000000000000000000000000000000
|
||||
SELECT f1 FROM t1;
|
||||
f1
|
||||
123451234512345123451234512345123451234512345.67890678906789067891
|
||||
99999999999999999999999999999999999.999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
|
||||
1.01500000 * 1.01500000 * 0.99500000);
|
||||
@ -1595,7 +1595,7 @@ Warnings:
|
||||
Note 1265 Data truncated for column 'my_col' at row 1
|
||||
DESCRIBE t1;
|
||||
Field Type Null Key Default Extra
|
||||
my_col decimal(32,30) NO 0.000000000000000000000000000000
|
||||
my_col decimal(65,30) NO 0.000000000000000000000000000000
|
||||
SELECT my_col FROM t1;
|
||||
my_col
|
||||
1.123456789123456789123456789123
|
||||
@ -1625,212 +1625,8 @@ Warnings:
|
||||
Note 1265 Data truncated for column 'my_col' at row 1
|
||||
DESCRIBE t1;
|
||||
Field Type Null Key Default Extra
|
||||
my_col decimal(30,30) YES NULL
|
||||
my_col decimal(65,30) YES NULL
|
||||
SELECT my_col FROM t1;
|
||||
my_col
|
||||
0.012345687012345687012345687012
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#45261: Crash, stored procedure + decimal
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 81 */ 100000000000000000000000000000000000000000000000000000000000000000000000000000001
|
||||
AS c1;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,0) NO 0
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
99999999999999999999999999999999999999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 81 */ 100000000000000000000000000000000000000000000000000000000000000000000000000000001.
|
||||
AS c1;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,0) NO 0
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
99999999999999999999999999999999999999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 81 */ 100000000000000000000000000000000000000000000000000000000000000000000000000000001.1 /* 1 */
|
||||
AS c1;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,0) NO 0
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
99999999999999999999999999999999999999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 82 */ 1000000000000000000000000000000000000000000000000000000000000000000000000000000001
|
||||
AS c1;
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,0) NO 0
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
99999999999999999999999999999999999999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 40 */ 1000000000000000000000000000000000000001.1000000000000000000000000000000000000001 /* 40 */
|
||||
AS c1;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,25) NO 0.0000000000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1000000000000000000000000000000000000001.1000000000000000000000000
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 1 */ 1.10000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 80 */
|
||||
AS c1;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(31,30) NO 0.000000000000000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1.100000000000000000000000000000
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 1 */ 1.100000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 81 */
|
||||
AS c1;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(31,30) NO 0.000000000000000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1.100000000000000000000000000000
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
.100000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 81 */
|
||||
AS c1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(30,30) NO 0.000000000000000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
0.100000000000000000000000000000
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 45 */ 123456789012345678901234567890123456789012345.123456789012345678901234567890123456789012345 /* 45 */
|
||||
AS c1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,20) NO 0.00000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
123456789012345678901234567890123456789012345.12345678901234567890
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 65 */ 12345678901234567890123456789012345678901234567890123456789012345.1 /* 1 */
|
||||
AS c1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,0) NO 0
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
12345678901234567890123456789012345678901234567890123456789012345
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
/* 66 */ 123456789012345678901234567890123456789012345678901234567890123456.1 /* 1 */
|
||||
AS c1;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,0) NO 0
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
99999999999999999999999999999999999999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT
|
||||
.123456789012345678901234567890123456789012345678901234567890123456 /* 66 */
|
||||
AS c1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(30,30) NO 0.000000000000000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
0.123456789012345678901234567890
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT 123.1234567890123456789012345678901 /* 31 */ AS c1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(33,30) NO 0.000000000000000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
123.123456789012345678901234567890
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 SELECT 1.1 + CAST(1 AS DECIMAL(65,30)) AS c1;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,29) NO 0.00000000000000000000000000000
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
2.10000000000000000000000000000
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Test that the integer and decimal parts are properly calculated.
|
||||
#
|
||||
CREATE TABLE t1 (a DECIMAL(30,30));
|
||||
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
|
||||
CREATE TABLE t2 SELECT MIN(a + 0.0000000000000000000000000000001) AS c1 FROM t1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 3
|
||||
DESC t2;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(32,30) YES NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a DECIMAL(30,30));
|
||||
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
|
||||
CREATE TABLE t2 SELECT IFNULL(a + 0.0000000000000000000000000000001, NULL) AS c1 FROM t1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
Note 1265 Data truncated for column 'c1' at row 2
|
||||
Note 1265 Data truncated for column 'c1' at row 3
|
||||
DESC t2;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(32,30) YES NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a DECIMAL(30,30));
|
||||
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
|
||||
CREATE TABLE t2 SELECT CASE a WHEN 0.1 THEN 0.0000000000000000000000000000000000000000000000000000000000000000001 END AS c1 FROM t1;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
DESC t2;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(31,30) YES NULL
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Test that variables get maximum precision.
|
||||
#
|
||||
SET @decimal= 1.1;
|
||||
CREATE TABLE t1 SELECT @decimal AS c1;
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,30) YES NULL
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1.100000000000000000000000000000
|
||||
DROP TABLE t1;
|
||||
|
@ -97,30 +97,6 @@ date date_time time_stamp
|
||||
2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00
|
||||
2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00
|
||||
drop table t1;
|
||||
create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
|
||||
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
|
||||
t14 timestamp(14));
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
insert t1 values (0,0,0,0,0,0,0),
|
||||
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
"1997-12-31 23:47:59");
|
||||
select * from t1;
|
||||
t2 t4 t6 t8 t10 t12 t14
|
||||
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
|
||||
1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
|
||||
select * from t1;
|
||||
t2 t4 t6 t8 t10 t12 t14
|
||||
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
|
||||
1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
|
||||
drop table t1;
|
||||
create table t1 (ix timestamp);
|
||||
insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
|
||||
Warnings:
|
||||
@ -436,7 +412,7 @@ max(t)
|
||||
2004-02-01 00:00:00
|
||||
drop table t1;
|
||||
set sql_mode='maxdb';
|
||||
create table t1 (a timestamp, b timestamp(19));
|
||||
create table t1 (a timestamp, b timestamp);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE "t1" (
|
||||
|
@ -503,3 +503,14 @@ ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug #47919 assert in open_table during ALTER temporary table
|
||||
#
|
||||
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
|
||||
CREATE TEMPORARY TABLE t2 LIKE t1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t2 VALUES (1);
|
||||
ALTER TABLE t2 COMMENT = 'ABC';
|
||||
UPDATE t2, t1 SET t2.f1 = 2, t1.f1 = 9;
|
||||
ALTER TABLE t2 COMMENT = 'DEF';
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -1218,3 +1218,22 @@ Warnings:
|
||||
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
#
|
||||
# Bug #46019: ERROR 1356 When selecting from within another
|
||||
# view that has Group By
|
||||
#
|
||||
CREATE DATABASE mysqltest1;
|
||||
USE mysqltest1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT a FROM t1 GROUP BY a;
|
||||
CREATE SQL SECURITY INVOKER VIEW v2 AS SELECT a FROM v1;
|
||||
CREATE USER mysqluser1;
|
||||
GRANT SELECT ON TABLE t1 TO mysqluser1;
|
||||
GRANT SELECT, SHOW VIEW ON TABLE v1 TO mysqluser1;
|
||||
GRANT SELECT, SHOW VIEW ON TABLE v2 TO mysqluser1;
|
||||
SELECT a FROM v1;
|
||||
a
|
||||
SELECT a FROM v2;
|
||||
a
|
||||
DROP USER mysqluser1;
|
||||
DROP DATABASE mysqltest1;
|
||||
|
@ -166,9 +166,6 @@ show variables like 'max_error_count';
|
||||
Variable_name Value
|
||||
max_error_count 10
|
||||
drop table t1;
|
||||
set table_type=MYISAM;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 6.0. Please use '@@storage_engine' instead
|
||||
create table t1 (a int);
|
||||
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
update t1 set a='abc';
|
||||
|
@ -89,3 +89,28 @@ xa start 'a';
|
||||
xa end 'a';
|
||||
xa prepare 'a';
|
||||
xa commit 'a';
|
||||
CREATE TABLE t1(a INT, KEY(a)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1),(2);
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=3 WHERE a=1;
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=4 WHERE a=2;
|
||||
UPDATE t1 SET a=5 WHERE a=2;
|
||||
UPDATE t1 SET a=5 WHERE a=1;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ROLLBACK;
|
||||
ROLLBACK;
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=3 WHERE a=1;
|
||||
XA START 'xid1';
|
||||
UPDATE t1 SET a=4 WHERE a=2;
|
||||
UPDATE t1 SET a=5 WHERE a=2;
|
||||
UPDATE t1 SET a=5 WHERE a=1;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
XA END 'xid1';
|
||||
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
|
||||
XA ROLLBACK 'xid1';
|
||||
XA START 'xid1';
|
||||
XA END 'xid1';
|
||||
XA ROLLBACK 'xid1';
|
||||
DROP TABLE t1;
|
||||
|
@ -0,0 +1,50 @@
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1 (a int);
|
||||
### assertion: index file contains regular entries
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000001
|
||||
|
||||
### assertion: show original binlogs
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000001 #
|
||||
### assertion: binlog contents from regular entries
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
|
||||
FLUSH LOGS;
|
||||
### assertion: index file contains renamed binlog and the new one
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin-b34582.000001
|
||||
master-bin.000002
|
||||
|
||||
### assertion: original binlog content still exists, despite we
|
||||
### renamed and changed the index file
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin-b34582.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
|
||||
### assertion: user changed binlog index shows correct entries
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin-b34582.000001 #
|
||||
master-bin.000002 #
|
||||
DROP TABLE t1;
|
||||
### assertion: purging binlogs up to binlog created after instrumenting index file should work
|
||||
PURGE BINARY LOGS TO 'master-bin.000002';
|
||||
### assertion: show binary logs should only contain latest binlog
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000002 #
|
||||
### assertion: assert that binlog files were indeed purged (using file_exists calls)
|
||||
### assertion: assert that not purged binlog file exists
|
||||
### assertion: show index file contents and these should match show binary logs issued above
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000002
|
||||
|
||||
RESET MASTER;
|
8
mysql-test/suite/binlog/r/binlog_max_extension.result
Normal file
8
mysql-test/suite/binlog/r/binlog_max_extension.result
Normal file
@ -0,0 +1,8 @@
|
||||
call mtr.add_suppression("Next log extension: 2147483647. Remaining log filename extensions: 0.");
|
||||
call mtr.add_suppression("Log filename extension number exhausted:");
|
||||
call mtr.add_suppression("Can't generate a unique log-filename");
|
||||
RESET MASTER;
|
||||
FLUSH LOGS;
|
||||
Warnings:
|
||||
Warning 1098 Can't generate a unique log-filename master-bin.(1-999)
|
||||
|
@ -19,6 +19,7 @@ DROP TABLE IF EXISTS tmp2, t;
|
||||
SELECT GET_LOCK("a",10);
|
||||
GET_LOCK("a",10)
|
||||
1
|
||||
USE test;
|
||||
SELECT GET_LOCK("a",10);
|
||||
GET_LOCK("a",10)
|
||||
1
|
||||
|
42
mysql-test/suite/binlog/r/binlog_stm_do_db.result
Normal file
42
mysql-test/suite/binlog/r/binlog_stm_do_db.result
Normal file
@ -0,0 +1,42 @@
|
||||
SET @old_isolation_level= @@session.tx_isolation;
|
||||
SET @@session.tx_isolation= 'READ-COMMITTED';
|
||||
CREATE DATABASE b42829;
|
||||
use b42829;
|
||||
CREATE TABLE t1 (x int, y int) engine=InnoDB;
|
||||
CREATE TABLE t2 (x int, y int) engine=InnoDB;
|
||||
CREATE DATABASE b42829_filtered;
|
||||
use b42829_filtered;
|
||||
CREATE TABLE t1 (x int, y int) engine=InnoDB;
|
||||
CREATE TABLE t2 (x int, y int) engine=InnoDB;
|
||||
SET @@session.sql_log_bin= 0;
|
||||
INSERT INTO b42829_filtered.t1 VALUES (100,100);
|
||||
INSERT INTO b42829.t1 VALUES (100,100);
|
||||
SET @@session.sql_log_bin= 1;
|
||||
### assertion: the inserts will not raise log error because
|
||||
### binlog-do-db is filtering used database
|
||||
INSERT INTO t2 VALUES (1,2), (1,3), (1,4);
|
||||
INSERT INTO t1 SELECT * FROM t2;
|
||||
### assertion: assert that despite updating a not filtered
|
||||
### database this wont trigger an error as the
|
||||
### used database is the filtered one.
|
||||
UPDATE b42829_filtered.t1 ft1, b42829.t1 nft1 SET ft1.x=1, nft1.x=2;
|
||||
use b42829;
|
||||
### assertion: the statements *will* raise log error because
|
||||
### binlog-do-db is not filtering used database
|
||||
BEGIN;
|
||||
INSERT INTO t2 VALUES (1,2), (1,3), (1,4);
|
||||
ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
|
||||
UPDATE b42829_filtered.t1 ft1, b42829.t1 nft1 SET ft1.x=1, nft1.x=2;
|
||||
ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
|
||||
INSERT INTO t1 SELECT * FROM t2;
|
||||
ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
|
||||
COMMIT;
|
||||
### assertion: filtered events did not make into the binlog
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # CREATE DATABASE b42829
|
||||
master-bin.000001 # Query # # use `b42829`; CREATE TABLE t1 (x int, y int) engine=InnoDB
|
||||
master-bin.000001 # Query # # use `b42829`; CREATE TABLE t2 (x int, y int) engine=InnoDB
|
||||
DROP DATABASE b42829;
|
||||
DROP DATABASE b42829_filtered;
|
||||
SET @@session.tx_isolation= @old_isolation_level;
|
@ -19,6 +19,7 @@ DROP TABLE IF EXISTS tmp2, t;
|
||||
SELECT GET_LOCK("a",10);
|
||||
GET_LOCK("a",10)
|
||||
1
|
||||
USE test;
|
||||
SELECT GET_LOCK("a",10);
|
||||
GET_LOCK("a",10)
|
||||
1
|
||||
|
@ -456,7 +456,11 @@ return n;
|
||||
end|
|
||||
reset master;
|
||||
insert into t2 values (bug27417(1));
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
insert into t2 select bug27417(2);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
reset master;
|
||||
insert into t2 values (bug27417(2));
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
@ -473,6 +477,8 @@ select count(*) from t2;
|
||||
count(*)
|
||||
2
|
||||
delete from t2 where a=bug27417(3);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
select count(*) from t2 /* nothing got deleted */;
|
||||
count(*)
|
||||
2
|
||||
@ -485,6 +491,8 @@ select count(*) from t1 /* must be 5 */;
|
||||
count(*)
|
||||
5
|
||||
delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 0
|
||||
select count(*) from t1 /* must be 7 */;
|
||||
count(*)
|
||||
@ -700,7 +708,11 @@ return n;
|
||||
end|
|
||||
reset master;
|
||||
insert into t2 values (bug27417(1));
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
insert into t2 select bug27417(2);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
reset master;
|
||||
insert into t2 values (bug27417(2));
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
@ -716,6 +728,8 @@ select count(*) from t2;
|
||||
count(*)
|
||||
2
|
||||
delete from t2 where a=bug27417(3);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
select count(*) from t2 /* nothing got deleted */;
|
||||
count(*)
|
||||
2
|
||||
@ -727,6 +741,8 @@ select count(*) from t1 /* must be 5 */;
|
||||
count(*)
|
||||
5
|
||||
delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 0
|
||||
select count(*) from t1 /* must be 7 */;
|
||||
count(*)
|
||||
|
@ -327,4 +327,59 @@ Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
DROP TABLE t1, t2;
|
||||
SET @@SESSION.SQL_MODE = @save_sql_mode;
|
||||
CREATE TABLE t1 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
CREATE FUNCTION func_modify_t1 ()
|
||||
RETURNS INT
|
||||
BEGIN
|
||||
INSERT INTO t1 SET a = 1;
|
||||
RETURN 0;
|
||||
END|
|
||||
# The following statement causes auto-incrementation
|
||||
# of both t1 and t2. It is logged in statement format,
|
||||
# so it should produce unsafe warning.
|
||||
INSERT INTO t2 SET a = func_modify_t1();
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
SET SESSION binlog_format = MIXED;
|
||||
# Check if the statement is logged in row format.
|
||||
INSERT INTO t2 SET a = func_modify_t1();
|
||||
SHOW BINLOG EVENTS FROM 12283;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 12283 Query 1 12351 BEGIN
|
||||
master-bin.000001 12351 Table_map 1 12393 table_id: 44 (test.t2)
|
||||
master-bin.000001 12393 Table_map 1 12435 table_id: 45 (test.t1)
|
||||
master-bin.000001 12435 Write_rows 1 12473 table_id: 45
|
||||
master-bin.000001 12473 Write_rows 1 12511 table_id: 44 flags: STMT_END_F
|
||||
master-bin.000001 12511 Query 1 12580 COMMIT
|
||||
DROP TABLE t1,t2;
|
||||
DROP FUNCTION func_modify_t1;
|
||||
SET SESSION binlog_format = STATEMENT;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
CREATE TABLE t3 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
create trigger tri_modify_two_tables before insert on t1 for each row begin
|
||||
insert into t2(a) values(new.a);
|
||||
insert into t3(a) values(new.a);
|
||||
end |
|
||||
# The following statement causes auto-incrementation
|
||||
# of both t2 and t3. It is logged in statement format,
|
||||
# so it should produce unsafe warning
|
||||
INSERT INTO t1 SET a = 1;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
SET SESSION binlog_format = MIXED;
|
||||
# Check if the statement is logged in row format.
|
||||
INSERT INTO t1 SET a = 2;
|
||||
SHOW BINLOG EVENTS FROM 13426;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 13426 Query 1 13494 BEGIN
|
||||
master-bin.000001 13494 Table_map 1 13535 table_id: 47 (test.t1)
|
||||
master-bin.000001 13535 Table_map 1 13577 table_id: 48 (test.t3)
|
||||
master-bin.000001 13577 Table_map 1 13619 table_id: 49 (test.t2)
|
||||
master-bin.000001 13619 Write_rows 1 13657 table_id: 49
|
||||
master-bin.000001 13657 Write_rows 1 13695 table_id: 48
|
||||
master-bin.000001 13695 Write_rows 1 13729 table_id: 47 flags: STMT_END_F
|
||||
master-bin.000001 13729 Query 1 13798 COMMIT
|
||||
DROP TABLE t1,t2,t3;
|
||||
"End of tests"
|
||||
|
114
mysql-test/suite/binlog/t/binlog_delete_and_flush_index.test
Normal file
114
mysql-test/suite/binlog/t/binlog_delete_and_flush_index.test
Normal file
@ -0,0 +1,114 @@
|
||||
# BUG#34582: FLUSH LOGS does not close and reopen the binlog index
|
||||
# file
|
||||
#
|
||||
# WHAT
|
||||
# ====
|
||||
#
|
||||
# We want to test that FLUSH LOGS closes and reopens binlog index
|
||||
# file.
|
||||
#
|
||||
# HOW
|
||||
# ===
|
||||
#
|
||||
# PREPARE:
|
||||
# 1. create some binlog events
|
||||
# 2. show index content, binlog events and binlog contents
|
||||
# for mysql-bin.000001
|
||||
# 3. copy the mysql-bin.000001 to mysql-bin-b34582.000001
|
||||
# 4. change the index file so that mysql-bin.000001 is replaced
|
||||
# with mysql-bin-b34582.000001
|
||||
# 5. FLUSH the logs so that new index is closed and reopened
|
||||
#
|
||||
# ASSERTIONS:
|
||||
# 1. index file contents shows mysql-bin-b34582.000001 and
|
||||
# mysql-bin.000002
|
||||
# 1. show binary logs shows current index entries
|
||||
# 2. binlog contents for mysql-bin-b34582.000001 are displayed
|
||||
# 3. Purge binlogs up to the latest one succeeds
|
||||
# 4. SHOW BINARY LOGS presents the latest one only after purging
|
||||
# 5. Purged binlogs files don't exist in the filesystem
|
||||
# 6. Not purged binlog file exists in the filesystem
|
||||
#
|
||||
# CLEAN UP:
|
||||
# 1. RESET MASTER
|
||||
#
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
-- let $datadir= `SELECT @@datadir`
|
||||
-- let $index=$datadir/master-bin.index
|
||||
-- chmod 0644 $index
|
||||
|
||||
# action: issue one command so that binlog gets some event
|
||||
CREATE TABLE t1 (a int);
|
||||
|
||||
-- echo ### assertion: index file contains regular entries
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo ### assertion: show original binlogs
|
||||
-- source include/show_binary_logs.inc
|
||||
|
||||
--echo ### assertion: binlog contents from regular entries
|
||||
-- source include/show_binlog_events.inc
|
||||
|
||||
# action: copy binlogs to other names and change entries in index file
|
||||
-- copy_file $datadir/master-bin.000001 $datadir/master-bin-b34582.000001
|
||||
let INDEX_FILE=$index;
|
||||
perl;
|
||||
$file= $ENV{'INDEX_FILE'};
|
||||
open(FILE, ">$file") || die "Unable to open $file.";
|
||||
truncate(FILE,0);
|
||||
close ($file);
|
||||
EOF
|
||||
|
||||
-- append_file $index
|
||||
master-bin-b34582.000001
|
||||
EOF
|
||||
|
||||
# action: should cause rotation, and creation of new binlogs
|
||||
FLUSH LOGS;
|
||||
|
||||
# file is not used anymore - remove it (mysql closed on flush logs).
|
||||
-- remove_file $datadir/master-bin.000001
|
||||
|
||||
-- echo ### assertion: index file contains renamed binlog and the new one
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
-- echo ### assertion: original binlog content still exists, despite we
|
||||
-- echo ### renamed and changed the index file
|
||||
-- source include/show_binlog_events.inc
|
||||
|
||||
-- echo ### assertion: user changed binlog index shows correct entries
|
||||
-- source include/show_binary_logs.inc
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
-- echo ### assertion: purging binlogs up to binlog created after instrumenting index file should work
|
||||
-- let $current_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
-- eval PURGE BINARY LOGS TO '$current_binlog'
|
||||
|
||||
-- echo ### assertion: show binary logs should only contain latest binlog
|
||||
-- source include/show_binary_logs.inc
|
||||
|
||||
-- echo ### assertion: assert that binlog files were indeed purged (using file_exists calls)
|
||||
-- error 1
|
||||
-- file_exists $datadir/master-bin-b34852.000001
|
||||
|
||||
-- echo ### assertion: assert that not purged binlog file exists
|
||||
-- file_exists $datadir/$current_binlog
|
||||
|
||||
-- echo ### assertion: show index file contents and these should match show binary logs issued above
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
RESET MASTER;
|
92
mysql-test/suite/binlog/t/binlog_max_extension.test
Normal file
92
mysql-test/suite/binlog/t/binlog_max_extension.test
Normal file
@ -0,0 +1,92 @@
|
||||
# BUG#40611: MySQL cannot make a binary log after sequential number beyond
|
||||
# unsigned long.
|
||||
#
|
||||
# Problem statement
|
||||
# =================
|
||||
#
|
||||
# Extension for log file names might be created with negative
|
||||
# numbers (when counter used would wrap around), causing server
|
||||
# failure when incrementing -00001 (reaching number 000000
|
||||
# extension).
|
||||
#
|
||||
# Test
|
||||
# ====
|
||||
# This tests aims at testing the a patch that removes negatives
|
||||
# numbers from log name extensions and checks that the server
|
||||
# reports gracefully that the limit has been reached.
|
||||
#
|
||||
# It instruments index file to point to a log file close to
|
||||
# the new maximum and calls flush logs to get warning.
|
||||
#
|
||||
|
||||
call mtr.add_suppression("Next log extension: 2147483647. Remaining log filename extensions: 0.");
|
||||
call mtr.add_suppression("Log filename extension number exhausted:");
|
||||
call mtr.add_suppression("Can't generate a unique log-filename");
|
||||
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
RESET MASTER;
|
||||
|
||||
-- let $MYSQLD_DATADIR= `select @@datadir`
|
||||
|
||||
###############################################
|
||||
# check hitting maximum file name extension:
|
||||
###############################################
|
||||
|
||||
##########
|
||||
# Prepare
|
||||
##########
|
||||
|
||||
# 1. Stop master server
|
||||
-- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait
|
||||
EOF
|
||||
-- shutdown_server 10
|
||||
-- source include/wait_until_disconnected.inc
|
||||
|
||||
# 2. Prepare log and index file
|
||||
-- copy_file $MYSQLD_DATADIR/master-bin.index $MYSQLD_DATADIR/master-bin.index.orig
|
||||
-- copy_file $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.2147483646
|
||||
-- append_file $MYSQLD_DATADIR/master-bin.index
|
||||
master-bin.2147483646
|
||||
EOF
|
||||
|
||||
# 3. Restart the server
|
||||
-- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart
|
||||
EOF
|
||||
-- enable_reconnect
|
||||
-- source include/wait_until_connected_again.inc
|
||||
|
||||
###########
|
||||
# Assertion
|
||||
###########
|
||||
|
||||
# assertion: should throw warning
|
||||
FLUSH LOGS;
|
||||
|
||||
##############
|
||||
# Clean up
|
||||
##############
|
||||
|
||||
# 1. Stop the server
|
||||
-- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait
|
||||
EOF
|
||||
-- shutdown_server 10
|
||||
-- source include/wait_until_disconnected.inc
|
||||
|
||||
# 2. Undo changes to index and log files
|
||||
-- remove_file $MYSQLD_DATADIR/master-bin.index
|
||||
-- copy_file $MYSQLD_DATADIR/master-bin.index.orig $MYSQLD_DATADIR/master-bin.index
|
||||
-- remove_file $MYSQLD_DATADIR/master-bin.index.orig
|
||||
|
||||
-- remove_file $MYSQLD_DATADIR/master-bin.2147483646
|
||||
-- remove_file $MYSQLD_DATADIR/master-bin.2147483647
|
||||
|
||||
# 3. Restart the server
|
||||
-- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart
|
||||
EOF
|
||||
-- enable_reconnect
|
||||
-- source include/wait_until_connected_again.inc
|
1
mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
Normal file
1
mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--binlog-do-db=b42829
|
90
mysql-test/suite/binlog/t/binlog_stm_do_db.test
Normal file
90
mysql-test/suite/binlog/t/binlog_stm_do_db.test
Normal file
@ -0,0 +1,90 @@
|
||||
# BUG#42829: binlogging enabled for all schemas regardless of
|
||||
# binlog-db-db / binlog-ignore-db
|
||||
#
|
||||
# WHAT
|
||||
# ====
|
||||
#
|
||||
# We want to test whether filtered events from binlog will cause
|
||||
# raising an error mentioning that statement is unable to be logged or
|
||||
# not, when:
|
||||
#
|
||||
# 1. isolation level READ-COMMITTED; AND
|
||||
#
|
||||
# 2. using InnoDB engine; AND
|
||||
#
|
||||
# 3. using SBL (in which case InnoDB will only allow RBL).
|
||||
#
|
||||
# HOW
|
||||
# ===
|
||||
#
|
||||
# The test is implemented as follows:
|
||||
#
|
||||
# i) set tx_isolation to read-committed.
|
||||
#
|
||||
# ii) create two databases (one filtered other not - using
|
||||
# binlog-do-db)
|
||||
#
|
||||
# iii) Create statements that are to be filtered on filtered db
|
||||
#
|
||||
# - At this point, before fix, an error would be raised
|
||||
#
|
||||
# iv) do the same thing for not the filtered database and check
|
||||
# that events throw an error:
|
||||
#
|
||||
# - Error: ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
|
||||
#
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
|
||||
SET @old_isolation_level= @@session.tx_isolation;
|
||||
SET @@session.tx_isolation= 'READ-COMMITTED';
|
||||
|
||||
-- let $engine= InnoDB
|
||||
-- let $filtered= b42829_filtered
|
||||
-- let $not_filtered= b42829
|
||||
|
||||
-- eval CREATE DATABASE $not_filtered
|
||||
-- eval use $not_filtered
|
||||
-- eval CREATE TABLE t1 (x int, y int) engine=$engine
|
||||
-- eval CREATE TABLE t2 (x int, y int) engine=$engine
|
||||
|
||||
-- eval CREATE DATABASE $filtered
|
||||
-- eval use $filtered
|
||||
-- eval CREATE TABLE t1 (x int, y int) engine=$engine
|
||||
-- eval CREATE TABLE t2 (x int, y int) engine=$engine
|
||||
|
||||
SET @@session.sql_log_bin= 0;
|
||||
-- eval INSERT INTO $filtered.t1 VALUES (100,100)
|
||||
-- eval INSERT INTO $not_filtered.t1 VALUES (100,100)
|
||||
SET @@session.sql_log_bin= 1;
|
||||
|
||||
-- echo ### assertion: the inserts will not raise log error because
|
||||
-- echo ### binlog-do-db is filtering used database
|
||||
INSERT INTO t2 VALUES (1,2), (1,3), (1,4);
|
||||
INSERT INTO t1 SELECT * FROM t2;
|
||||
|
||||
-- echo ### assertion: assert that despite updating a not filtered
|
||||
-- echo ### database this wont trigger an error as the
|
||||
-- echo ### used database is the filtered one.
|
||||
-- eval UPDATE $filtered.t1 ft1, $not_filtered.t1 nft1 SET ft1.x=1, nft1.x=2
|
||||
|
||||
-- eval use $not_filtered
|
||||
-- echo ### assertion: the statements *will* raise log error because
|
||||
-- echo ### binlog-do-db is not filtering used database
|
||||
BEGIN;
|
||||
-- error ER_BINLOG_LOGGING_IMPOSSIBLE
|
||||
INSERT INTO t2 VALUES (1,2), (1,3), (1,4);
|
||||
-- error ER_BINLOG_LOGGING_IMPOSSIBLE
|
||||
-- eval UPDATE $filtered.t1 ft1, $not_filtered.t1 nft1 SET ft1.x=1, nft1.x=2
|
||||
-- error ER_BINLOG_LOGGING_IMPOSSIBLE
|
||||
INSERT INTO t1 SELECT * FROM t2;
|
||||
COMMIT;
|
||||
|
||||
-- echo ### assertion: filtered events did not make into the binlog
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
-- eval DROP DATABASE $not_filtered
|
||||
-- eval DROP DATABASE $filtered
|
||||
SET @@session.tx_isolation= @old_isolation_level;
|
@ -388,4 +388,72 @@ DELETE FROM t1 LIMIT 1;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
SET @@SESSION.SQL_MODE = @save_sql_mode;
|
||||
|
||||
#
|
||||
# BUG#45827
|
||||
# The test verifies if stmt that have more than one
|
||||
# different tables to update with autoinc columns
|
||||
# will produce unsafe warning
|
||||
#
|
||||
|
||||
# Test case1: stmt that have more than one different tables
|
||||
# to update with autoinc columns should produce
|
||||
# unsafe warning when calling a function
|
||||
CREATE TABLE t1 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
|
||||
# The purpose of this function is to insert into t1 so that the second
|
||||
# column is auto_increment'ed.
|
||||
DELIMITER |;
|
||||
CREATE FUNCTION func_modify_t1 ()
|
||||
RETURNS INT
|
||||
BEGIN
|
||||
INSERT INTO t1 SET a = 1;
|
||||
RETURN 0;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
--echo # The following statement causes auto-incrementation
|
||||
--echo # of both t1 and t2. It is logged in statement format,
|
||||
--echo # so it should produce unsafe warning.
|
||||
INSERT INTO t2 SET a = func_modify_t1();
|
||||
|
||||
SET SESSION binlog_format = MIXED;
|
||||
--echo # Check if the statement is logged in row format.
|
||||
let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
INSERT INTO t2 SET a = func_modify_t1();
|
||||
eval SHOW BINLOG EVENTS FROM $pos0_master;
|
||||
|
||||
# clean up
|
||||
DROP TABLE t1,t2;
|
||||
DROP FUNCTION func_modify_t1;
|
||||
|
||||
# Test case2: stmt that have more than one different tables
|
||||
# to update with autoinc columns should produce
|
||||
# unsafe warning when invoking a trigger
|
||||
SET SESSION binlog_format = STATEMENT;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
CREATE TABLE t3 (a INT, b INT PRIMARY KEY AUTO_INCREMENT);
|
||||
# The purpose of this function is to insert into t1 so that the second
|
||||
# column is auto_increment'ed.
|
||||
delimiter |;
|
||||
create trigger tri_modify_two_tables before insert on t1 for each row begin
|
||||
insert into t2(a) values(new.a);
|
||||
insert into t3(a) values(new.a);
|
||||
end |
|
||||
delimiter ;|
|
||||
--echo # The following statement causes auto-incrementation
|
||||
--echo # of both t2 and t3. It is logged in statement format,
|
||||
--echo # so it should produce unsafe warning
|
||||
INSERT INTO t1 SET a = 1;
|
||||
|
||||
SET SESSION binlog_format = MIXED;
|
||||
--echo # Check if the statement is logged in row format.
|
||||
let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
INSERT INTO t1 SET a = 2;
|
||||
eval SHOW BINLOG EVENTS FROM $pos1_master;
|
||||
|
||||
# clean up
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
--echo "End of tests"
|
||||
|
@ -130,7 +130,7 @@ NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
|
||||
NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references
|
||||
NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
|
||||
NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
|
||||
NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
||||
NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
@ -411,7 +411,7 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE')
|
||||
3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77)
|
||||
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
|
||||
|
@ -166,8 +166,8 @@ NULL db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
@ -185,8 +185,8 @@ NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
|
||||
# Switch to connection testuser2
|
||||
|
@ -196,15 +196,15 @@ drop table t1;
|
||||
set innodb_strict_mode = on;
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 0;
|
||||
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
|
||||
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
|
||||
Error 1005 Can't create table 'test.t1' (errno: 1478)
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 9;
|
||||
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Error 1005 Can't create table 'test.t2' (errno: 1478)
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 1;
|
||||
create table t4 (id int primary key) engine = innodb key_block_size = 2;
|
||||
@ -233,30 +233,30 @@ key_block_size = 8 row_format = compressed;
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = redundant;
|
||||
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
|
||||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
|
||||
Error 1005 Can't create table 'test.t2' (errno: 1478)
|
||||
create table t3 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = compact;
|
||||
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
|
||||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
|
||||
Error 1005 Can't create table 'test.t3' (errno: 1478)
|
||||
create table t4 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = dynamic;
|
||||
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
|
||||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
|
||||
Error 1005 Can't create table 'test.t4' (errno: 1478)
|
||||
create table t5 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = default;
|
||||
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
|
||||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
|
||||
Error 1005 Can't create table 'test.t5' (errno: 1478)
|
||||
SELECT table_schema, table_name, row_format
|
||||
FROM information_schema.tables WHERE engine='innodb';
|
||||
@ -266,26 +266,26 @@ drop table t1;
|
||||
create table t1 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = redundant;
|
||||
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
|
||||
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
|
||||
Error 1005 Can't create table 'test.t1' (errno: 1478)
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = compact;
|
||||
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
|
||||
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
|
||||
Error 1005 Can't create table 'test.t2' (errno: 1478)
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = dynamic;
|
||||
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
|
||||
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
|
||||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
|
||||
Error 1005 Can't create table 'test.t2' (errno: 1478)
|
||||
SELECT table_schema, table_name, row_format
|
||||
FROM information_schema.tables WHERE engine='innodb';
|
||||
@ -293,45 +293,45 @@ table_schema table_name row_format
|
||||
set global innodb_file_per_table = off;
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 1;
|
||||
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Error 1005 Can't create table 'test.t1' (errno: 1478)
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 2;
|
||||
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Error 1005 Can't create table 'test.t2' (errno: 1478)
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 4;
|
||||
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Error 1005 Can't create table 'test.t3' (errno: 1478)
|
||||
create table t4 (id int primary key) engine = innodb key_block_size = 8;
|
||||
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Error 1005 Can't create table 'test.t4' (errno: 1478)
|
||||
create table t5 (id int primary key) engine = innodb key_block_size = 16;
|
||||
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Error 1005 Can't create table 'test.t5' (errno: 1478)
|
||||
create table t6 (id int primary key) engine = innodb row_format = compressed;
|
||||
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
|
||||
Error 1005 Can't create table 'test.t6' (errno: 1478)
|
||||
create table t7 (id int primary key) engine = innodb row_format = dynamic;
|
||||
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
|
||||
Error 1005 Can't create table 'test.t7' (errno: 1478)
|
||||
create table t8 (id int primary key) engine = innodb row_format = compact;
|
||||
create table t9 (id int primary key) engine = innodb row_format = redundant;
|
||||
@ -345,45 +345,45 @@ set global innodb_file_per_table = on;
|
||||
set global innodb_file_format = `0`;
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 1;
|
||||
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Error 1005 Can't create table 'test.t1' (errno: 1478)
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 2;
|
||||
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Error 1005 Can't create table 'test.t2' (errno: 1478)
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 4;
|
||||
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Error 1005 Can't create table 'test.t3' (errno: 1478)
|
||||
create table t4 (id int primary key) engine = innodb key_block_size = 8;
|
||||
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Error 1005 Can't create table 'test.t4' (errno: 1478)
|
||||
create table t5 (id int primary key) engine = innodb key_block_size = 16;
|
||||
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Error 1005 Can't create table 'test.t5' (errno: 1478)
|
||||
create table t6 (id int primary key) engine = innodb row_format = compressed;
|
||||
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
|
||||
Error 1005 Can't create table 'test.t6' (errno: 1478)
|
||||
create table t7 (id int primary key) engine = innodb row_format = dynamic;
|
||||
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
|
||||
show errors;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
|
||||
Error 1005 Can't create table 'test.t7' (errno: 1478)
|
||||
create table t8 (id int primary key) engine = innodb row_format = compact;
|
||||
create table t9 (id int primary key) engine = innodb row_format = redundant;
|
||||
|
@ -1,2 +1 @@
|
||||
innodb-index: InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
|
||||
innodb_information_schema: Bug #47808 joro : innodb_information_schema.test fails when run under valgrind
|
||||
|
@ -175,11 +175,11 @@ set innodb_strict_mode = on;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 0;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 9;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 1;
|
||||
@ -205,22 +205,22 @@ key_block_size = 8 row_format = compressed;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = redundant;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t3 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = compact;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t4 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = dynamic;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t5 (id int primary key) engine = innodb
|
||||
key_block_size = 8 row_format = default;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
SELECT table_schema, table_name, row_format
|
||||
FROM information_schema.tables WHERE engine='innodb';
|
||||
@ -230,17 +230,17 @@ drop table t1;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = redundant;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = compact;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = dynamic;
|
||||
show errors;
|
||||
show warnings;
|
||||
|
||||
SELECT table_schema, table_name, row_format
|
||||
FROM information_schema.tables WHERE engine='innodb';
|
||||
@ -250,25 +250,25 @@ set global innodb_file_per_table = off;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 1;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 2;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 4;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t4 (id int primary key) engine = innodb key_block_size = 8;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t5 (id int primary key) engine = innodb key_block_size = 16;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t6 (id int primary key) engine = innodb row_format = compressed;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t7 (id int primary key) engine = innodb row_format = dynamic;
|
||||
show errors;
|
||||
show warnings;
|
||||
create table t8 (id int primary key) engine = innodb row_format = compact;
|
||||
create table t9 (id int primary key) engine = innodb row_format = redundant;
|
||||
|
||||
@ -282,25 +282,25 @@ set global innodb_file_format = `0`;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 1;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 2;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 4;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t4 (id int primary key) engine = innodb key_block_size = 8;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t5 (id int primary key) engine = innodb key_block_size = 16;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t6 (id int primary key) engine = innodb row_format = compressed;
|
||||
show errors;
|
||||
show warnings;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t7 (id int primary key) engine = innodb row_format = dynamic;
|
||||
show errors;
|
||||
show warnings;
|
||||
create table t8 (id int primary key) engine = innodb row_format = compact;
|
||||
create table t9 (id int primary key) engine = innodb row_format = redundant;
|
||||
|
||||
|
@ -110,14 +110,18 @@ SELECT * FROM ```t'\"_str` WHERE c1 = '3' FOR UPDATE;
|
||||
-- send
|
||||
SELECT * FROM ```t'\"_str` WHERE c1 = '4' FOR UPDATE;
|
||||
|
||||
# Give time to the above 2 queries to execute before continuing.
|
||||
# Without this sleep it sometimes happens that the SELECT from innodb_locks
|
||||
# executes before some of them, resulting in less than expected number
|
||||
# of rows being selected from innodb_locks.
|
||||
-- sleep 0.1
|
||||
|
||||
-- enable_result_log
|
||||
-- connection con_verify_innodb_locks
|
||||
# Wait for the above queries to execute before continuing.
|
||||
# Without this, it sometimes happens that the SELECT from innodb_locks
|
||||
# executes before some of them, resulting in less than expected number
|
||||
# of rows being selected from innodb_locks. If there is a bug and there
|
||||
# are no 14 rows in innodb_locks then this test will fail with timeout.
|
||||
let $count = 14;
|
||||
let $table = INFORMATION_SCHEMA.INNODB_LOCKS;
|
||||
-- source include/wait_until_rows_count.inc
|
||||
# the above enables the query log, re-disable it
|
||||
-- disable_query_log
|
||||
SELECT lock_mode, lock_type, lock_table, lock_index, lock_rec, lock_data
|
||||
FROM INFORMATION_SCHEMA.INNODB_LOCKS ORDER BY lock_data;
|
||||
|
||||
|
@ -2,13 +2,6 @@
|
||||
# add setting to connect the slave to the master by default
|
||||
!include rpl_1slave_base.cnf
|
||||
|
||||
[mysqld.2]
|
||||
# Hardcode the host to 127.0.0.1 until running on more
|
||||
# than one host and it need to be masked
|
||||
# master-host= @mysqld.1.#host
|
||||
master-host= 127.0.0.1
|
||||
master-port= @mysqld.1.port
|
||||
master-password= @mysqld.1.#password
|
||||
master-user= @mysqld.1.#user
|
||||
master-connect-retry= 1
|
||||
|
||||
[mysqld.2]
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
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;
|
||||
stop slave;
|
||||
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
|
||||
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
|
||||
start slave;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user