diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7107a112f19..2f6e1236542 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,10 @@ IF(CYBOZU)
ADD_DEFINITIONS(-DCYBOZU)
ENDIF(CYBOZU)
+IF(EXTRA_DEBUG)
+ ADD_DEFINITIONS(-D EXTRA_DEBUG)
+ENDIF(EXTRA_DEBUG)
+
# in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
diff --git a/client/mysql.cc b/client/mysql.cc
index 024194d81f6..ed80e298897 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1627,8 +1627,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_nopager= 1;
break;
case OPT_MYSQL_PROTOCOL:
+#ifndef EMBEDDED_LIBRARY
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
+#endif
break;
case OPT_SERVER_ARG:
#ifdef EMBEDDED_LIBRARY
@@ -2018,7 +2020,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
{
if (!preserve_comments)
{
- // Skip spaces at the beggining of a statement
+ // Skip spaces at the beginning of a statement
if (my_isspace(charset_info,inchar) && (out == line) &&
buffer.is_empty())
continue;
@@ -2101,37 +2103,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
continue;
}
}
- else if (!*ml_comment && !*in_string &&
- (end_of_line - pos) >= 10 &&
- !my_strnncoll(charset_info, (uchar*) pos, 10,
- (const uchar*) "delimiter ", 10))
- {
- // Flush previously accepted characters
- if (out != line)
- {
- buffer.append(line, (uint32) (out - line));
- out= line;
- }
-
- // Flush possible comments in the buffer
- if (!buffer.is_empty())
- {
- if (com_go(&buffer, 0) > 0) // < 0 is not fatal
- DBUG_RETURN(1);
- buffer.length(0);
- }
-
- /*
- Delimiter wants the get rest of the given line as argument to
- allow one to change ';' to ';;' and back
- */
- buffer.append(pos);
- if (com_delimiter(&buffer, pos) > 0)
- DBUG_RETURN(1);
-
- buffer.length(0);
- break;
- }
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
{
// Found a statement. Continue parsing after the delimiter
@@ -2194,8 +2165,24 @@ static bool add_line(String &buffer,char *line,char *in_string,
// comment to end of line
if (preserve_comments)
+ {
+ bool started_with_nothing= !buffer.length();
+
buffer.append(pos);
+ /*
+ A single-line comment by itself gets sent immediately so that
+ client commands (delimiter, status, etc) will be interpreted on
+ the next line.
+ */
+ if (started_with_nothing)
+ {
+ if (com_go(&buffer, 0) > 0) // < 0 is not fatal
+ DBUG_RETURN(1);
+ buffer.length(0);
+ }
+ }
+
break;
}
else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 4d2460dc4e7..190bb2383e9 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -620,6 +620,20 @@ static int run_mysqlcheck_upgrade(void)
}
+static int run_mysqlcheck_fixnames(void)
+{
+ verbose("Running 'mysqlcheck'...");
+ return run_tool(mysqlcheck_path,
+ NULL, /* Send output from mysqlcheck directly to screen */
+ "--no-defaults",
+ ds_args.str,
+ "--all-databases",
+ "--fix-db-names",
+ "--fix-table-names",
+ NULL);
+}
+
+
static const char *expected_errors[]=
{
"ERROR 1060", /* Duplicate column name */
@@ -782,7 +796,8 @@ int main(int argc, char **argv)
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
- if (run_mysqlcheck_upgrade() ||
+ if (run_mysqlcheck_fixnames() ||
+ run_mysqlcheck_upgrade() ||
run_sql_fix_privilege_tables())
{
/*
diff --git a/dbug/dbug.c b/dbug/dbug.c
index bbd1abb9598..baf080f5e27 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -1851,13 +1851,7 @@ static void DBUGOpenFile(CODE_STATE *cs,
else
{
newfile= !EXISTS(name);
- if (!(fp= fopen(name,
-#if defined(MSDOS) || defined(__WIN__)
- append ? "a+c" : "wc"
-#else
- append ? "a+" : "w"
-#endif
- )))
+ if (!(fp= fopen(name, append ? "a+" : "w")))
{
(void) fprintf(stderr, ERR_OPEN, cs->process, name);
perror("");
@@ -2407,13 +2401,4 @@ int i_am_a_dummy_function() {
return 0;
}
-#ifdef __WIN__
-char _db_doprnt_;
-char _db_enter_;
-char _db_pargs_;
-char _db_process_;
-char _db_push_;
-char _db_return_;
-#endif /*__WIN__*/
-
#endif
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index 5606c17ecf3..447d63890bd 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -290,7 +290,8 @@ static void do_resolve()
char buf[1024], *p;
while (fgets(buf, sizeof(buf), fp_dump))
{
- p = buf;
+ /* skip bracket */
+ p= (p= strchr(buf, '[')) ? p+1 : buf;
/* skip space */
while (my_isspace(&my_charset_latin1,*p))
++p;
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index de09f1ebe4b..05b34a0dc45 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -203,8 +203,8 @@ SSL_CTX* SSL_CTX_new(SSL_METHOD*);
SSL* SSL_new(SSL_CTX*);
int SSL_set_fd (SSL*, YASSL_SOCKET_T);
YASSL_SOCKET_T SSL_get_fd(const SSL*);
-int SSL_connect(SSL*); // if you get an error from connect
- // see note at top of REAMDE
+int SSL_connect(SSL*); /* if you get an error from connect
+ see note at top of REAMDE */
int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int);
int SSL_accept(SSL*);
diff --git a/include/config-win.h b/include/config-win.h
index cc2b2767663..15c107597d1 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -250,6 +250,15 @@ inline double ulonglong2double(ulonglong value)
#define my_off_t2double(A) ulonglong2double(A)
#endif /* _WIN64 */
+inline ulonglong double2ulonglong(double d)
+{
+ double t= d - (double) 0x8000000000000000ULL;
+
+ if (t >= 0)
+ return ((ulonglong) t) + 0x8000000000000000ULL;
+ return (ulonglong) d;
+}
+
#if SIZEOF_OFF_T > 4
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
#define tell(A) _telli64(A)
diff --git a/include/m_ctype.h b/include/m_ctype.h
index b85894e94f5..04cf921dfee 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -472,6 +472,7 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
+uint my_charset_repertoire(CHARSET_INFO *cs);
#define _MY_U 01 /* Upper case */
diff --git a/include/my_dbug.h b/include/my_dbug.h
index fa7941faf1c..a77e439b5db 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -108,22 +108,6 @@ extern FILE *_db_fp_(void);
#define DBUG_EXPLAIN(buf,len)
#define DBUG_EXPLAIN_INITIAL(buf,len)
#define IF_DBUG(A)
-
-#ifdef __WIN__
-/*
- On windows all the dll export has to be declared in the *.def file
- so as we export these symbols in DEBUG mode we have to export
- these in the RELEASE mode also. So below are the dummy symbols
- for the RELEASE export
-*/
-extern char _db_doprnt_;
-extern char _db_enter_;
-extern char _db_pargs_;
-extern char _db_process_;
-extern char _db_push_;
-extern char _db_return_;
-#endif /*__WIN__*/
-
#endif
#ifdef __cplusplus
}
diff --git a/include/my_global.h b/include/my_global.h
index 4feed96e7d6..8fb5a6b69da 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -789,6 +789,9 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define ulonglong2double(A) ((double) (ulonglong) (A))
#define my_off_t2double(A) ((double) (my_off_t) (A))
#endif
+#ifndef double2ulonglong
+#define double2ulonglong(A) ((ulonglong) (double) (A))
+#endif
#endif
#ifndef offsetof
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 1eab4199deb..ca329eadf0f 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -207,9 +207,7 @@ void STDCALL mysql_server_end()
/* If library called my_init(), free memory allocated by it */
if (!org_my_init_done)
{
- my_end(MY_DONT_FREE_DBUG);
- /* Remove TRACING, if enabled by mysql_debug() */
- DBUG_POP();
+ my_end(0);
}
else
{
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index 137dd11d28e..346278425a7 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -29,13 +29,13 @@ ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc
../../client/sql_string.cc)
-TARGET_LINK_LIBRARIES(mysql_embedded wsock32)
+TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
ADD_DEPENDENCIES(mysql_embedded libmysqld)
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
-TARGET_LINK_LIBRARIES(mysqltest_embedded wsock32)
+TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
-TARGET_LINK_LIBRARIES(mysql_client_test_embedded wsock32)
+TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index e78c656d565..23572ad4929 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -386,6 +386,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
thd->store_globals();
thd->unlink();
delete thd;
+ my_pthread_setspecific_ptr(THR_THD, 0);
mysql->thd=0;
}
@@ -539,12 +540,7 @@ int init_embedded_server(int argc, char **argv, char **groups)
(void) thr_setconcurrency(concurrency); // 10 by default
- if (flush_time && flush_time != ~(ulong) 0L)
- {
- pthread_t hThread;
- if (pthread_create(&hThread,&connection_attrib,handle_manager,0))
- sql_print_error("Warning: Can't create thread to manage maintenance");
- }
+ start_handle_manager();
// FIXME initialize binlog_filter and rpl_filter if not already done
// corresponding delete is in clean_up()
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index 865475cb56c..047cfe0fe57 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -2,94 +2,6 @@ LIBRARY LIBMYSQLD
DESCRIPTION 'MySQL 5.1 Embedded Server Library'
VERSION 5.1
EXPORTS
- _db_process_
- _db_enter_
- _db_return_
- _db_push_
- _db_doprnt_
- _db_pargs_
- strnmov
- get_charset
- my_memmem
- my_snprintf
- pthread_exit
- pthread_cond_signal
- dynstr_append_mem
- init_dynamic_string
- dynstr_free
- my_hash_free
- my_vsnprintf
- dynstr_append
- my_close
- my_open
- dynstr_set
- dynstr_append_os_quoted
- my_delete
- my_seek
- my_write
- create_temp_file
- fn_format
- dirname_part
- my_hash_insert
- my_hash_search
- test_if_hard_path
- my_copy
- my_mkdir
- my_sleep
- my_strtod
- pthread_cond_wait
- my_strnncoll_simple
- get_dynamic
- my_regerror
- init_dynamic_array2
- pthread_create
- pthread_cond_init
- my_regcomp
- my_regexec
- my_regex_end
- my_regfree
- longlong2str
- my_set_exception_pointers
- my_print_stacktrace
- my_thread_stack_size
- my_safe_print_str
- my_stat
- _my_hash_init
- pthread_attr_setstacksize
- pthread_attr_init
- my_dirend
- wild_compare
- my_dir
- my_micro_time
- find_type_or_exit
- _dig_vec_upper
- _dig_vec_lower
- bmove_upp
- delete_dynamic
- free_defaults
- getopt_compare_strings
- getopt_ull_limit_value
- handle_options
- init_dynamic_array
- insert_dynamic
- int2str
- is_prefix
- list_add
- list_delete
- load_defaults
- max_allowed_packet
- my_cgets
- my_end
- my_getopt_print_errors
- my_init
- my_malloc
- my_memdup
- my_no_flags_free
- my_path
- my_print_help
- my_print_variables
- my_realloc
- my_strdup
mysql_thread_end
mysql_thread_init
myodbc_remove_escape
@@ -162,47 +74,13 @@ EXPORTS
mysql_thread_safe
mysql_use_result
mysql_warning_count
- set_dynamic
- strcend
- strcont
- strdup_root
- strfill
- strinstr
- strmake
- strmov
- strxmov
mysql_server_end
mysql_server_init
get_tty_password
- sql_protocol_typelib
mysql_get_server_version
mysql_set_character_set
mysql_sqlstate
- charsets_dir
- disabled_my_option
- my_charset_latin1
- init_alloc_root
- my_progname
- get_charset_name
- get_charset_by_csname
- print_defaults
- find_type
- strxnmov
- strend
- my_fopen
- my_fclose
- unpack_filename
- str2int
- int10_to_str
- longlong10_to_str
- my_snprintf_8bit
- alloc_root
- free_root
- my_read
- llstr
mysql_get_parameters
- mysql_thread_init
- mysql_thread_end
mysql_stmt_bind_param
mysql_stmt_bind_result
mysql_stmt_execute
@@ -230,7 +108,3 @@ EXPORTS
mysql_stmt_attr_get
mysql_stmt_attr_set
mysql_stmt_field_count
- get_defaults_options
- my_charset_bin
- my_charset_same
- modify_defaults_file
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index 98f9c93b25a..48b0eac12e5 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -671,8 +671,11 @@ call p_verify_status_increment(2, 2, 2, 2);
savepoint a;
call p_verify_status_increment(0, 0, 0, 0);
insert t1 set a=4;
---echo # Sic: a bug. Binlog did not register itself this time.
-call p_verify_status_increment(1, 0, 1, 0);
+--echo # Binlog does not register itself this time for other than the 1st
+--echo # statement of the transaction with MIXED/STATEMENT binlog_format.
+--echo # It needs registering with the ROW format. Therefore 1,0,2,2 are
+--echo # the correct arguments to this test after bug#40221 fixed.
+call p_verify_status_increment(1, 0, 2, 2);
release savepoint a;
rollback;
call p_verify_status_increment(0, 0, 0, 0);
diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc
new file mode 100644
index 00000000000..c85786bd524
--- /dev/null
+++ b/mysql-test/include/have_simple_parser.inc
@@ -0,0 +1,16 @@
+#
+# Check if server has support for loading udf's
+# i.e it will support dlopen
+#
+--require r/have_dynamic_loading.require
+disable_query_log;
+show variables like 'have_dynamic_loading';
+enable_query_log;
+
+#
+# Check if the variable SIMPLE_PARSER is set
+#
+--require r/have_simple_parser.require
+disable_query_log;
+eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
+enable_query_log;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index 023d582065e..5837df67a75 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -501,4 +501,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
DROP TABLE t1;
+--echo #
+--echo # BUG#40974: Incorrect query results when using clause evaluated using range check
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2(a int, b int);
+insert into t2 values (1,1), (2, 1000);
+create table t3 (a int, b int, filler char(100), key(a), key(b));
+
+insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
+insert into t3 values (1,1,'data');
+insert into t3 values (1,1,'data');
+-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
+explain select * from t1
+where exists (select 1 from t2, t3
+ where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+
+select * from t1
+where exists (select 1 from t2, t3
+ where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+
+drop table t0, t1, t2, t3;
+
--echo End of 5.0 tests
diff --git a/mysql-test/include/linux_sys_vars.inc b/mysql-test/include/linux_sys_vars.inc
index 4401a1e057a..85d7c6df7dc 100644
--- a/mysql-test/include/linux_sys_vars.inc
+++ b/mysql-test/include/linux_sys_vars.inc
@@ -9,7 +9,6 @@ SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size = 131072;
-SET @min_key_buffer_size = 36;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
diff --git a/mysql-test/include/wait_condition_sp.inc b/mysql-test/include/wait_condition_sp.inc
new file mode 100644
index 00000000000..66301da557c
--- /dev/null
+++ b/mysql-test/include/wait_condition_sp.inc
@@ -0,0 +1,62 @@
+# include/wait_condition.inc
+#
+# SUMMARY
+#
+# Waits until the passed statement returns true, or the operation
+# times out.
+#
+# USAGE
+#
+# let $wait_condition=
+# SELECT c = 3 FROM t;
+# --source include/wait_condition.inc
+#
+# OR
+#
+# let $wait_timeout= 60; # Override default 30 seconds with 60.
+# let $wait_condition=
+# SELECT c = 3 FROM t;
+# --source include/wait_condition.inc
+# --echo Executed the test condition $wait_condition_reps times
+#
+# EXAMPLE
+# events_bugs.test, events_time_zone.test
+#
+
+--disable_query_log
+
+let $wait_counter= 300;
+if ($wait_timeout)
+{
+ let $wait_counter= `SELECT $wait_timeout * 10`;
+}
+# Reset $wait_timeout so that its value won't be used on subsequent
+# calls, and default will be used instead.
+let $wait_timeout= 0;
+
+# Keep track of how many times the wait condition is tested
+# This is used by some tests (e.g., main.status)
+let $wait_condition_reps= 0;
+while ($wait_counter)
+{
+ let $success= `$wait_condition`;
+ inc $wait_condition_reps;
+ if ($success)
+ {
+ let $wait_counter= 0;
+ }
+ if (!$success)
+ {
+ real_sleep 0.1;
+ dec $wait_counter;
+ }
+}
+if (!$success)
+{
+ echo Timeout in wait_condition.inc for $wait_condition;
+ show master status;
+ show slave status;
+}
+
+--enable_query_log
+
diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc
index dc96f646cb3..d7e31d400c0 100644
--- a/mysql-test/include/wait_until_connected_again.inc
+++ b/mysql-test/include/wait_until_connected_again.inc
@@ -6,7 +6,7 @@
let $counter= 500;
while ($mysql_errno)
{
- --error 0,2002,2006
+ --error 0,2002,2003,2006,2013
show status;
dec $counter;
diff --git a/mysql-test/include/windows_sys_vars.inc b/mysql-test/include/windows_sys_vars.inc
index 90ff86fefd1..1d51ddb52f9 100644
--- a/mysql-test/include/windows_sys_vars.inc
+++ b/mysql-test/include/windows_sys_vars.inc
@@ -9,7 +9,6 @@ SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size= 131072;
-SET @min_key_buffer_size= 8;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index 3c78c3ca064..e3fabccd86d 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -412,7 +412,10 @@ sub mtr_report_stats ($) {
# When trying to set lower_case_table_names = 2
# on a case sensitive file system. Bug#37402.
- /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./
+ /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or
+
+ # this test is expected to print warnings
+ ($testname eq 'main.innodb_bug39438')
)
{
next; # Skip these lines
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index b342421ca2e..a6105d2edff 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -163,6 +163,7 @@ our $exe_my_print_defaults;
our $exe_perror;
our $lib_udf_example;
our $lib_example_plugin;
+our $lib_simple_parser;
our $exe_libtool;
our $opt_bench= 0;
@@ -1717,6 +1718,10 @@ sub executable_setup () {
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
"$glob_basedir/storage/example/.libs/ha_example.so",);
+ # Look for the simple_parser library
+ $lib_simple_parser=
+ mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'),
+ "$glob_basedir/plugin/fulltext/.libs/mypluglib.so",);
}
# Look for mysqltest executable
@@ -2199,6 +2204,14 @@ sub environment_setup () {
$ENV{'EXAMPLE_PLUGIN_OPT'}=
($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
+ # ----------------------------------------------------
+ # Add the path where mysqld will find mypluglib.so
+ # ----------------------------------------------------
+ $ENV{'SIMPLE_PARSER'}=
+ ($lib_simple_parser ? basename($lib_simple_parser) : "");
+ $ENV{'SIMPLE_PARSER_OPT'}=
+ ($lib_simple_parser ? "--plugin_dir=" . dirname($lib_simple_parser) : "");
+
# ----------------------------------------------------
# Setup env so childs can execute myisampack and myisamchk
# ----------------------------------------------------
@@ -2386,6 +2399,9 @@ sub remove_stale_vardir () {
mtr_verbose("Removing $opt_vardir/");
mtr_rmtree("$opt_vardir/");
}
+ # Remove the "tmp" dir
+ mtr_verbose("Removing $opt_tmpdir/");
+ mtr_rmtree("$opt_tmpdir/");
}
#
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index f0edfc9bb59..5a115e9ea99 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -996,6 +996,22 @@ SELECT * FROM t1;
v b
abc 5
DROP TABLE t1;
+create table t1 (a tinytext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table t1;
+create table t1 (a mediumtext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table t1;
End of 5.0 tests
drop table if exists t1, t2, t3;
create table t1 (i int);
diff --git a/mysql-test/r/binlog_index.result b/mysql-test/r/binlog_index.result
index 9f3c3746bd4..84112603239 100644
--- a/mysql-test/r/binlog_index.result
+++ b/mysql-test/r/binlog_index.result
@@ -21,6 +21,7 @@ flush logs;
*** must be a warning master-bin.000001 was not found ***
Warnings:
Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
+Warning 1612 Being purged log MYSQLTEST_VARDIR/log/master-bin.000001 was not found
*** must show one record, of the active binlog, left in the index file after PURGE ***
show binary logs;
Log_name File_size
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index a2c1eb9a82e..766b920f630 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -770,8 +770,11 @@ call p_verify_status_increment(0, 0, 0, 0);
SUCCESS
insert t1 set a=4;
-# Sic: a bug. Binlog did not register itself this time.
-call p_verify_status_increment(1, 0, 1, 0);
+# Binlog does not register itself this time for other than the 1st
+# statement of the transaction with MIXED/STATEMENT binlog_format.
+# It needs registering with the ROW format. Therefore 1,0,2,2 are
+# the correct arguments to this test after bug#40221 fixed.
+call p_verify_status_increment(1, 0, 2, 2);
SUCCESS
release savepoint a;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 947890d2085..67f81cb4fa5 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1890,5 +1890,7 @@ c1 c2
DROP TABLE t1;
# -- End of Bug#34274
+create table `me:i`(id int);
+drop table `me:i`;
End of 5.1 tests
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 8bc6114dbc2..9deaf55c535 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5394,4 +5394,17 @@ select * from t1;
ERROR HY000: File './test/t1.CSV' not found (Errcode: 2)
unlock tables;
drop table t1;
+create table t1(a enum ('a') not null) engine=csv;
+insert into t1 values (2);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select * from t1 limit 1;
+ERROR HY000: Table 't1' is marked as crashed and should be repaired
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair Warning Data truncated for column 'a' at row 1
+test.t1 repair status OK
+select * from t1 limit 1;
+a
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index ec2182a3304..428629e7e9e 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -1157,4 +1157,57 @@ set names latin1;
select hex(char(0x41 using ucs2));
hex(char(0x41 using ucs2))
0041
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+CHARSET(DAYNAME(19700101))
+ucs2
+SELECT CHARSET(MONTHNAME(19700101));
+CHARSET(MONTHNAME(19700101))
+ucs2
+SELECT LOWER(DAYNAME(19700101));
+LOWER(DAYNAME(19700101))
+thursday
+SELECT LOWER(MONTHNAME(19700101));
+LOWER(MONTHNAME(19700101))
+january
+SELECT UPPER(DAYNAME(19700101));
+UPPER(DAYNAME(19700101))
+THURSDAY
+SELECT UPPER(MONTHNAME(19700101));
+UPPER(MONTHNAME(19700101))
+JANUARY
+SELECT HEX(MONTHNAME(19700101));
+HEX(MONTHNAME(19700101))
+004A0061006E0075006100720079
+SELECT HEX(DAYNAME(19700101));
+HEX(DAYNAME(19700101))
+00540068007500720073006400610079
+SET LC_TIME_NAMES=ru_RU;
+SET NAMES utf8;
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+CHARSET(DAYNAME(19700101))
+ucs2
+SELECT CHARSET(MONTHNAME(19700101));
+CHARSET(MONTHNAME(19700101))
+ucs2
+SELECT LOWER(DAYNAME(19700101));
+LOWER(DAYNAME(19700101))
+четверг
+SELECT LOWER(MONTHNAME(19700101));
+LOWER(MONTHNAME(19700101))
+января
+SELECT UPPER(DAYNAME(19700101));
+UPPER(DAYNAME(19700101))
+ЧЕТВЕРГ
+SELECT UPPER(MONTHNAME(19700101));
+UPPER(MONTHNAME(19700101))
+ЯНВАРЯ
+SELECT HEX(MONTHNAME(19700101));
+HEX(MONTHNAME(19700101))
+042F043D043204300440044F
+SELECT HEX(DAYNAME(19700101));
+HEX(DAYNAME(19700101))
+0427043504420432043504400433
+SET character_set_connection=latin1;
End of 5.0 tests
diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result
index 63140bffaa4..7dfd10a53f8 100644
--- a/mysql-test/r/events_scheduling.result
+++ b/mysql-test/r/events_scheduling.result
@@ -62,18 +62,6 @@ CREATE EVENT event_4 ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND
ON COMPLETION PRESERVE
DO
INSERT INTO table_4 VALUES (1);
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
-IF(SUM(a) >= 4, 'OK', 'ERROR')
-OK
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
-IF(SUM(a) >= 4, 'OK', 'ERROR')
-OK
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
-IF(SUM(a) >= 1, 'OK', 'ERROR')
-OK
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4;
-IF(SUM(a) >= 1, 'OK', 'ERROR')
-OK
SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 0124ced40ce..8633bd61681 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -522,3 +522,12 @@ WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 4 Using where
DROP TABLE t1;
+CREATE TABLE t1(a CHAR(10));
+INSERT INTO t1 VALUES('aaa15');
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
+MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE)
+1
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
+MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
+2
+DROP TABLE t1;
diff --git a/mysql-test/r/fulltext_plugin.result b/mysql-test/r/fulltext_plugin.result
new file mode 100644
index 00000000000..69ebbe07e9e
--- /dev/null
+++ b/mysql-test/r/fulltext_plugin.result
@@ -0,0 +1,5 @@
+INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
+CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
+ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
+DROP TABLE t1;
+UNINSTALL PLUGIN simple_parser;
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index 62d34c5ce8f..955a784f04c 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -176,4 +176,13 @@ IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((R
DROP TABLE t1;
+CREATE TABLE t1 (c LONGTEXT);
+INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890');
+SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+MAX(IF(1, CAST(c AS UNSIGNED), 0))
+12345678901234567890
+SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+MAX(IFNULL(CAST(c AS UNSIGNED), 0))
+12345678901234567890
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 78748a4622f..0824f13cafc 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -717,8 +717,6 @@ insert(_latin2'abcd',2,3,_latin2'ef'),
replace(_latin2'abcd',_latin2'b',_latin2'B'),
encode('abcd','ab')
;
-Warnings:
-Warning 1265 Data truncated for column 'format(130,10)' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -727,7 +725,7 @@ t1 CREATE TABLE `t1` (
`conv(130,16,10)` varchar(64) DEFAULT NULL,
`hex(130)` varchar(6) NOT NULL DEFAULT '',
`char(130)` varbinary(4) NOT NULL DEFAULT '',
- `format(130,10)` varchar(4) NOT NULL DEFAULT '',
+ `format(130,10)` varchar(37) NOT NULL DEFAULT '',
`left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
@@ -2513,4 +2511,12 @@ SELECT HEX(c1) from v1;
HEX(c1)
414243
DROP VIEW v1;
+create table t1(a float);
+insert into t1 values (1.33);
+select format(a, 2) from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def format(a, 2) 253 49 4 Y 0 31 8
+format(a, 2)
+1.33
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index cc0fb88b791..b1287a951aa 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -592,6 +592,21 @@ unix_timestamp('1970-01-01 03:00:01')
select unix_timestamp('2038-01-19 07:14:07');
unix_timestamp('2038-01-19 07:14:07')
0
+SELECT CHARSET(DAYNAME(19700101));
+CHARSET(DAYNAME(19700101))
+latin1
+SELECT CHARSET(MONTHNAME(19700101));
+CHARSET(MONTHNAME(19700101))
+latin1
+SELECT LOWER(DAYNAME(19700101));
+LOWER(DAYNAME(19700101))
+thursday
+SELECT LOWER(MONTHNAME(19700101));
+LOWER(MONTHNAME(19700101))
+january
+SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
+COERCIBILITY(MONTHNAME('1970-01-01')) COERCIBILITY(DAYNAME('1970-01-01'))
+4 4
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
SELECT * from t1;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 16be3eb966d..0fe8ab444a7 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1246,6 +1246,11 @@ drop user 'greg'@'localhost';
drop view v1;
drop table test;
drop function test_function;
+SELECT CURRENT_USER();
+CURRENT_USER()
+root@localhost
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;
diff --git a/mysql-test/r/have_simple_parser.require b/mysql-test/r/have_simple_parser.require
new file mode 100644
index 00000000000..0e023bd6983
--- /dev/null
+++ b/mysql-test/r/have_simple_parser.require
@@ -0,0 +1,2 @@
+have_simple_parser
+1
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 45d335bba9e..19826aca43a 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -529,6 +529,34 @@ b a
y
z
DROP TABLE t1;
+#
+# BUG#40974: Incorrect query results when using clause evaluated using range check
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2(a int, b int);
+insert into t2 values (1,1), (2, 1000);
+create table t3 (a int, b int, filler char(100), key(a), key(b));
+insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
+insert into t3 values (1,1,'data');
+insert into t3 values (1,1,'data');
+The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
+explain select * from t1
+where exists (select 1 from t2, t3
+where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t3 ALL a,b NULL NULL NULL 1002 Range checked for each record (index map: 0x3)
+select * from t1
+where exists (select 1 from t2, t3
+where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+a
+1
+2
+drop table t0, t1, t2, t3;
End of 5.0 tests
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 85af461eb14..4fd0bdde063 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1707,4 +1707,9 @@ where a.VARIABLE_NAME = b.VARIABLE_NAME;
a.VARIABLE_VALUE - b.VARIABLE_VALUE
2
drop table t0;
+CREATE TABLE t1(a INT) KEY_BLOCK_SIZE=1;
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+CREATE_OPTIONS
+KEY_BLOCK_SIZE=1
+DROP TABLE t1;
End of 5.1 tests.
diff --git a/mysql-test/r/innodb-autoinc.result b/mysql-test/r/innodb-autoinc.result
index e000f910772..1e4b088c6cd 100644
--- a/mysql-test/r/innodb-autoinc.result
+++ b/mysql-test/r/innodb-autoinc.result
@@ -169,3 +169,413 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1);
+INSERT INTO t1 VALUES (NULL,8);
+SELECT * FROM t1;
+c1 c2
+2 1
+3 8
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1), (NULL, 8);
+INSERT INTO t1 VALUES (NULL,9);
+SELECT * FROM t1;
+c1 c2
+2 1
+3 8
+5 9
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(5),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+5
+10
+110
+250
+310
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+c1
+5
+10
+110
+250
+310
+400
+410
+1000
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(0);
+SELECT * FROM t1;
+c1
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+-1
+1
+2
+10
+110
+250
+410
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+Got one of the listed errors
+SELECT * FROM t1;
+c1
+-1
+1
+2
+10
+110
+250
+410
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+c1
+-1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+-2
+-1
+1
+2
+10
+250
+310
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+c1
+-2
+-1
+1
+2
+10
+250
+310
+400
+410
+1000
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+SELECT * FROM t1;
+c1
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+INSERT INTO t1 VALUES (-2);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (250);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+310
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+310
+400
+1000
+1010
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+SELECT * FROM t1;
+c1
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 100
+auto_increment_offset 10
+INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+410
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+Got one of the listed errors
+SELECT * FROM t1;
+c1
+1
+2
+10
+110
+210
+250
+410
+1000
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (9223372036854775794);
+SELECT * FROM t1;
+c1
+1
+9223372036854775794
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 2
+auto_increment_offset 10
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+SELECT * FROM t1;
+c1
+1
+9223372036854775794
+9223372036854775796
+9223372036854775798
+9223372036854775800
+9223372036854775802
+9223372036854775804
+9223372036854775806
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 2
+auto_increment_offset 10
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+18446744073709551604
+18446744073709551606
+18446744073709551608
+18446744073709551610
+18446744073709551612
+18446744073709551614
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 5
+auto_increment_offset 7
+INSERT INTO t1 VALUES (NULL),(NULL);
+SELECT * FROM t1;
+c1
+1
+18446744073709551603
+18446744073709551607
+18446744073709551612
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(-9223372036854775806);
+INSERT INTO t1 VALUES(-9223372036854775807);
+INSERT INTO t1 VALUES(-9223372036854775808);
+SELECT * FROM t1;
+c1
+-9223372036854775808
+-9223372036854775807
+-9223372036854775806
+1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 3
+auto_increment_offset 3
+INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
+SELECT * FROM t1;
+c1
+-9223372036854775808
+-9223372036854775807
+-9223372036854775806
+1
+3
+6
+9
+DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551610);
+SELECT * FROM t1;
+c1
+1
+18446744073709551610
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
+Warnings:
+Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976'
+Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976'
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 65535
+auto_increment_offset 65535
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+c1
+1
+18446744073709551610
+18446744073709551615
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 5f8c59b9a0c..7806262f052 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -3295,3 +3295,11 @@ info: Records: 5 Duplicates: 0 Warnings: 0
TRUNCATE TABLE t1;
affected rows: 0
DROP TABLE t1;
+Variable_name Value
+Handler_update 0
+Variable_name Value
+Handler_delete 0
+Variable_name Value
+Handler_update 1
+Variable_name Value
+Handler_delete 1
diff --git a/mysql-test/r/innodb_bug38231.result b/mysql-test/r/innodb_bug38231.result
new file mode 100644
index 00000000000..2f909779755
--- /dev/null
+++ b/mysql-test/r/innodb_bug38231.result
@@ -0,0 +1,11 @@
+SET storage_engine=InnoDB;
+INSERT INTO bug38231 VALUES (1), (10), (300);
+SET autocommit=0;
+SELECT * FROM bug38231 FOR UPDATE;
+a
+1
+10
+300
+TRUNCATE TABLE bug38231;
+COMMIT;
+DROP TABLE bug38231;
diff --git a/mysql-test/r/innodb_bug39438.result b/mysql-test/r/innodb_bug39438.result
new file mode 100644
index 00000000000..195775f74c8
--- /dev/null
+++ b/mysql-test/r/innodb_bug39438.result
@@ -0,0 +1 @@
+SET storage_engine=InnoDB;
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index aeacd054511..075b4f84f2d 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1683,3 +1683,88 @@ CREATE INDEX i1 on t1 (a(3));
SELECT * FROM t1 WHERE a = 'abcde';
a
DROP TABLE t1;
+CREATE TABLE foo (a int, b int, c char(10),
+PRIMARY KEY (c(3)),
+KEY b (b)
+) engine=innodb;
+CREATE TABLE foo2 (a int, b int, c char(10),
+PRIMARY KEY (c),
+KEY b (b)
+) engine=innodb;
+CREATE TABLE bar (a int, b int, c char(10),
+PRIMARY KEY (c(3)),
+KEY b (b)
+) engine=myisam;
+INSERT INTO foo VALUES
+(1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
+(4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
+INSERT INTO bar SELECT * FROM foo;
+INSERT INTO foo2 SELECT * FROM foo;
+EXPLAIN SELECT c FROM bar WHERE b>2;;
+id 1
+select_type SIMPLE
+table bar
+type ALL
+possible_keys b
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo WHERE b>2;;
+id 1
+select_type SIMPLE
+table foo
+type ALL
+possible_keys b
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo2 WHERE b>2;;
+id 1
+select_type SIMPLE
+table foo2
+type range
+possible_keys b
+key b
+key_len 5
+ref NULL
+rows 3
+Extra Using where; Using index
+EXPLAIN SELECT c FROM bar WHERE c>2;;
+id 1
+select_type SIMPLE
+table bar
+type ALL
+possible_keys PRIMARY
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo WHERE c>2;;
+id 1
+select_type SIMPLE
+table foo
+type ALL
+possible_keys PRIMARY
+key NULL
+key_len NULL
+ref NULL
+rows 6
+Extra Using where
+EXPLAIN SELECT c FROM foo2 WHERE c>2;;
+id 1
+select_type SIMPLE
+table foo2
+type index
+possible_keys PRIMARY
+key b
+key_len 5
+ref NULL
+rows 6
+Extra Using where; Using index
+DROP TABLE foo, bar, foo2;
+End of 5.1 tests
diff --git a/mysql-test/r/log_bin_trust_function_creators_func.result b/mysql-test/r/log_bin_trust_function_creators_func.result
index e109b53a8e7..50de0466a0d 100644
--- a/mysql-test/r/log_bin_trust_function_creators_func.result
+++ b/mysql-test/r/log_bin_trust_function_creators_func.result
@@ -10,10 +10,7 @@ create table t2 (a INT);
SELECT @@log_bin_trust_function_creators;
@@log_bin_trust_function_creators
0
-SELECT @@sql_log_bin;
-@@sql_log_bin
-1
-## Creating new function f1 ##
+## Creating new function f1 fails because no DETERMINISTIC ###
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
IF (a < 3) THEN
@@ -21,8 +18,24 @@ INSERT INTO t2 VALUES (a);
END IF;
RETURN 1;
END|
-'Bug: Create Function should give error here because non-super user';
-'is creating function here';
+ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+## Creating new function f1 fails because non-super user ##
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+IF (a < 3) THEN
+INSERT INTO t2 VALUES (a);
+END IF;
+RETURN 1;
+END|
+ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+## Creating new function f1 succeeds ##
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+IF (a < 3) THEN
+INSERT INTO t2 VALUES (a);
+END IF;
+RETURN 1;
+END|
## Creating new table t1 ##
CREATE TABLE t1 (a INT);
## Inserting some records in t1 ##
diff --git a/mysql-test/r/lowercase_utf8.result b/mysql-test/r/lowercase_utf8.result
new file mode 100644
index 00000000000..043226e1f64
--- /dev/null
+++ b/mysql-test/r/lowercase_utf8.result
@@ -0,0 +1,9 @@
+set names utf8;
+create table `Ö` (id int);
+show tables from test like 'Ö';
+Tables_in_test (Ö)
+ö
+show tables from test like 'ö';
+Tables_in_test (ö)
+ö
+drop table `Ö`;
diff --git a/mysql-test/r/myisam_data_pointer_size_func.result b/mysql-test/r/myisam_data_pointer_size_func.result
index f32e25c7427..90d224d6584 100644
--- a/mysql-test/r/myisam_data_pointer_size_func.result
+++ b/mysql-test/r/myisam_data_pointer_size_func.result
@@ -40,3 +40,4 @@ count(*)
65536
DROP PROCEDURE sp_addRec;
DROP TABLE t1;
+SET @@global.myisam_data_pointer_size = default;
diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result
index 5f39d318234..7ed9b86d887 100644
--- a/mysql-test/r/myisampack.result
+++ b/mysql-test/r/myisampack.result
@@ -27,3 +27,25 @@ CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+drop table if exists t1;
+create table t1(f1 int, f2 char(255));
+insert into t1 values(1, 'foo'), (2, 'bar');
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+flush tables;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize error Table 'test.t1' is read only
+Warnings:
+Error 1036 Table 't1' is read only
+drop table t1;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index a4d96c1c243..65f163a7acc 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -180,6 +180,12 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
1
This is a file starting with UTF8 BOM 0xEFBBBF
This is a file starting with UTF8 BOM 0xEFBBBF
+delimiter
+1
+2
+2
+2
+2
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent'
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 3e4acfdee12..607afb71da5 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -324,7 +324,7 @@ partition by hash (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
+ `a` bit(27) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
diff --git a/mysql-test/r/partition_innodb_semi_consistent.result b/mysql-test/r/partition_innodb_semi_consistent.result
new file mode 100644
index 00000000000..1bb39af043a
--- /dev/null
+++ b/mysql-test/r/partition_innodb_semi_consistent.result
@@ -0,0 +1,128 @@
+drop table if exists t1;
+set binlog_format=mixed;
+set session transaction isolation level read committed;
+create table t1(a int not null)
+engine=innodb
+DEFAULT CHARSET=latin1
+PARTITION BY RANGE(a)
+(PARTITION p0 VALUES LESS THAN (20),
+PARTITION p1 VALUES LESS THAN MAXVALUE);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7);
+set autocommit=0;
+select * from t1 where a=3 lock in share mode;
+a
+3
+set binlog_format=mixed;
+set session transaction isolation level read committed;
+set autocommit=0;
+update t1 set a=10 where a=5;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+commit;
+update t1 set a=10 where a=5;
+select * from t1 where a=2 for update;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1 where a=2 limit 1 for update;
+a
+2
+update t1 set a=11 where a=6;
+update t1 set a=12 where a=2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+update t1 set a=13 where a=1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+commit;
+update t1 set a=14 where a=1;
+commit;
+select * from t1;
+a
+10
+11
+14
+2
+3
+4
+7
+drop table t1;
+SET SESSION AUTOCOMMIT = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+set binlog_format=mixed;
+# Switch to connection con1
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (300),
+PARTITION p1 VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1,2);
+# 1. test for locking:
+BEGIN;
+UPDATE t1 SET b = 12 WHERE a = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SELECT * FROM t1;
+a b
+1 12
+# Switch to connection con2
+UPDATE t1 SET b = 21 WHERE a = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Switch to connection con1
+SELECT * FROM t1;
+a b
+1 12
+ROLLBACK;
+# 2. test for serialized update:
+CREATE TABLE t2 (a INT);
+TRUNCATE t1;
+INSERT INTO t1 VALUES (1,'init');
+CREATE PROCEDURE p1()
+BEGIN
+UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+INSERT INTO t2 VALUES ();
+END|
+BEGIN;
+UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SELECT * FROM t1;
+a b
+1 init+con1
+# Switch to connection con2
+CALL p1;;
+# Switch to connection con1
+SELECT * FROM t1;
+a b
+1 init+con1
+COMMIT;
+SELECT * FROM t1;
+a b
+1 init+con1
+# Switch to connection con2
+SELECT * FROM t1;
+a b
+1 init+con1+con2
+# Switch to connection con1
+# 3. test for updated key column:
+TRUNCATE t1;
+TRUNCATE t2;
+INSERT INTO t1 VALUES (1,'init');
+BEGIN;
+UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+SELECT * FROM t1;
+a b
+2 init+con1
+# Switch to connection con2
+CALL p1;;
+# Switch to connection con1
+SELECT * FROM t1;
+a b
+2 init+con1
+COMMIT;
+SELECT * FROM t1;
+a b
+2 init+con1
+# Switch to connection con2
+SELECT * FROM t1;
+a b
+2 init+con1
+DROP PROCEDURE p1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result
index 465bddcb3fb..a1f35756e21 100644
--- a/mysql-test/r/partition_mgm.result
+++ b/mysql-test/r/partition_mgm.result
@@ -1,4 +1,11 @@
DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY)
+ENGINE MYISAM
+PARTITION BY HASH (a)
+PARTITIONS 1;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+ALTER TABLE t1 REORGANIZE PARTITION;
+DROP TABLE t1;
create table t1 (a int)
partition by range (a)
subpartition by key (a)
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 34c86d6c8c6..3c8ff8faddc 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1116,12 +1116,13 @@ create procedure `p1`()
begin
select a, f1() from t1;
end//
+SET @log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
call p1()//
a f1()
1 2
2 2
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET GLOBAL log_bin_trust_function_creators = @log_bin_trust_function_creators;
drop procedure p1//
drop function f1//
drop table t1//
@@ -1615,41 +1616,6 @@ id
DROP PROCEDURE proc29856;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
-Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
-set GLOBAL query_cache_type=1;
-set GLOBAL query_cache_limit=10000;
-set GLOBAL query_cache_min_res_unit=0;
-set GLOBAL query_cache_size= 100000;
-flush tables;
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-insert into t1 values (1),(2),(3);
-Locking table T2 with a write lock.
-lock table t2 write;
-Select blocked by write lock.
-select *, (select count(*) from t2) from t1;;
-Sleeing is ok, because selecting should be done very fast.
-Inserting into table T1.
-insert into t1 values (4);
-Unlocking the tables.
-unlock tables;
-Collecting result from previously blocked select.
-Next select should contain 4 rows, as the insert is long finished.
-select *, (select count(*) from t2) from t1;
-a (select count(*) from t2)
-1 0
-2 0
-3 0
-4 0
-reset query cache;
-select *, (select count(*) from t2) from t1;
-a (select count(*) from t2)
-1 0
-2 0
-3 0
-4 0
-drop table t1,t2;
#
# Bug#25132 disabled query cache: Qcache_free_blocks = 1
#
diff --git a/mysql-test/r/query_cache_28249.result b/mysql-test/r/query_cache_28249.result
new file mode 100644
index 00000000000..aed84911032
--- /dev/null
+++ b/mysql-test/r/query_cache_28249.result
@@ -0,0 +1,62 @@
+SET @query_cache_type= @@global.query_cache_type;
+SET @query_cache_limit= @@global.query_cache_limit;
+SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit;
+SET @query_cache_size= @@global.query_cache_size;
+# Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+# Establish connections user1,user2,user3 (user=root)
+# Switch to connection user1
+SET GLOBAL query_cache_type=1;
+SET GLOBAL query_cache_limit=10000;
+SET GLOBAL query_cache_min_res_unit=0;
+SET GLOBAL query_cache_size= 100000;
+FLUSH TABLES;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+# Switch to connection user2
+LOCK TABLE t2 WRITE;
+# Switch to connection user1
+# "send" the next select, "reap" the result later.
+# The select will be blocked by the write lock on the t1.
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+# Switch to connection user3
+# Poll till the select of connection user1 is blocked by the write lock on t1.
+SELECT user,command,state,info FROM information_schema.processlist
+WHERE state = 'Locked'
+ AND info = 'SELECT *, (SELECT COUNT(*) FROM t2) FROM t1';
+user command state info
+root Query Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+INSERT INTO t1 VALUES (4);
+# Switch to connection user2
+UNLOCK TABLES;
+# Switch to connection user1
+# Collecting ("reap") the result from the previously blocked select.
+# The printing of the result (varies between 3 and 4 rows) set has to be suppressed.
+# Switch to connection user3
+# The next select enforces that effects of "concurrent_inserts" like the
+# record with a = 4 is missing in result sets can no more happen.
+SELECT 1 FROM t1 WHERE a = 4;
+1
+1
+# Switch to connection user1
+# The next result set must contain 4 rows.
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+a (SELECT COUNT(*) FROM t2)
+1 0
+2 0
+3 0
+4 0
+RESET QUERY CACHE;
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+a (SELECT COUNT(*) FROM t2)
+1 0
+2 0
+3 0
+4 0
+DROP TABLE t1,t2;
+# Switch to connection default + close connections user1,user2,user3
+SET GLOBAL query_cache_type= @query_cache_type;
+SET GLOBAL query_cache_limit= @query_cache_limit;
+SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit;
+SET GLOBAL query_cache_size= @query_cache_size;
diff --git a/mysql-test/r/rpl_init_slave_func.result b/mysql-test/r/rpl_init_slave_func.result
index 3861f40e7d9..0d1f4d483d8 100644
--- a/mysql-test/r/rpl_init_slave_func.result
+++ b/mysql-test/r/rpl_init_slave_func.result
@@ -4,44 +4,43 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-'#--------------------FN_DYNVARS_037_01-------------------------#'
-SET @@global.init_slave = "SET @a = 10";
-'connect (con1,localhost,root,,)'
-'connection con1'
-SELECT @@global.init_slave;
-@@global.init_slave
-SET @a = 10
-'connection master'
-'#--------------------FN_DYNVARS_037_02-------------------------#'
-'check if value in slave opt file is executed'
-'connection slave'
-show variables like 'init_slave';
-Variable_name Value
-init_slave set global max_connections=500
-show variables like 'max_connections';
-Variable_name Value
-max_connections 500
-reset master;
-'check if value in slave opt file doesnt apply to master'
-'connection master'
-show variables like 'init_slave';
-Variable_name Value
-init_slave SET @a = 10
-show variables like 'max_connections';
-Variable_name Value
-max_connections 151
-'connection slave'
-'try creating a temporary variable in init_slave'
+connection slave
+SET @start_max_connections= @@global.max_connections;
+SET @start_init_slave= @@global.init_slave;
+SET @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
+DROP TABLE IF EXISTS t1;
+CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
+DESCRIBE t1;
+Field Type Null Key Default Extra
+my_column longtext NO NULL
+DROP TABLE t1;
+SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1';
+@@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1'
+1
+Expect 1
+SELECT @@global.max_connections= @start_max_connections;
+@@global.max_connections= @start_max_connections
+1
+Expect 1
+STOP SLAVE;
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
+SELECT @@global.max_connections = @start_max_connections + 1;
+@@global.max_connections = @start_max_connections + 1
+1
+Expect 1
SET @@global.init_slave = "SET @a=5";
-stop slave;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+STOP SLAVE;
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
SHOW VARIABLES LIKE 'init_slave';
Variable_name Value
init_slave SET @a=5
SELECT @a;
@a
NULL
-'Bug#35365 SET statement in init_slave not execute if slave is restarted'
-set global max_connections= default;
+Expect NULL
+SET @@global.max_connections= @start_max_connections;
+SET @@global.init_slave= @start_init_slave;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 4b2464af688..0519489b715 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4340,6 +4340,39 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 6
DROP TABLE t1, t2;
+CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
+f2 int(11) NOT NULL default '0',
+f3 bigint(20) NOT NULL default '0',
+f4 varchar(255) NOT NULL default '',
+PRIMARY KEY (f1),
+KEY key1 (f4),
+KEY key2 (f2));
+CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
+f2 enum('A1','A2','A3') NOT NULL default 'A1',
+f3 int(11) NOT NULL default '0',
+PRIMARY KEY (f1),
+KEY key1 (f3));
+CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
+f2 datetime NOT NULL default '1980-01-01 00:00:00',
+PRIMARY KEY (f1));
+insert into t1 values (1, 1, 1, 'abc');
+insert into t1 values (2, 1, 2, 'def');
+insert into t1 values (3, 1, 2, 'def');
+insert into t2 values (1, 'A1', 1);
+insert into t3 values (1, '1980-01-01');
+SELECT a.f3, cr.f4, count(*) count
+FROM t2 a
+STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
+LEFT JOIN
+(t1 cr2
+JOIN t3 ae2 ON cr2.f3 = ae2.f1
+) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
+cr.f4 = cr2.f4
+GROUP BY a.f3, cr.f4;
+f3 f4 count
+1 abc 1
+1 def 2
+drop table t1, t2, t3;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
@@ -4358,3 +4391,29 @@ a
4
5
DROP TABLE t1;
+CREATE TABLE A (date_key date);
+CREATE TABLE C (
+pk int,
+int_nokey int,
+int_key int,
+date_key date NOT NULL,
+date_nokey date,
+varchar_key varchar(1)
+);
+INSERT INTO C VALUES
+(1,1,1,'0000-00-00',NULL,NULL),
+(1,1,1,'0000-00-00',NULL,NULL);
+SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C);
+1
+SELECT COUNT(DISTINCT 1) FROM C
+WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk;
+COUNT(DISTINCT 1)
+SELECT date_nokey FROM C
+WHERE int_key IN (SELECT 1 FROM A)
+HAVING date_nokey = '10:41:7'
+ORDER BY date_key;
+date_nokey
+Warnings:
+Warning 1292 Incorrect date value: '10:41:7' for column 'date_nokey' at row 1
+DROP TABLE A,C;
+End of 5.1 tests
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index 1e758ce68c7..78537052127 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -209,4 +209,29 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table '
drop database db37908;
drop procedure proc37908;
drop function func37908;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+DECLARE foo INTEGER;
+DECLARE bar INTEGER;
+SET foo=1;
+SET bar=2;
+RETURN foo;
+END $$
+CREATE PROCEDURE p1()
+BEGIN
+SELECT 1;
+END $$
+SELECT f1();
+f1()
+1
+CALL p1();
+1
+1
+SELECT 9;
+9
+9
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/status2.result b/mysql-test/r/status2.result
new file mode 100644
index 00000000000..146fb2adbaf
--- /dev/null
+++ b/mysql-test/r/status2.result
@@ -0,0 +1,73 @@
+#
+# Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
+#
+FLUSH STATUS;
+CREATE FUNCTION testQuestion() RETURNS INTEGER
+BEGIN
+DECLARE foo INTEGER;
+DECLARE bar INTEGER;
+SET foo=1;
+SET bar=2;
+RETURN foo;
+END $$
+CREATE PROCEDURE testQuestion2()
+BEGIN
+SELECT 1;
+END $$
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
+DO INSERT INTO t1 VALUES(1);
+Assert Questions == 7
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 7
+SELECT testQuestion();
+testQuestion()
+1
+Assert Questions == 9
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 9
+CALL testQuestion2();
+1
+1
+Assert Questions == 11
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 11
+SELECT 1;
+1
+1
+Assert Questions == 13
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 13
+SELECT 1;
+1
+1
+Assert Questions == 14
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 14
+CREATE TRIGGER trigg1 AFTER INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES (1);
+END;
+$$
+Assert Questions == 16
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 16
+INSERT INTO t1 VALUES (1);
+Assert Questions == 18
+SHOW STATUS LIKE 'Questions';
+Variable_name Value
+Questions 18
+DROP PROCEDURE testQuestion2;
+DROP TRIGGER trigg1;
+DROP FUNCTION testQuestion;
+DROP EVENT ev1;
+DROP TABLE t1,t2;
+End of 6.0 tests
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index 782cddaeff7..b831771d9c5 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -708,6 +708,47 @@ HEX(b1) HEX(b2) i2
1 0 100
1 0 200
DROP TABLE t1, t2;
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b'10',
+f2 bit(14) NOT NULL default b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` bit(2) NOT NULL DEFAULT b'10',
+ `f2` bit(14) NOT NULL DEFAULT b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
+DROP TABLE t1;
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+ERROR 42000: Invalid default value for 'f1'
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(7)) engine=MyISAM;
+insert into t1bit7 values (b'1100000');
+insert into t1bit7 values (b'1100001');
+insert into t1bit7 values (b'1100010');
+insert into t2bit7 values (b'1100001');
+insert into t2bit7 values (b'1100010');
+insert into t2bit7 values (b'1100110');
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+bin(a1)
+1100001
+1100010
+drop table t1bit7, t2bit7;
+create table t1bit7 (a1 bit(15) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(15)) engine=MyISAM;
+insert into t1bit7 values (b'110000011111111');
+insert into t1bit7 values (b'110000111111111');
+insert into t1bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110000111111111');
+insert into t2bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110011011111111');
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+bin(a1)
+110000111111111
+110001011111111
+drop table t1bit7, t2bit7;
End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 6fbc8268a64..d4cfd1c04ed 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -392,4 +392,13 @@ f1 + 0e0
1.0000000150475e+30
-1.0000000150475e+30
drop table t1;
+create table t1(d double, u bigint unsigned);
+insert into t1(d) values (9.22337203685479e18),
+(1.84e19);
+update t1 set u = d;
+select u from t1;
+u
+9223372036854790144
+18400000000000000000
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/warnings_engine_disabled.result b/mysql-test/r/warnings_engine_disabled.result
index aa6170a60a7..e5d35fdaa5f 100644
--- a/mysql-test/r/warnings_engine_disabled.result
+++ b/mysql-test/r/warnings_engine_disabled.result
@@ -1,7 +1,15 @@
create table t1 (id int) engine=NDB;
Warnings:
+Warning 1286 Unknown table engine 'NDB'
Warning 1266 Using storage engine MyISAM for table 't1'
alter table t1 engine=NDB;
Warnings:
-Warning 1266 Using storage engine MyISAM for table 't1'
+Warning 1286 Unknown table engine 'NDB'
drop table t1;
+SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
+ENGINE SUPPORT
+ndbcluster NO
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE
+PLUGIN_NAME='ndbcluster';
+PLUGIN_NAME PLUGIN_STATUS
+ndbcluster DISABLED
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index 56c884343e3..41c0d6bee21 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -1029,4 +1029,28 @@ SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
1
1
DROP TABLE t1;
+SET @xml=
+'
+
+
+ Title - document with document declaration
+
+ Hi, Im a webpage with document a declaration
+';
+SELECT ExtractValue(@xml, 'html/head/title');
+ExtractValue(@xml, 'html/head/title')
+ Title - document with document declaration
+SELECT ExtractValue(@xml, 'html/body');
+ExtractValue(@xml, 'html/body')
+ Hi, Im a webpage with document a declaration
+SELECT ExtractValue('CharData', '/xml');
+ExtractValue('CharData', '/xml')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected ('>' wanted)'
+SELECT ExtractValue('CharData', '/xml');
+ExtractValue('CharData', '/xml')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 17: STRING unexpected ('>' wanted)'
End of 5.1 tests
diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
index adc90d007bd..896d8f734fc 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
@@ -115,14 +115,14 @@ master-bin.000001 # Xid # # COMMIT /* XID */
DROP TABLE t1;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 15
+Binlog_cache_use 13
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 16
+Binlog_cache_use 14
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
@@ -131,7 +131,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 17
+Binlog_cache_use 15
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result
new file mode 100644
index 00000000000..fab79c4bc2f
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (i int unique) ENGINE=innodb;
+reset master;
+begin;
+insert into t1 values (1),(2);
+*** the following UPDATE query wont generate any updates for the binlog ***
+update t1 set i = 3 where i < 3;
+ERROR 23000: Duplicate entry '3' for key 'i'
+commit;
+*** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
+show binlog events from ;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+reset master;
+begin;
+insert into t1 values (1),(2);
+*** the following UPDATE query wont generate any updates for the binlog ***
+insert into t1 values (3),(4),(1),(2);
+ERROR 23000: Duplicate entry '1' for key 'i'
+commit;
+*** Results of the test: the binlog must have only one Write_rows event not two ***
+show binlog events from ;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index 7106480663f..dcad7e022b7 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
@@ -133,10 +133,6 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
insert into t1 values(11);
commit;
show binlog events from ;
@@ -148,8 +144,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -278,10 +272,6 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query # # use `test`; create table t0 (n int)
master-bin.000001 # Query # # use `test`; BEGIN
@@ -382,7 +372,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 # Query # # use `test`; BEGIN
@@ -400,7 +390,9 @@ master-bin.000001 # Query # # use `test`; DROP TABLE t2
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@@ -408,11 +400,7 @@ master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Query # # use `test`; COMMIT
diff --git a/mysql-test/suite/binlog/t/binlog_innodb_row.test b/mysql-test/suite/binlog/t/binlog_innodb_row.test
new file mode 100644
index 00000000000..aaba98e3284
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_innodb_row.test
@@ -0,0 +1,42 @@
+#
+# Tests of innodb/binlog with the row binlog format
+#
+source include/have_innodb.inc;
+source include/have_log_bin.inc;
+source include/have_binlog_format_row.inc;
+
+#
+# Bug #40221 Replication failure on RBR + UPDATE the primary key
+#
+
+CREATE TABLE t1 (i int unique) ENGINE=innodb;
+reset master;
+
+# part 1: update can cause the dup key
+
+begin;
+insert into t1 values (1),(2);
+--echo *** the following UPDATE query wont generate any updates for the binlog ***
+--error ER_DUP_ENTRY
+update t1 set i = 3 where i < 3;
+commit;
+
+--echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
+source include/show_binlog_events.inc;
+
+# part 2: insert can cause the dup key
+
+delete from t1;
+reset master;
+
+begin;
+insert into t1 values (1),(2);
+--echo *** the following UPDATE query wont generate any updates for the binlog ***
+--error ER_DUP_ENTRY
+insert into t1 values (3),(4),(1),(2);
+commit;
+
+--echo *** Results of the test: the binlog must have only one Write_rows event not two ***
+source include/show_binlog_events.inc;
+
+drop table t1;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 15466887ecc..94aa75c6db2 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -43,10 +43,10 @@ NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL N
NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ENGINES SAVEPOINTS 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
-NULL information_schema ENGINES TRANSACTIONS 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema ENGINES XA 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
diff --git a/mysql-test/suite/funcs_1/r/is_engines.result b/mysql-test/suite/funcs_1/r/is_engines.result
index ba98ddd8f1e..9965fc5ad73 100644
--- a/mysql-test/suite/funcs_1/r/is_engines.result
+++ b/mysql-test/suite/funcs_1/r/is_engines.result
@@ -31,27 +31,27 @@ Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
-TRANSACTIONS varchar(3) NO
-XA varchar(3) NO
-SAVEPOINTS varchar(3) NO
+TRANSACTIONS varchar(3) YES NULL
+XA varchar(3) YES NULL
+SAVEPOINTS varchar(3) YES NULL
SHOW CREATE TABLE information_schema.ENGINES;
Table Create Table
ENGINES CREATE TEMPORARY TABLE `ENGINES` (
`ENGINE` varchar(64) NOT NULL DEFAULT '',
`SUPPORT` varchar(8) NOT NULL DEFAULT '',
`COMMENT` varchar(80) NOT NULL DEFAULT '',
- `TRANSACTIONS` varchar(3) NOT NULL DEFAULT '',
- `XA` varchar(3) NOT NULL DEFAULT '',
- `SAVEPOINTS` varchar(3) NOT NULL DEFAULT ''
+ `TRANSACTIONS` varchar(3) DEFAULT NULL,
+ `XA` varchar(3) DEFAULT NULL,
+ `SAVEPOINTS` varchar(3) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.ENGINES;
Field Type Null Key Default Extra
ENGINE varchar(64) NO
SUPPORT varchar(8) NO
COMMENT varchar(80) NO
-TRANSACTIONS varchar(3) NO
-XA varchar(3) NO
-SAVEPOINTS varchar(3) NO
+TRANSACTIONS varchar(3) YES NULL
+XA varchar(3) YES NULL
+SAVEPOINTS varchar(3) YES NULL
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
# DDL on INFORMATION_SCHEMA tables are not supported
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 38fa933e13f..0c414df0c57 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -191,2427 +191,1215 @@ ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during p
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+100;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+100, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+100);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+99;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+99, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+99);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+98;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+98, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+98);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+97;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+97, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+97);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+96;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+96, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+96);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+95;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+95, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+95);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+94;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+94, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+94);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+93;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+93, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+93);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+92;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+92, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+92);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+91;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+91, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+91);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+90;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+90, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+90);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+89;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+89, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+89);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+88;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+88, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+88);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+87;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+87, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+87);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+86;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+86, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+86);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+85;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+85, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+85);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+84;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+84, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+84);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+83;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+83, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+83);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+82;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+82, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+82);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+81;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+81, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+81);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+80;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+80, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+80);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+79;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+79, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+79);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+78;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+78, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+78);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+77;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+77, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+77);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+76;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+76, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+76);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+75;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+75, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+75);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+74;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+74, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+74);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+73;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+73, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+73);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+72;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+72, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+72);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+71;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+71, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+71);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+70;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+70, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+70);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+69;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+69, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+69);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+68;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+68, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+68);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+67;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+67, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+67);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+66;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+66, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+66);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+65;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+65, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+65);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+64;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+64, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+64);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+63;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+63, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+63);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+62;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+62, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+62);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+61;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+61, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+61);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+60;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+60, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+60);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+59;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+59, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+59);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+58;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+58, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+58);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+57;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+57, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+57);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+56;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+56, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+56);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+55;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+55, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+55);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+54;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+54, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+54);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+53;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+53, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+53);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+52;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+52, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+52);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+51;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+51, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+51);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+50;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+50, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+50);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+49;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+49, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+49);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+48;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+48, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+48);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+47;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+47, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+47);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+46;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+46, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+46);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+45;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+45, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+45);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+44;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+44, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+44);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+43;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+43, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+43);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+42;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+42, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+42);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+41;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+41, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+41);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+40;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+40, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+40);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+39;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+39, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+39);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+38;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+38, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+38);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+37;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+37, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+37);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+36;
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+36, @v1_proc);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+36);
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+35;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+35, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+35);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+34;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+34, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+34);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+33;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+33, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+33);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+32;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+32, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+32);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+31;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+31, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+31);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+30;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+30, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+30);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+29;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+29, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+29);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+28;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+28, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+28);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+27;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+27, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+27);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+26;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+26, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+26);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+25;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+25, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+25);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+24;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+24, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+24);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+23;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+23, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+23);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+22;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+22, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+22);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+21;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+21, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+21);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+20;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+20, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+20);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+19;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+19, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+19);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+18;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+18, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+18);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+17;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+17, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+17);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+16;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+16, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+16);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+15;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+15, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+15);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+14;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+14, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+14);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+13;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+13, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+13);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+12;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+12, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+12);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+11;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+11, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+11);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+10;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+10, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+10);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+9;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+9, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+9);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+8;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+8, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+8);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+7;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+7, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+7);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+6;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+6, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+6);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+5;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+5, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+5);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+4;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+4, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+4);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+3;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+3, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+3);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+2;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+2, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+2);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+1;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+1, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+1);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e+0;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e+0, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e+0);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-100;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-100, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-100);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-99;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-99, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-99);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-98;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-98, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-98);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-97;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-97, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-97);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-96;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-96, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-96);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-95;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-95, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-95);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-94;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-94, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-94);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-93;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-93, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-93);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-92;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-92, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-92);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-91;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-91, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-91);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-90;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-90, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-90);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-89;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-89, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-89);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-88;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-88, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-88);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-87;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-87, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-87);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-86;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-86, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-86);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-85;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-85, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-85);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-84;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-84, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-84);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-83;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-83, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-83);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-82;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-82, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-82);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-81;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-81, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-81);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-80;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-80, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-80);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-79;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-79, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-79);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-78;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-78, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-78);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-77;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-77, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-77);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-76;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-76, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-76);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-75;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-75, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-75);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-74;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-74, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-74);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-73;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-73, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-73);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-72;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-72, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-72);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-71;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-71, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-71);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-70;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-70, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-70);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-69;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-69, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-69);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-68;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-68, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-68);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-67;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-67, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-67);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-66;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-66, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-66);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-65;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-65, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-65);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-64;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-64, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-64);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-63;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-63, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-63);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-62;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-62, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-62);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-61;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-61, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-61);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-60;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-60, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-60);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-59;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-59, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-59);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-58;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-58, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-58);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-57;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-57, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-57);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-56;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-56, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-56);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-55;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-55, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-55);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-54;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-54, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-54);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-53;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-53, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-53);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-52;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-52, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-52);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-51;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-51, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-51);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-50;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-50, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-50);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-49;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-49, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-49);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-48;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-48, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-48);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-47;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-47, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-47);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-46;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-46, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-46);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-45;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-45, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-45);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-44;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-44, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-44);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-43;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-43, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-43);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-42;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-42, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-42);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-41;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-41, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-41);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-40;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-40, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-40);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-39;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-39, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-39);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-38;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-38, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-38);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-37;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-37, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-37);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-36;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-36, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-36);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-35;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-35, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-35);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-34;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-34, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-34);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-33;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-33, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-33);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-32;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-32, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-32);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-31;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-31, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-31);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-30;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-30, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-30);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-29;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-29, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-29);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-28;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-28, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-28);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-27;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-27, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-27);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-26;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-26, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-26);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-25;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-25, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-25);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-24;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-24, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-24);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-23;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-23, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-23);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-22;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-22, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-22);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-21;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-21, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-21);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-20;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-20, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-20);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-19;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-19, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-19);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-18;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-18, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-18);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-17;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-17, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-17);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-16;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-16, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-16);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-15;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-15, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-15);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-14;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-14, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-14);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-13;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-13, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-13);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-12;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-12, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-12);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-11;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-11, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-11);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-10;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-10, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-10);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-9;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-9, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-9);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-8;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-8, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-8);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-7;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-7, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-7);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-6;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-6, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-6);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-5;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-5, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-5);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-4;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-4, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-4);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-3;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-3, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-3);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-2;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-2, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-2);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-1;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-1, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-1);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
UPDATE t1_aux SET f1 = NULL;
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
UPDATE t1_aux SET f1 = 0.1234567890987654321e-0;
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SELECT f1 INTO @v1_tab FROM t1_aux;
CALL sproc_1(0.1234567890987654321e-0, @v1_proc);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
SET @v1_func = func_1(0.1234567890987654321e-0);
-Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
DROP PROCEDURE sproc_1;
DROP FUNCTION func_1;
DROP TABLE t1_aux;
diff --git a/mysql-test/suite/funcs_1/storedproc/param_check.inc b/mysql-test/suite/funcs_1/storedproc/param_check.inc
index f6c0b30ab8b..203187f92b1 100644
--- a/mysql-test/suite/funcs_1/storedproc/param_check.inc
+++ b/mysql-test/suite/funcs_1/storedproc/param_check.inc
@@ -16,15 +16,32 @@
# Created:
# 2008-08-27 mleich
#
-
+# Modified:
+# 2008-11-17 pcrews
+# added --disable / --enable_warning statements to minimize differences
+# between platforms (Bug#40177 Test funcs_1.storedproc failing on Pushbuild)
+#
+# TODO: (After 5.1 GA)
+# 1) Examine reordering statements in this file to minimize the number of
+# --disable / --enable_warning statements. Unsure if performance gains
+# warrant the working time
+# 2) We could probably add a comparison of the # of warnings before the
+# assignment of @v1_proc and @v1_func to the # of warnings after assignment
+# The difference of these values should be zero
+# Refer to Bug#40177 - http://bugs.mysql.com/bug.php?id=40177 for notes as well
+
eval UPDATE t1_aux SET f1 = NULL;
# Enforce that all user variables have the same data type and initial value.
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
+--disable_warnings
eval UPDATE t1_aux SET f1 = $test_value;
+--enable_warnings
SELECT f1 INTO @v1_tab FROM t1_aux;
+--disable_warnings
eval CALL sproc_1($test_value, @v1_proc);
eval SET @v1_func = func_1($test_value);
+--enable_warnings
if (`SELECT @v1_tab <> @v1_proc OR @v1_tab <> @v2_proc OR @v1_tab <> @v1_func`)
{
diff --git a/mysql-test/suite/funcs_2/t/disabled.def b/mysql-test/suite/funcs_2/t/disabled.def
index c903662e052..da6230bd7ed 100644
--- a/mysql-test/suite/funcs_2/t/disabled.def
+++ b/mysql-test/suite/funcs_2/t/disabled.def
@@ -1,6 +1,6 @@
# Disabled by hhunger (2008-03-03) due to WL4204
-innodb_charset : Due to bug#20447
-myisam_charset : Due to bug#20477
-memory_charset : Due to bug#20447
-ndb_charset : Due to bug#20447
+innodb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+myisam_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+memory_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+ndb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def
index c638c7b4774..0fc9a5d3ad6 100644
--- a/mysql-test/suite/ndb/t/disabled.def
+++ b/mysql-test/suite/ndb/t/disabled.def
@@ -9,8 +9,7 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
-ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
+ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result
index 2ea66592679..a9ae917f13d 100644
--- a/mysql-test/suite/parts/r/partition_bit_innodb.result
+++ b/mysql-test/suite/parts/r/partition_bit_innodb.result
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0'
+ `a` bit(1) NOT NULL DEFAULT b'0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result
index c1f067d80d1..680845c9971 100644
--- a/mysql-test/suite/parts/r/partition_bit_myisam.result
+++ b/mysql-test/suite/parts/r/partition_bit_myisam.result
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+ `a` bit(64) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0'
+ `a` bit(1) NOT NULL DEFAULT b'0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `a` bit(1) NOT NULL DEFAULT '\0',
+ `a` bit(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
- `a` bit(8) NOT NULL DEFAULT '\0',
+ `a` bit(8) NOT NULL DEFAULT b'0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
diff --git a/mysql-test/suite/parts/r/partition_bit_ndb.result b/mysql-test/suite/parts/r/partition_bit_ndb.result
deleted file mode 100644
index add3ed394ad..00000000000
--- a/mysql-test/suite/parts/r/partition_bit_ndb.result
+++ /dev/null
@@ -1,126 +0,0 @@
-SET @max_row = 20;
-create table t1 (a bit(65), primary key (a)) partition by key (a);
-ERROR 42000: Display width out of range for column 'a' (max = 64)
-create table t1 (a bit(0), primary key (a)) partition by key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-drop table t1;
-create table t1 (a bit(0), primary key (a)) partition by key (a) (
-partition pa1 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp',
-partition pa2 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp');
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
-drop table t1;
-create table t1 (a bit(64), primary key (a)) partition by key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-insert into t1 values
-(b'1111111111111111111111111111111111111111111111111111111111111111'),
-(b'1000000000000000000000000000000000000000000000000000000000000000'),
-(b'0000000000000000000000000000000000000000000000000000000000000001'),
-(b'1010101010101010101010101010101010101010101010101010101010101010'),
-(b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(a) from t1;
-hex(a)
-1
-5555555555555555
-8000000000000000
-AAAAAAAAAAAAAAAA
-FFFFFFFFFFFFFFFF
-drop table t1;
-create table t1 (a bit(64), primary key (a)) partition by key (a)(
-partition pa1 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=20 min_rows=2,
-partition pa2 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=30 min_rows=3,
-partition pa3 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=30 min_rows=4,
-partition pa4 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=40 min_rows=2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
-insert into t1 values
-(b'1111111111111111111111111111111111111111111111111111111111111111'),
-(b'1000000000000000000000000000000000000000000000000000000000000000'),
-(b'0000000000000000000000000000000000000000000000000000000000000001'),
-(b'1010101010101010101010101010101010101010101010101010101010101010'),
-(b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(a) from t1;
-hex(a)
-1
-5555555555555555
-8000000000000000
-AAAAAAAAAAAAAAAA
-FFFFFFFFFFFFFFFF
-drop table t1;
-create table t1 (a bit, primary key (a)) partition by key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-insert into t1 values (b'0'), (b'1');
-select hex(a) from t1;
-hex(a)
-0
-1
-alter table t1 drop primary key;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-select hex(a) from t1;
-hex(a)
-0
-1
-alter table t1 add primary key (a);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(1) NOT NULL DEFAULT '\0',
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-select hex(a) from t1;
-hex(a)
-0
-1
-drop table t1;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 5eab78de8c2..8869f6d450c 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -213,5 +213,10 @@ START TRANSACTION;
INSERT INTO t1 VALUES (NULL, 'first row t2');
SET autocommit=OFF;
ALTER TABLE t1 AUTO_INCREMENT = 10;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t1 VALUES (NULL, 'second row t2');
+SELECT a,b FROM t1 ORDER BY a;
+a b
+1 first row t2
+2 second row t2
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def
index b9cd3462635..518a3c90422 100644
--- a/mysql-test/suite/parts/t/disabled.def
+++ b/mysql-test/suite/parts/t/disabled.def
@@ -1,8 +1,3 @@
partition_basic_ndb : Bug#19899 Crashing the server
# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
-partition_bit_ndb : NDB does not support bit column in index
-partition_sessions : needs system_3_init.inc
partition_syntax_ndb : Bug#36735 Not supported
-partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function
-partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function
-partition_value_ndb : Bug#30581 partition_value tests use disallowed CAST() function
diff --git a/mysql-test/suite/parts/t/partition_bit_ndb.test b/mysql-test/suite/parts/t/partition_bit_ndb.test
deleted file mode 100644
index 227d3d53401..00000000000
--- a/mysql-test/suite/parts/t/partition_bit_ndb.test
+++ /dev/null
@@ -1,60 +0,0 @@
-################################################################################
-# t/partition_bit_ndb.test #
-# #
-# Purpose: #
-# Tests around bit type #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: HH #
-# Original Date: 2006-08-01 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-let $with_partitioning= 1;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'NDB';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-let $MAX_VALUE= (2147483646);
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_bit.inc
diff --git a/mysql-test/suite/parts/t/partition_sessions.test b/mysql-test/suite/parts/t/partition_sessions.test
deleted file mode 100644
index 3d59292bee5..00000000000
--- a/mysql-test/suite/parts/t/partition_sessions.test
+++ /dev/null
@@ -1,391 +0,0 @@
-
-#--------------------------------------------------
-# Initialize system_3 test variables
-#--------------------------------------------------
-
---source suite/system_3/include/system_3_init.inc
-
-let $NUM_VAL=`SELECT @NUM_VAL`;
-let $LOAD_LINES=`SELECT @LOAD_LINES`;
-let $LOG_UPPER=`SELECT @LOG_UPPER`;
-let $LOG_LOWER=`SELECT @LOG_LOWER`;
-#let $ENG1=`SELECT @ENG1`;
-let $ENG2=`SELECT @ENG2`;
-let $ENG_LOG=`SELECT @ENG_LOG`;
-let $CLIENT_HOST=`SELECT @CLIENT_HOST`;
-let $ENG=innodb;
-let $ENG1=innodb;
-#---------------------------------------------------------
-# Column list with definition for all tables to be checked
-#---------------------------------------------------------
-
-let $column_list= f1 int,
-f2 char (15),
-f3 decimal (5,3),
-f4 datetime;
-
-let $col_access_list = f1,f2,f3,f4 ;
-let $col_new_list = new.f1,new.f2,new.f3 new.f4 ;
-
-#---------------------------------------------------
-# Setting the parameters to use during testing
-#---------------------------------------------------
-# Set number of variations of the f1 variable (used to segment the rows
-# being updated/deleted by a user at a time. The higher the number, the
-# more smaller segments used with each query.
---replace_result $NUM_VAL NUM_VAL
-eval set @f1_nums=$NUM_VAL;
-
-# The following sets the number controls the size of the log table.
-# Once a size of '@threshold' is reached, the first rows are removed
-# sunch that the table is down to '@shrink_to' lines
---replace_result $LOG_LOWER LOG_LOWER
-eval set @shrink_to=$LOG_LOWER;
---replace_result $LOG_UPPER LOG_UPPER
-eval set @threshold=$LOG_UPPER;
-
-#---------------------------------------------------
-# Creating the database tables and loading the data
-#---------------------------------------------------
-
---disable_warnings
-drop database if exists systest1;
---enable_warnings
-
-create database systest1;
-
---disable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval create user systuser@'$CLIENT_HOST';
---enable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval set password for systuser@'$CLIENT_HOST' = password('systpass');
---replace_result $CLIENT_HOST CLIENT_HOST
-eval grant ALL on systest1.* to systuser@'$CLIENT_HOST';
-use systest1;
---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
-connect (systuser,localhost,systuser,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
-
-create table tb1_master (
- f1 int,
- f2 char(15),
- f3 decimal (5,3),
- f4 datetime
-);
-
-#--replace_result $ENG_LOG ENG_LOG
-eval create table tb1_logs (
- i1 int NOT NULL auto_increment, primary key (i1),
- dt1 datetime NOT NULL,
- entry_dsc char(100),
- f4 int
-) engine=$ENG_LOG
-;
-#PARTITION BY HASH (i1) PARTITIONS 8;
-
-if ($debug)
-{
-SHOW CREATE TABLE tb1_logs;
-}
-
-#--replace_result $ENG_LOG ENG_LOG
-eval create table ddl_logs (
- i1 int NOT NULL auto_increment, primary key (i1),
- dt1 datetime NOT NULL,
- entry_dsc char(100),
- errno int
-) engine=$ENG_LOG;
-#PARTITION BY HASH (i1) PARTITIONS 8;
-
-if ($debug)
-{
-SHOW CREATE TABLE tb1_logs;
-}
-create table test_stat (
- dt1 datetime,
- table_name char(20),
- row_count int,
- start_row int,
- end_row int
-);
-
-#----------------------------------------------------------------------
-# tb3_eng1: key partitioning
-#----------------------------------------------------------------------
-
-#--replace_result $ENG1 ENG1
-eval create table tb3_eng1 (
- i1 int NOT NULL auto_increment, primary key (i1),
- $column_list
-) engine=$ENG1
-PARTITION BY KEY (i1) PARTITIONS 4
-(PARTITION part1,
-PARTITION part2,
-PARTITION part3,
-PARTITION part4);
-
-#--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval load data local infile '$MYSQL_TEST_DIR/suite/system_3/data/tb1.txt'
- into table tb3_eng1 ($col_access_list);
-
-if ($WITH_TRIGGERS)
-{
-delimiter //;
-
-Create trigger tb3_eng1_ins after insert on tb3_eng1 for each row
-BEGIN
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Insert row ', new.f1,' ',
- new.f2, ' ', new.f3, ' (tb3_eng1)'), new.f1);
-END//
-
-Create trigger tb3_eng1_upd after update on tb3_eng1 for each row
-BEGIN
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Update row ', old.f1,' ', old.f2, '->',
- new.f2, ' ', old.f3, '->', new.f3, ' (tb3_eng1)'), new.f1);
-END//
-
-Create trigger tb3_eng1_del after delete on tb3_eng1 for each row
-BEGIN
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Delete row ', old.f1,' ', old.f2, ' ',
- old.f3, ' (tb3_eng1)'), old.f1);
-END//
-
-delimiter ;//
-}
-delimiter //;
-
-# This functions returns a random integer number
-# between zero and 'num'
-#-----------------------------------------------
-create function int_rand(num int) returns int
-BEGIN
- return round(num*rand()+0.5);
-END//
-
-# This function returns a string in the length 'len' of
-# random letters (ascii range of 65-122)
-#------------------------------------------------------
-create function str_rand (len int) returns char(12)
-BEGIN
- declare tmp_letter char(1);
- declare tmp_word char(12);
- declare word_str char(12) default '';
- wl_loop: WHILE len DO
- set tmp_letter=char(round(57*rand()+65));
- set tmp_word=concat(word_str,tmp_letter);
- set word_str=tmp_word;
- set len=len-1;
- END WHILE wl_loop;
- return word_str;
-END//
-
-
-# This procedure scans 'tb1_master' table for rows where f1='num_pr'
-# and for each row inserts a row in 'tb3_eng1'
-#------------------------------------------------------------------
-eval create procedure ins_tb3_eng1 (num_pr int, str_pr char(15))
-BEGIN
- declare done int default 0;
- declare v3 decimal(5,3);
- declare cur1 cursor for
- select f3 from tb1_master where f1=num_pr;
- declare continue handler for sqlstate '01000' set done = 1;
- declare continue handler for sqlstate '02000' set done = 1;
- open cur1;
- fetch cur1 into v3;
- wl_loop: WHILE NOT done DO
- insert into tb3_eng1 ($col_access_list) values
- (int_rand(@f1_nums), concat('I:',str_pr,'-',num_pr), v3, now());
- fetch cur1 into v3;
- END WHILE wl_loop;
- close cur1;
-END//
-
-
-# This procedure does selects from the 'tb1_logs' and inserts the
-# count into the table
-#------------------------------------------------------------------
-create procedure slct_tb1_logs ()
-BEGIN
- declare done int default 0;
- declare v4 int;
- declare v_count int default 0;
- declare str_val char(15) default ELT(int_rand(3),
- 'Insert', 'Update', 'Delete');
- declare cur1 cursor for
- select f4 from tb1_logs where entry_dsc like concat('%',str_val,'%');
- declare continue handler for sqlstate '01000' set done = 1;
- declare continue handler for sqlstate '02000' set done = 1;
- open cur1;
- fetch cur1 into v4;
- wl_loop: WHILE NOT done DO
- set v_count=v_count+1;
- fetch cur1 into v4;
- END WHILE wl_loop;
- close cur1;
- insert into tb1_logs (dt1, entry_dsc, f4)
- values (now(), concat('Number of \'', str_val, '\' rows is: ',
- v_count, ' (tb1_log)'),0);
-END//
-
-delimiter ;//
-
---disable_abort_on_error
-insert into systest1.tb3_eng1 values (NULL,50,'init_val',12.345,'2005-01-01 00:00:00');
-insert into systest1.tb3_eng1 values (NULL,70,'init_val',12.345,'2005-01-01 00:00:00');
---enable_abort_on_error
-
-connection default;0.
---disable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval create user syst1user@'$CLIENT_HOST';
---enable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval set password for syst1user@'$CLIENT_HOST' = password('systpass');
---replace_result $CLIENT_HOST CLIENT_HOST
-eval grant ALL on systest1.* to syst1user@'$CLIENT_HOST';
-use systest1;
---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
-connect (syst1user,localhost,syst1user,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
-
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval SET @f1_nums=$NUM_VAL;
-SET @tmp_num=int_rand(@f1_nums);
-SET @tmp_word=str_rand(4);
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Insert rows replacing the deleted rows using a strored procedure
-# that reads the rows from a master table
-CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval SET @f1_nums=$NUM_VAL;
-SET @tmp_num=int_rand(@f1_nums);
-SET @tmp_word=str_rand(4);
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Insert rows replacing the deleted rows using a strored procedure
-# that reads the rows from a master table
-CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-call slct_tb1_logs();
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1
- set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
- where f1=@tmp_num-1;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1
- set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
- where f1=@tmp_num-1;
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-call slct_tb1_logs();
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1
- set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1
- where f1=@tmp_num-1;
-
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-#--replace_result $NUM_VAL
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
-
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test
index b9fc8bdcd56..eac19f6d588 100644
--- a/mysql-test/suite/parts/t/partition_special_innodb.test
+++ b/mysql-test/suite/parts/t/partition_special_innodb.test
@@ -68,10 +68,12 @@ INSERT INTO t1 VALUES (NULL, 'first row t2');
--connection con2
SET autocommit=OFF;
+--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 AUTO_INCREMENT = 10;
--connection con1
INSERT INTO t1 VALUES (NULL, 'second row t2');
+SELECT a,b FROM t1 ORDER BY a;
--disconnect con2
--disconnect con1
--connection default
diff --git a/mysql-test/suite/parts/t/partition_value_innodb.test b/mysql-test/suite/parts/t/partition_value_innodb.test
index 9d59533a54e..fe47f533107 100644
--- a/mysql-test/suite/parts/t/partition_value_innodb.test
+++ b/mysql-test/suite/parts/t/partition_value_innodb.test
@@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
-# Change Author: #
-# Change Date: #
-# Change: #
+# Change Author: mleich #
+# Change Date: 2008-12-08 #
+# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@@ -22,6 +22,12 @@
# any of the variables.
#
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_value_myisam.test b/mysql-test/suite/parts/t/partition_value_myisam.test
index d6020669509..026ad57f0b2 100644
--- a/mysql-test/suite/parts/t/partition_value_myisam.test
+++ b/mysql-test/suite/parts/t/partition_value_myisam.test
@@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
-# Change Author: #
-# Change Date: #
-# Change: #
+# Change Author: mleich #
+# Change Date: 2008-12-08 #
+# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@@ -22,6 +22,12 @@
# any of the variables.
#
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_value_ndb.test b/mysql-test/suite/parts/t/partition_value_ndb.test
index 2f948b95727..80b4ba6fb64 100644
--- a/mysql-test/suite/parts/t/partition_value_ndb.test
+++ b/mysql-test/suite/parts/t/partition_value_ndb.test
@@ -8,9 +8,9 @@
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-04-11 #
-# Change Author: #
-# Change Date: #
-# Change: #
+# Change Author: mleich #
+# Change Date: 2008-12-08 #
+# Change: Remove test from disabled.def + change test that it gets skipped #
################################################################################
#
@@ -22,6 +22,12 @@
# any of the variables.
#
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index f89d6b3459a..70bbc9bd01a 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -29,44 +29,9 @@ SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
STOP SLAVE;
START SLAVE;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running No
-Slave_SQL_Running #
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
-Last_IO_Error
-Last_SQL_Errno 0
-Last_SQL_Error
+Slave_IO_Running = No (expect No)
+==== clean up ====
+DROP TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index ad659c37b7f..5d6587a5fce 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -4,34 +4,39 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
-SHOW BINLOG EVENTS FROM 216;
+SHOW BINLOG EVENTS FROM 106;
Log_name #
-Pos 216
+Pos 106
Event_type Query
Server_id #
-End_log_pos 309
+End_log_pos 199
Info use `test`; CREATE TABLE t1 (a INT, b INT)
Log_name #
-Pos 309
+Pos 199
Event_type Query
Server_id #
-End_log_pos 415
+End_log_pos 305
Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
Log_name #
-Pos 415
+Pos 305
Event_type Query
Server_id #
-End_log_pos 521
+End_log_pos 411
Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
Log_name #
-Pos 521
+Pos 411
Event_type Query
Server_id #
-End_log_pos 640
+End_log_pos 530
Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
**** On Master ****
SHOW CREATE TABLE t1;
@@ -125,9 +130,14 @@ NULL 3 6
NULL 4 2
NULL 5 10
NULL 6 12
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
ERROR 23000: Duplicate entry '2' for key 'b'
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
CREATE TABLE t7 (a INT, b INT UNIQUE);
INSERT INTO t7 SELECT a,b FROM tt3;
@@ -137,18 +147,23 @@ a b
1 2
2 4
3 6
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1374 Query # 1474 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
-# 1474 Query # 1542 use `test`; BEGIN
-# 1542 Table_map # 1584 table_id: # (test.t7)
-# 1584 Write_rows # 1640 table_id: # flags: STMT_END_F
-# 1640 Query # 1711 use `test`; ROLLBACK
+# 106 Query # 206 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
+# 206 Query # 274 use `test`; BEGIN
+# 274 Table_map # 316 table_id: # (test.t7)
+# 316 Write_rows # 372 table_id: # flags: STMT_END_F
+# 372 Query # 443 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
2 4
3 6
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
BEGIN;
@@ -156,12 +171,12 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SHOW BINLOG EVENTS FROM 1711;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1711 Query # 1779 use `test`; BEGIN
-# 1779 Table_map # 1821 table_id: # (test.t7)
-# 1821 Write_rows # 1877 table_id: # flags: STMT_END_F
-# 1877 Query # 1946 use `test`; COMMIT
+# 106 Query # 174 use `test`; BEGIN
+# 174 Table_map # 216 table_id: # (test.t7)
+# 216 Write_rows # 272 table_id: # flags: STMT_END_F
+# 272 Query # 343 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -178,6 +193,11 @@ a b
4 8
5 10
6 12
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
CREATE TEMPORARY TABLE tt5 LIKE t4;
@@ -196,10 +216,10 @@ Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW BINLOG EVENTS FROM 1946;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1946 Query # 2032 use `test`; CREATE TABLE t8 LIKE t4
-# 2032 Query # 2171 use `test`; CREATE TABLE `t9` (
+# 106 Query # 192 use `test`; CREATE TABLE t8 LIKE t4
+# 192 Query # 331 use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
)
@@ -276,9 +296,8 @@ a
1
2
3
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@@ -308,7 +327,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 1329 Query # 1397 use `test`; BEGIN
# 1397 Table_map # 1438 table_id: # (test.t1)
# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F
-# 1482 Query # 1551 use `test`; COMMIT
+# 1482 Query # 1553 use `test`; ROLLBACK
SHOW TABLES;
Tables_in_test
t1
@@ -371,9 +390,8 @@ a
4
6
9
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@@ -394,6 +412,11 @@ a
6
9
TRUNCATE TABLE t2;
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@@ -406,14 +429,14 @@ Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * FROM t2 ORDER BY a;
a
-SHOW BINLOG EVENTS FROM 949;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 949 Query # 1017 use `test`; BEGIN
-# 1017 Table_map # 1058 table_id: # (test.t2)
-# 1058 Write_rows # 1102 table_id: # flags: STMT_END_F
-# 1102 Table_map # 1143 table_id: # (test.t2)
-# 1143 Write_rows # 1182 table_id: # flags: STMT_END_F
-# 1182 Query # 1253 use `test`; ROLLBACK
+# 106 Query # 174 use `test`; BEGIN
+# 174 Table_map # 215 table_id: # (test.t2)
+# 215 Write_rows # 259 table_id: # flags: STMT_END_F
+# 259 Table_map # 300 table_id: # (test.t2)
+# 300 Write_rows # 339 table_id: # flags: STMT_END_F
+# 339 Query # 410 use `test`; ROLLBACK
SELECT * FROM t2 ORDER BY a;
a
DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index bb03c3b6cca..9784d6372d2 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -174,6 +174,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
SELECT * FROM t1 ORDER BY a;
a b
2 master only
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index 68c82ed037f..b68af8f4afe 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -975,3 +975,22 @@ a b
2 b
3 c
drop table t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam;
+create trigger tr
+after insert on t1
+for each row insert into log values ( new.f );
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.log and slave:test.log
+drop table t1, log;
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 1bde61aef78..faa9de76fdb 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -75,16 +75,25 @@ disconnect master;
connect (master, localhost, root);
connection master;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+sync_slave_with_master;
+
+connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
# The slave I/O thread must stop after trying to read the above event
connection slave;
---source include/wait_for_slave_io_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_MYPORT
-# import is only the 11th column Slave_IO_Running
---replace_column 1 # 7 # 8 # 9 # 12 # 22 # 23 # 33 #
-query_vertical show slave status;
+--source include/wait_for_slave_io_to_stop.inc
+let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+--echo Slave_IO_Running = $slave_io_running (expect No)
+
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+# slave is stopped
+connection slave;
+DROP TABLE t1;
# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index 3fb5aa8e1f2..d74eb873270 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -29,6 +29,8 @@ SET GLOBAL storage_engine=memory;
START SLAVE;
--enable_query_log
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
@@ -36,7 +38,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---query_vertical SHOW BINLOG EVENTS FROM 216
+--query_vertical SHOW BINLOG EVENTS FROM 106
--echo **** On Master ****
--query_vertical SHOW CREATE TABLE t1
--query_vertical SHOW CREATE TABLE t2
@@ -65,6 +67,8 @@ SELECT * FROM t5 ORDER BY a,b,c;
--query_vertical SHOW CREATE TABLE t6
SELECT * FROM t6 ORDER BY a,b,c;
+--source include/reset_master_and_slave.inc
+
connection master;
# Test for erroneous constructions
--error ER_DUP_ENTRY
@@ -72,7 +76,7 @@ CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
# Shouldn't be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
# Test that INSERT-SELECT works the same way as for SBR.
CREATE TABLE t7 (a INT, b INT UNIQUE);
@@ -82,10 +86,12 @@ SELECT * FROM t7 ORDER BY a,b;
# Should be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
@@ -94,11 +100,13 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1711;
+SHOW BINLOG EVENTS FROM 106;
SELECT * FROM t7 ORDER BY a,b;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
@@ -110,7 +118,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1;
--query_vertical SHOW CREATE TABLE t9
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1946;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
--echo **** On Slave ****
--query_vertical SHOW CREATE TABLE t8
@@ -162,7 +170,7 @@ SELECT * FROM t3 ORDER BY a;
SELECT * FROM t4 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SHOW TABLES;
SELECT TABLE_NAME,ENGINE
@@ -208,13 +216,17 @@ COMMIT;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
connection master;
TRUNCATE TABLE t2;
+sync_slave_with_master;
+--source include/reset_master_and_slave.inc
+
+connection master;
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@@ -227,7 +239,7 @@ ROLLBACK;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 949;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index 8a5b1ae0ae4..da25e5631c0 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -121,6 +121,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 911110d17dc..d63eafe56a7 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -467,20 +467,48 @@ drop trigger if exists t1_bi;
insert into t1 values (3, "c");
select * from t1;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
+sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
+sync_slave_with_master;
+
+#
+# Bug#40116: Uncommited changes are replicated and stay on slave after
+# rollback on master
+#
+
+connection master;
+source include/master-slave-reset.inc;
+source include/have_innodb.inc;
+connection slave;
+source include/have_innodb.inc;
+
+connection master;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam;
+create trigger tr
+ after insert on t1
+ for each row insert into log values ( new.f );
+
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+--source include/diff_tables.inc
+
+let $diff_table_1=master:test.log;
+let $diff_table_2=slave:test.log;
+--source include/diff_tables.inc
+
+connection master;
+drop table t1, log;
+sync_slave_with_master;
#
# End of tests
#
-save_master_pos;
-connection slave;
-sync_with_master;
diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def
index ebc99feeac6..694f7098980 100644
--- a/mysql-test/suite/rpl_ndb/t/disabled.def
+++ b/mysql-test/suite/rpl_ndb/t/disabled.def
@@ -10,7 +10,7 @@
#
##############################################################################
-rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication.
-rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication.
+rpl_ndb_circular : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
+rpl_ndb_circular_simplex : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
diff --git a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
index 996a9e712f9..a8fa50a6a23 100644
--- a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
@@ -17,14 +17,14 @@
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
+# Modified: Horst Hunger 2008-11-27 #
+# Due to OS depending values the check has been changed #
+# from concrete values to ranges. #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
-# Changes: #
-# 2008-03-06 hhunger Got "lost connections with 5.1.24 #
-########################################################################
--source include/load_sysvars.inc
@@ -38,8 +38,6 @@
########################################################################
SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-
--echo '#--------------------FN_DYNVARS_055_01------------------------#'
########################################################################
@@ -49,9 +47,7 @@ SELECT @start_value;
SET @@global.key_buffer_size = 99;
--Error ER_NO_DEFAULT
SET @@global.key_buffer_size = DEFAULT;
---echo 'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#---------------------FN_DYNVARS_055_02-------------------------#'
###############################################
@@ -66,26 +62,25 @@ SELECT @@global.key_buffer_size = @start_value;
# Change the value of key_buffer_size to a valid value #
########################################################################
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--disable_warnings
-#Due to "lost connection"
+#Due to increasing the runtime significantly and allocating the buffer instantly.
#SET @@global.key_buffer_size = 4294967295;
--enable_warnings
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 1800;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--echo '#--------------------FN_DYNVARS_055_04-------------------------#'
###########################################################################
# Change the value of key_buffer_size to invalid value #
###########################################################################
-# Due to "lost connection"
+# Due to increasing the runtime significantly and allocating the buffer instantly
+# with a size of 18446744073709551615 bytes with 32bit exec.
#SET @@global.key_buffer_size = -1;
#SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = 100000000000;
@@ -96,16 +91,14 @@ SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = -1024;
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = ON;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = 'test';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#-------------------FN_DYNVARS_055_05----------------------------#'
###########################################################################
@@ -114,8 +107,7 @@ SELECT @@global.key_buffer_size = @min_key_buffer_size;
--Error ER_GLOBAL_VARIABLE
SET @@session.key_buffer_size = 0;
-SELECT @@key_buffer_size = @min_key_buffer_size;
-
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#----------------------FN_DYNVARS_055_06------------------------#'
##############################################################################
@@ -130,17 +122,15 @@ SELECT @@key_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
-
--echo '#---------------------FN_DYNVARS_055_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.key_buffer_size = TRUE;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
SET @@global.key_buffer_size = FALSE;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--echo '#---------------------FN_DYNVARS_055_08----------------------#'
#####################################################################
@@ -150,7 +140,7 @@ SELECT @@global.key_buffer_size = @min_key_buffer_size;
# due to differences in contents of the warnings
--disable_warnings
-SET @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
--enable_warnings
@@ -160,8 +150,8 @@ SELECT @@key_buffer_size = @@global.key_buffer_size;
##########################################################################
--Error ER_GLOBAL_VARIABLE
-SET key_buffer_size = @min_key_buffer_size;
-SELECT @@key_buffer_size = @min_key_buffer_size;
+SET key_buffer_size = 8 ;
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
--Error ER_PARSE_ERROR
SET local.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
@@ -179,9 +169,9 @@ SELECT key_buffer_size = @@session.key_buffer_size;
##############################
SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
--enable_warnings
#######################################################################
# END OF key_buffer_size TESTS #
#######################################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
index 4dbae7c8847..10acf709386 100644
--- a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
+++ b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
@@ -17,9 +17,12 @@
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
+# Modified: Horst Hunger, 2008-11-28 #
+# disabled warnings as they contain the values of this variable, #
+# modified the check of the value only checking a range. #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
@@ -29,7 +32,7 @@
######################################################################
-# START OF sort_buffer_size TESTS #
+# START OF sort_buffer_size TESTS #
######################################################################
@@ -37,65 +40,63 @@
# Save initial value #
#############################################################
-# due to difference when running on Windows (bug filed)
+# due to differences when running on Windows (bug filed)
--source include/not_windows.inc
-SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
+--disable_warnings
+SET @start_global_value = @@global.sort_buffer_size;
+SET @start_session_value = @@session.sort_buffer_size;
--echo '#--------------------FN_DYNVARS_151_01-------------------------#'
######################################################################
-# Display the DEFAULT value of sort_buffer_size #
+# Display the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = 1000;
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
+SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
+SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
--echo '#--------------------FN_DYNVARS_151_02-------------------------#'
######################################################################
-# Check the DEFAULT value of sort_buffer_size #
+# Check the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
+SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
+SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
--echo '#--------------------FN_DYNVARS_151_03-------------------------#'
################################################################################
-# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
+# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
################################################################################
SET @@global.sort_buffer_size = 32776;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = 32777;
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
---echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
--echo '#--------------------FN_DYNVARS_151_04-------------------------#'
###################################################################################
-# Change the value of sort_buffer_size to a valid value for SESSION Scope #
+# Change the value of sort_buffer_size to a valid value for SESSION Scope #
###################################################################################
SET @@session.sort_buffer_size = 32776;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
SET @@session.sort_buffer_size = 32777;
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 4294967294;
@@ -104,13 +105,13 @@ SELECT @@session.sort_buffer_size;
--echo '#------------------FN_DYNVARS_151_05-----------------------#'
##################################################################
-# Change the value of sort_buffer_size to an invalid value #
+# Change the value of sort_buffer_size to an invalid value #
##################################################################
SET @@global.sort_buffer_size = 32775;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = -1024;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
--Error ER_PARSE_ERROR
@@ -121,19 +122,16 @@ SET @@global.sort_buffer_size = test;
SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = 32775;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
SET @@session.sort_buffer_size = -2;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
--Error ER_PARSE_ERROR
SET @@session.sort_buffer_size = 65530.34.;
SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.sort_buffer_size = test;
-SELECT @@session.sort_buffer_size;
-
--echo '#------------------FN_DYNVARS_151_06-----------------------#'
####################################################################
@@ -141,14 +139,16 @@ SELECT @@session.sort_buffer_size;
####################################################################
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
+ INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
+ INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_08-----------------------#'
@@ -157,25 +157,22 @@ SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSI
####################################################################
SET @@global.sort_buffer_size = TRUE;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
SET @@global.sort_buffer_size = FALSE;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable';
-
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
--echo '#---------------------FN_DYNVARS_151_09----------------------#'
####################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
+# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
-
--echo '#---------------------FN_DYNVARS_151_10----------------------#'
-########################################################################################################
-# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
-########################################################################################################
+###################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable#
+###################################################################################################
SET @@sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@ -184,12 +181,11 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
--echo '#---------------------FN_DYNVARS_151_11----------------------#'
###################################################################################
-# Check if sort_buffer_size can be accessed with and without @@ sign #
+# Check if sort_buffer_size can be accessed with and without @@ sign #
###################################################################################
SET sort_buffer_size = 9100;
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-SELECT @@sort_buffer_size;
+SELECT @@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000;
--Error ER_UNKNOWN_TABLE
SELECT local.sort_buffer_size;
--Error ER_UNKNOWN_TABLE
@@ -203,11 +199,11 @@ SELECT sort_buffer_size = @@session.sort_buffer_size;
####################################
SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
+--enable_warnings
#############################################################
-# END OF sort_buffer_size TESTS #
+# END OF sort_buffer_size TESTS #
#############################################################
+
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
index 981988a1d4d..51c4f841205 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
@@ -1,14 +1,10 @@
SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-@start_value
-1048576
'#--------------------FN_DYNVARS_055_01------------------------#'
SET @@global.key_buffer_size = 99;
SET @@global.key_buffer_size = DEFAULT;
ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
@@ -16,21 +12,20 @@ SELECT @@global.key_buffer_size = @start_value;
@@global.key_buffer_size = @start_value
1
'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
-@@global.key_buffer_size= @min_key_buffer_size
+SET @@global.key_buffer_size = 8 ;
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 1800;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
'#--------------------FN_DYNVARS_055_04-------------------------#'
SET @@global.key_buffer_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
@@ -40,25 +35,24 @@ SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.key_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 'test';
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#-------------------FN_DYNVARS_055_05----------------------------#'
SET @@session.key_buffer_size = 0;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#----------------------FN_DYNVARS_055_06------------------------#'
SELECT @@global.key_buffer_size = VARIABLE_VALUE
@@ -75,25 +69,25 @@ WHERE VARIABLE_NAME='key_buffer_size';
SET @@global.key_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = FALSE;
Warnings:
Warning 1438 Cannot drop default keycache
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
@@key_buffer_size = @@global.key_buffer_size
1
'#---------------------FN_DYNVARS_055_09----------------------#'
-SET key_buffer_size = @min_key_buffer_size;
+SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET local.key_buffer_size = 10;
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 'key_buffer_size = 10' at line 1
@@ -106,6 +100,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT key_buffer_size = @@session.key_buffer_size;
ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-1048576
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
index 981988a1d4d..51c4f841205 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
@@ -1,14 +1,10 @@
SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-@start_value
-1048576
'#--------------------FN_DYNVARS_055_01------------------------#'
SET @@global.key_buffer_size = 99;
SET @@global.key_buffer_size = DEFAULT;
ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
@@ -16,21 +12,20 @@ SELECT @@global.key_buffer_size = @start_value;
@@global.key_buffer_size = @start_value
1
'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
-@@global.key_buffer_size= @min_key_buffer_size
+SET @@global.key_buffer_size = 8 ;
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 1800;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1800'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
61440
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
'#--------------------FN_DYNVARS_055_04-------------------------#'
SET @@global.key_buffer_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
@@ -40,25 +35,24 @@ SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.key_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = 'test';
ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#-------------------FN_DYNVARS_055_05----------------------------#'
SET @@session.key_buffer_size = 0;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#----------------------FN_DYNVARS_055_06------------------------#'
SELECT @@global.key_buffer_size = VARIABLE_VALUE
@@ -75,25 +69,25 @@ WHERE VARIABLE_NAME='key_buffer_size';
SET @@global.key_buffer_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET @@global.key_buffer_size = FALSE;
Warnings:
Warning 1438 Cannot drop default keycache
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = 8 ;
SELECT @@key_buffer_size = @@global.key_buffer_size;
@@key_buffer_size = @@global.key_buffer_size
1
'#---------------------FN_DYNVARS_055_09----------------------#'
-SET key_buffer_size = @min_key_buffer_size;
+SET key_buffer_size = 8 ;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
+SELECT @@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36;
+@@global.key_buffer_size >= 8 AND @@global.key_buffer_size <= 36
1
SET local.key_buffer_size = 10;
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 'key_buffer_size = 10' at line 1
@@ -106,6 +100,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT key_buffer_size = @@session.key_buffer_size;
ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-1048576
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
index 09a1fe59046..353ea9dee8c 100644
--- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
@@ -1,47 +1,33 @@
SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-262144
SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-262144
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1000'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
+@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = 2000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '2000'
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
+@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
+@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
+@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@@ -51,19 +37,14 @@ SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967294
-'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@@ -75,20 +56,14 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296'
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
@@ -103,64 +78,47 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967295
SET @@session.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = -2;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SET @@session.sort_buffer_size = 4294967296;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296'
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967295
'#------------------FN_DYNVARS_151_06-----------------------#'
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@global.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_07-----------------------#'
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@session.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
-'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@sort_buffer_size = @@global.sort_buffer_size
0
'#---------------------FN_DYNVARS_151_10----------------------#'
SET @@sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@sort_buffer_size = @@local.sort_buffer_size
1
@@ -169,14 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9100'
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
+SELECT @@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000;
+@@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000
1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
@@ -184,10 +137,4 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT sort_buffer_size = @@session.sort_buffer_size;
ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-262144
SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-262144
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
index e9bd14abc67..3708f88f889 100644
--- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
@@ -1,47 +1,33 @@
SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-262144
SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-262144
'#--------------------FN_DYNVARS_151_01-------------------------#'
SET @@global.sort_buffer_size = 1000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1000'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
+@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = 2000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '2000'
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
+@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_02-------------------------#'
SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
+SELECT @@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000;
+@@global.sort_buffer_size >= 2097116 AND @@global.sort_buffer_size < 3000000
1
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
+SELECT @@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000;
+@@session.sort_buffer_size >= 2097116 AND @@session.sort_buffer_size < 3000000
1
'#--------------------FN_DYNVARS_151_03-------------------------#'
SET @@global.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
@@ -51,19 +37,14 @@ SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967294
-'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
'#--------------------FN_DYNVARS_151_04-------------------------#'
SET @@session.sort_buffer_size = 32776;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 32777;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
@@ -75,16 +56,12 @@ SELECT @@session.sort_buffer_size;
4294967294
'#------------------FN_DYNVARS_151_05-----------------------#'
SET @@global.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
@@ -101,16 +78,12 @@ SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
4294967296
SET @@session.sort_buffer_size = 32775;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = -2;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+SELECT @@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000;
+@@session.sort_buffer_size >= 32776 AND @@session.sort_buffer_size < 33000
1
SET @@session.sort_buffer_size = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
@@ -118,45 +91,34 @@ SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
@@session.sort_buffer_size
4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.sort_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967296
'#------------------FN_DYNVARS_151_06-----------------------#'
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@global.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_07-----------------------#'
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
@@session.sort_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_151_08-----------------------#'
SET @@global.sort_buffer_size = TRUE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '1'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
SET @@global.sort_buffer_size = FALSE;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+SELECT @@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000;
+@@global.sort_buffer_size >= 32776 AND @@global.sort_buffer_size < 33000
1
-'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_151_09----------------------#'
SET @@global.sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
@@sort_buffer_size = @@global.sort_buffer_size
0
'#---------------------FN_DYNVARS_151_10----------------------#'
SET @@sort_buffer_size = 9000;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9000'
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
@@sort_buffer_size = @@local.sort_buffer_size
1
@@ -165,14 +127,9 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
1
'#---------------------FN_DYNVARS_151_11----------------------#'
SET sort_buffer_size = 9100;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '9100'
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
+SELECT @@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000;
+@@sort_buffer_size >= 32776 AND @@sort_buffer_size < 33000
1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
SELECT local.sort_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.sort_buffer_size;
@@ -180,10 +137,4 @@ ERROR 42S02: Unknown table 'session' in field list
SELECT sort_buffer_size = @@session.sort_buffer_size;
ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-262144
SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-262144
diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
similarity index 76%
rename from mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result
rename to mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
index aeafd95ed55..3b4099d30ae 100644
--- a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result
+++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
@@ -1,39 +1,21 @@
SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
-@start_global_value
-16777216
SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-@start_session_value
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.tmp_table_size = 100;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '100'
SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
Warnings:
Warning 1292 Truncated incorrect tmp_table_size value: '200'
SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-@@global.tmp_table_size = 33554432
-0
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-@@session.tmp_table_size = 33554432
-0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
+SELECT @@global.tmp_table_size >= 16777216;
+@@global.tmp_table_size >= 16777216
+1
+SELECT @@session.tmp_table_size >= 16777216;
+@@session.tmp_table_size >= 16777216
+1
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@global.tmp_table_size = 1024;
SELECT @@global.tmp_table_size;
@@ -52,7 +34,7 @@ SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
1024
-SET @@session.tmp_table_size =4294967295;
+SET @@session.tmp_table_size = 4294967295;
SELECT @@session.tmp_table_size;
@@session.tmp_table_size
4294967295
@@ -79,7 +61,6 @@ Warning 1292 Truncated incorrect tmp_table_size value: '1000'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.tmp_table_size = ON;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size = OFF;
@@ -96,7 +77,6 @@ Warning 1292 Truncated incorrect tmp_table_size value: '0'
SELECT @@global.tmp_table_size;
@@global.tmp_table_size
1024
-'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
SET @@global.tmp_table_size = 65530.34;
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@global.tmp_table_size ="Test";
@@ -120,18 +100,18 @@ SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = "Test";
ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-4294967295
+SELECT @@session.tmp_table_size IN (12345678901,4294967295);
+@@session.tmp_table_size IN (12345678901,4294967295)
+1
'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@global.tmp_table_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@session.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
@@session.tmp_table_size = VARIABLE_VALUE
1
@@ -163,10 +143,4 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT tmp_table_size = @@session.tmp_table_size;
ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
deleted file mode 100644
index 837b90fc143..00000000000
--- a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
+++ /dev/null
@@ -1,172 +0,0 @@
-SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
-@start_global_value
-16777216
-SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-@start_session_value
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.tmp_table_size = 100;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '100'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-SET @@session.tmp_table_size = 200;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '200'
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-@@global.tmp_table_size = 33554432
-0
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-@@session.tmp_table_size = 33554432
-0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.tmp_table_size = 1024;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 60020;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-60020
-SET @@global.tmp_table_size = 4294967295;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-4294967295
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.tmp_table_size = 1024;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size =4294967295;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-4294967295
-SET @@session.tmp_table_size = 65535;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-65535
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.tmp_table_size = 0;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = -1024;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 1000;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '1000'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = True;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '1'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = False;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-SET @@global.tmp_table_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = True;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '1'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = False;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '0'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-12345678901
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='tmp_table_size';
-@@global.tmp_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='tmp_table_size';
-@@session.tmp_table_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.tmp_table_size = 1024;
-SET @@tmp_table_size = 4294967295;
-SELECT @@tmp_table_size = @@global.tmp_table_size;
-@@tmp_table_size = @@global.tmp_table_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@tmp_table_size = 100;
-Warnings:
-Warning 1292 Truncated incorrect tmp_table_size value: '100'
-SELECT @@tmp_table_size = @@local.tmp_table_size;
-@@tmp_table_size = @@local.tmp_table_size
-1
-SELECT @@local.tmp_table_size = @@session.tmp_table_size;
-@@local.tmp_table_size = @@session.tmp_table_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET tmp_table_size = 1027;
-SELECT @@tmp_table_size;
-@@tmp_table_size
-1027
-SELECT local.tmp_table_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.tmp_table_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT tmp_table_size = @@session.tmp_table_size;
-ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
-SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
diff --git a/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc b/mysql-test/suite/sys_vars/t/tmp_table_size_basic.test
similarity index 75%
rename from mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc
rename to mysql-test/suite/sys_vars/t/tmp_table_size_basic.test
index 7f69bcd1f8c..c2ff51d50ca 100644
--- a/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc
+++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic.test
@@ -1,27 +1,29 @@
-############## mysql-test\t\tmp_table_size_basic.test #########################
-# #
-# Variable Name: tmp_table_size #
-# Scope: GLOBAL | SESSION #
-# Access Type: Dynamic #
-# Data Type: numeric #
-# Default Value: 33554432 #
-# Range: 1024-4294967295 #
-# #
-# #
-# Creation Date: 2008-02-13 #
-# Author: Salman #
-# #
-# Description: Test Cases of Dynamic System Variable tmp_table_size #
-# that checks the behavior of this variable in the following ways#
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html#option_mysqld_tmp_table_size #
-# #
-###############################################################################
+########################### tmp_table_size_basic.test ##########################
+# #
+# Variable Name: tmp_table_size #
+# Scope: GLOBAL | SESSION #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value: system dependend #
+# Range: 1024-system dependend #
+# #
+# #
+# Creation Date: 2008-02-13 #
+# Author: Salman #
+# #
+# Description: Test Cases of Dynamic System Variable tmp_table_size #
+# that checks the behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# Modified: 2008-12-04 HHunger #
+# removed the differences between 64 and 32 bit platforms #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
+################################################################################
--source include/load_sysvars.inc
@@ -29,17 +31,12 @@
# START OF tmp_table_size TESTS #
##############################################################
-
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
##############################################################
@@ -48,27 +45,19 @@ SELECT @start_session_value;
SET @@global.tmp_table_size = 100;
SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
-# Check the DEFAULT value of tmp_table_size #
+# Check the DEFAULT value of tmp_table_size #
########################################################################
+# The DEFAULT value is system dependend.
+# Therefore we have only a plausibility check here
+SELECT @@global.tmp_table_size >= 16777216;
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+SELECT @@session.tmp_table_size >= 16777216;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
########################################################################
@@ -87,11 +76,11 @@ SELECT @@global.tmp_table_size;
#########################################################################
# Change the value of tmp_table_size to a valid value for SESSION Scope #
#########################################################################
-
+
SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
-SET @@session.tmp_table_size =4294967295;
+SET @@session.tmp_table_size = 4294967295;
SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = 65535;
SELECT @@session.tmp_table_size;
@@ -111,37 +100,28 @@ SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = 1000;
SELECT @@global.tmp_table_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = ON;
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = OFF;
-
SET @@global.tmp_table_size = True;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = False;
SELECT @@global.tmp_table_size;
---echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = 65530.34;
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size ="Test";
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = ON;
-
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = OFF;
SET @@session.tmp_table_size = True;
@@ -150,21 +130,21 @@ SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = False;
SELECT @@session.tmp_table_size;
--- Error ER_WRONG_TYPE_FOR_VAR
+--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = "Test";
SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
+# With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295
+SELECT @@session.tmp_table_size IN (12345678901,4294967295);
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
-
-SELECT @@global.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+SELECT @@global.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
@@ -172,13 +152,10 @@ WHERE VARIABLE_NAME='tmp_table_size';
# Check if the value in SESSION Table matches value in variable #
####################################################################
-SELECT @@session.tmp_table_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+SELECT @@session.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
-
-
-
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
########################################################################
# Check if global and session variables are independent of each other #
@@ -216,16 +193,12 @@ SELECT global.tmp_table_size;
--Error ER_BAD_FIELD_ERROR
SELECT tmp_table_size = @@session.tmp_table_size;
-
####################################
# Restore initial value #
####################################
SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-
###################################################
# END OF tmp_table_size TESTS #
diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
deleted file mode 100644
index c772b5c896c..00000000000
--- a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/tmp_table_size_basic.inc
-
diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
deleted file mode 100644
index 46b3f65be9a..00000000000
--- a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/tmp_table_size_basic.inc
-
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 76d57e76491..ae48d5a8736 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -751,6 +751,19 @@ ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4);
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types
+#
+create table t1 (a tinytext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+drop table t1;
+create table t1 (a mediumtext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+drop table t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 2eeca1eea90..20a607da826 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1532,5 +1532,11 @@ DROP TABLE t1;
###########################################################################
+#
+# Bug#40104 regression with table names?
+#
+create table `me:i`(id int);
+drop table `me:i`;
+
--echo
--echo End of 5.1 tests
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index ac628f96a0f..67295e8756f 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1804,4 +1804,17 @@ unlock tables;
drop table t1;
--disconnect con1
+#
+# Bug#41441 repair csv table crashes debug server
+#
+# Note: The test should be removed after Bug#33717 is fixed
+
+create table t1(a enum ('a') not null) engine=csv;
+insert into t1 values (2);
+--error ER_CRASHED_ON_USAGE
+select * from t1 limit 1;
+repair table t1;
+select * from t1 limit 1;
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index cb371bc0ca6..e247110658b 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -697,4 +697,29 @@ set names latin1;
#
select hex(char(0x41 using ucs2));
+#
+# Bug#37575: UCASE fails on monthname
+#
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+SELECT CHARSET(MONTHNAME(19700101));
+SELECT LOWER(DAYNAME(19700101));
+SELECT LOWER(MONTHNAME(19700101));
+SELECT UPPER(DAYNAME(19700101));
+SELECT UPPER(MONTHNAME(19700101));
+SELECT HEX(MONTHNAME(19700101));
+SELECT HEX(DAYNAME(19700101));
+SET LC_TIME_NAMES=ru_RU;
+SET NAMES utf8;
+SET character_set_connection=ucs2;
+SELECT CHARSET(DAYNAME(19700101));
+SELECT CHARSET(MONTHNAME(19700101));
+SELECT LOWER(DAYNAME(19700101));
+SELECT LOWER(MONTHNAME(19700101));
+SELECT UPPER(DAYNAME(19700101));
+SELECT UPPER(MONTHNAME(19700101));
+SELECT HEX(MONTHNAME(19700101));
+SELECT HEX(DAYNAME(19700101));
+SET character_set_connection=latin1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index c01bb4b9e44..b40b3faaa8c 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -10,5 +10,7 @@
#
##############################################################################
federated_transactions : Bug#29523 Transactions do not work
-log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
-slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
+slow_query_log_func : Bug #37962: *_func tests containing sleeps/race conditions
+wait_timeout_func : Bug #41225 joro wait_timeout_func fails
+kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
+query_cache_28249 : Bug#41098 Query Cache returns wrong result with concurrent insert
diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test
index 87cfa42e283..041a2def490 100644
--- a/mysql-test/t/events_scheduling.test
+++ b/mysql-test/t/events_scheduling.test
@@ -58,8 +58,6 @@ ON COMPLETION PRESERVE
DO
INSERT INTO table_4 VALUES (1);
-# Wait for the events to fire and check the data afterwards
-
# Let event_1 insert at least 4 records into the table
let $wait_condition=select count(*) >= 4 from table_1;
--source include/wait_condition.inc
@@ -85,25 +83,13 @@ let $wait_condition=select count(*) = 0 from information_schema.events
where event_name='event_4' and status='enabled';
--source include/wait_condition.inc
-let $wait_condition=SELECT SUM(a) >= 4 FROM table_1;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
-
-# In case of a testing box under heavy load it cannot be guaranteed that
-# it is really often enough checked if event_2 has to be executed.
-# -> Bug#39854 events_scheduling fails sporadically on pushbuild
-# Therefore we lowered here the original expectation of 5 to 4.
-let $wait_condition=SELECT SUM(a) >= 4 FROM table_2;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
-
-let $wait_condition=SELECT SUM(a) >= 1 FROM table_3;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
-
-let $wait_condition=SELECT SUM(a) >= 1 FROM table_4;
-source include/wait_condition.inc;
-SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4;
+#
+# On a busy system the scheduler may skip execution of events,
+# we can't reliably expect that the data in a table to be modified
+# by an event will be exact. Thus we do not SELECT from the tables
+# in this test. See also
+# Bug#39854 events_scheduling fails sporadically on pushbuild
+#
SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 21b06ca0882..852369fd568 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -445,3 +445,12 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
DROP TABLE t1;
+
+#
+# BUG#37245 - Full text search problem
+#
+CREATE TABLE t1(a CHAR(10));
+INSERT INTO t1 VALUES('aaa15');
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/fulltext_plugin-master.opt b/mysql-test/t/fulltext_plugin-master.opt
new file mode 100644
index 00000000000..a2554caa20b
--- /dev/null
+++ b/mysql-test/t/fulltext_plugin-master.opt
@@ -0,0 +1 @@
+$SIMPLE_PARSER_OPT
diff --git a/mysql-test/t/fulltext_plugin.test b/mysql-test/t/fulltext_plugin.test
new file mode 100644
index 00000000000..31978dadc51
--- /dev/null
+++ b/mysql-test/t/fulltext_plugin.test
@@ -0,0 +1,10 @@
+--source include/have_simple_parser.inc
+
+#
+# BUG#39746 - Debug flag breaks struct definition (server crash)
+#
+INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
+CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
+ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
+DROP TABLE t1;
+UNINSTALL PLUGIN simple_parser;
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 8da10f36cbe..4efea8e195e 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -150,4 +150,18 @@ FROM t1;
DROP TABLE t1;
+#
+# Bug #40761: Assert on sum func on IF(..., CAST(longtext AS UNSIGNED), signed)
+# (was: LEFT JOIN on inline view crashes server)
+#
+
+CREATE TABLE t1 (c LONGTEXT);
+INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890');
+
+SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
+
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 5a5f4024bc4..5d77c678d52 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1263,4 +1263,14 @@ CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
SELECT HEX(c1) from v1;
DROP VIEW v1;
+#
+# Bug #35558 Wrong server metadata blows up the client
+#
+create table t1(a float);
+insert into t1 values (1.33);
+--enable_metadata
+select format(a, 2) from t1;
+--disable_metadata
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index c417e9a02bf..cdc4e2c8aa6 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -304,6 +304,15 @@ select unix_timestamp('1970-01-01 03:00:01');
# check bad date, close to the boundary (we cut them off in the very end)
select unix_timestamp('2038-01-19 07:14:07');
+#
+# Bug #28759: DAYNAME() and MONTHNAME() return binary string
+#
+
+SELECT CHARSET(DAYNAME(19700101));
+SELECT CHARSET(MONTHNAME(19700101));
+SELECT LOWER(DAYNAME(19700101));
+SELECT LOWER(MONTHNAME(19700101));
+SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
#
# Test types from + INTERVAL
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 3fac767468e..26b735856af 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1294,6 +1294,13 @@ drop view v1;
drop table test;
drop function test_function;
+#
+# Bug#41456 SET PASSWORD hates CURRENT_USER()
+#
+SELECT CURRENT_USER();
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
+SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index bcb22c44076..3dbdf76c220 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1383,4 +1383,11 @@ select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_
where a.VARIABLE_NAME = b.VARIABLE_NAME;
drop table t0;
+#
+# Bug#35275 INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS omits KEY_BLOCK_SIZE
+#
+CREATE TABLE t1(a INT) KEY_BLOCK_SIZE=1;
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/innodb-autoinc.test b/mysql-test/t/innodb-autoinc.test
index aa464e42627..021e67e699f 100644
--- a/mysql-test/t/innodb-autoinc.test
+++ b/mysql-test/t/innodb-autoinc.test
@@ -139,3 +139,262 @@ SELECT c1 FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+#
+# Bug 38839
+# Reset the last value generated at end of statement
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1);
+INSERT INTO t1 VALUES (NULL,8);
+SELECT * FROM t1;
+DROP TABLE t1;
+# Bug 38839 -- same as above but for multi value insert
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, 1);
+DELETE FROM t1 WHERE c1 = 1;
+INSERT INTO t1 VALUES (2,1), (NULL, 8);
+INSERT INTO t1 VALUES (NULL,9);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Test changes to AUTOINC next value calculation
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(5),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with SIGNED INT column, by inserting a 0 for the first column value
+# 0 is treated in the same was NULL.
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(0);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+SET @@INSERT_ID=400;
+# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL
+-- error ER_DUP_ENTRY,1062
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with SIGNED INT column
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with UNSIGNED INT column, single insert
+# The sign in the value is ignored and a new column value is generated
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (-2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (250);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Test with UNSIGNED INT column, multi-value inserts
+# The sign in the value is ignored and a new column value is generated
+# Reset the AUTOINC session variables
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-1);
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
+INSERT INTO t1 VALUES (250),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1000);
+SET @@INSERT_ID=400;
+# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL
+-- error ER_DUP_ENTRY,1062
+INSERT INTO t1 VALUES(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Check for overflow handling when increment is > 1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (9223372036854775794); -- 2^63 - 14
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should just fit
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Check for overflow handling when increment and offser are > 1
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603); -- 2^64 - 13
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should fail because of overflow but it doesn't, it seems to be
+# a MySQL server bug. It wraps around to 0 for the last value.
+# See MySQL Bug# 39828
+#
+# Instead of wrapping around, it asserts when MySQL is compiled --with-debug
+# (see sql/handler.cc:handler::update_auto_increment()). Don't test for
+# overflow until Bug #39828 is fixed.
+#
+# Since this asserts when compiled --with-debug, we can't properly test this
+# until Bug #39828 is fixed. For now, this test is meaningless.
+#if Bug #39828 is fixed
+#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+#else
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+#endif
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Check for overflow handling when increment and offset are odd numbers
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551603); -- 2^64 - 13
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should fail because of overflow but it doesn't. It fails with
+# a duplicate entry message because of a MySQL server bug, it wraps
+# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace
+# the ER_DUP_ENTRY, 1062 below with the appropriate error message
+#
+# Since this asserts when compiled --with-debug, we can't properly test this
+# until Bug #39828 is fixed. For now, this test is meaningless.
+#if Bug #39828 is fixed
+# Still need to fix this error code, error should mention overflow
+#-- error ER_DUP_ENTRY,1062
+#INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
+#else
+INSERT INTO t1 VALUES (NULL),(NULL);
+#endif
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Check for overflow handling when increment and offset are odd numbers
+# and check for large -ve numbers
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES(-9223372036854775806); -- -2^63 + 2
+INSERT INTO t1 VALUES(-9223372036854775807); -- -2^63 + 1
+INSERT INTO t1 VALUES(-9223372036854775808); -- -2^63
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
+SHOW VARIABLES LIKE "%auto_inc%";
+INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# Check for overflow handling when increment and offset are very
+# large numbers 2^60
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SET @@INSERT_ID=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
+# TODO: Fix the autoinc init code
+# We have to do this because of a bug in the AUTOINC init code.
+INSERT INTO t1 VALUES(NULL);
+INSERT INTO t1 VALUES (18446744073709551610); -- 2^64 - 2
+SELECT * FROM t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
+SHOW VARIABLES LIKE "%auto_inc%";
+# This should fail because of overflow but it doesn't. It wraps around
+# and the autoinc values look bogus too.
+# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error
+# code expected test.
+# -- error ER_AUTOINC_READ_FAILED,1467
+#
+# Since this asserts when compiled --with-debug, we can't properly test this
+# until Bug #39828 is fixed. For now, this test is meaningless.
+#if Bug #39828 is fixed
+#-- error ER_AUTOINC_READ_FAILED,1467
+#INSERT INTO t1 VALUES (NULL),(NULL);
+#else
+INSERT INTO t1 VALUES (NULL);
+#endif
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 339be87419a..eaff5867dc3 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -2475,6 +2475,7 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
DROP TABLE t2;
DROP TABLE t1;
# End 34920 test
+#
# Bug #29507 TRUNCATE shows to many rows effected
#
CONNECTION default;
@@ -2491,6 +2492,36 @@ TRUNCATE TABLE t1;
--disable_info
DROP TABLE t1;
#
+# Bug#35537 Innodb doesn't increment handler_update and handler_delete.
+#
+-- disable_query_log
+-- disable_result_log
+
+CONNECT (c1,localhost,root,,);
+
+DROP TABLE IF EXISTS bug35537;
+CREATE TABLE bug35537 (
+ c1 int
+) ENGINE=InnoDB;
+
+INSERT INTO bug35537 VALUES (1);
+
+-- enable_result_log
+
+SHOW SESSION STATUS LIKE 'Handler_update%';
+SHOW SESSION STATUS LIKE 'Handler_delete%';
+
+UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
+DELETE FROM bug35537 WHERE c1 = 2;
+
+SHOW SESSION STATUS LIKE 'Handler_update%';
+SHOW SESSION STATUS LIKE 'Handler_delete%';
+
+DROP TABLE bug35537;
+
+DISCONNECT c1;
+CONNECTION default;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/t/innodb_bug38231.test b/mysql-test/t/innodb_bug38231.test
new file mode 100644
index 00000000000..5b87969f062
--- /dev/null
+++ b/mysql-test/t/innodb_bug38231.test
@@ -0,0 +1,83 @@
+#
+# Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
+# http://bugs.mysql.com/38231
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not crash the server
+-- disable_query_log
+-- disable_result_log
+
+DROP TABLE IF EXISTS bug38231;
+CREATE TABLE bug38231 (a INT);
+
+-- connect (con1,localhost,root,,)
+-- connect (con2,localhost,root,,)
+-- connect (con3,localhost,root,,)
+
+-- connection con1
+SET autocommit=0;
+LOCK TABLE bug38231 WRITE;
+
+-- connection con2
+SET autocommit=0;
+-- send
+LOCK TABLE bug38231 WRITE;
+
+-- connection con3
+SET autocommit=0;
+-- send
+LOCK TABLE bug38231 WRITE;
+
+-- connection default
+-- send
+TRUNCATE TABLE bug38231;
+
+-- connection con1
+# give time to TRUNCATE and others to be executed; without sleep, sometimes
+# UNLOCK executes before TRUNCATE
+-- sleep 0.2
+# this crashes the server if the bug is present
+UNLOCK TABLES;
+
+# clean up
+
+-- connection con2
+UNLOCK TABLES;
+
+-- connection con3
+UNLOCK TABLES;
+
+-- connection default
+
+-- disconnect con1
+-- disconnect con2
+-- disconnect con3
+
+# test that TRUNCATE works with with row-level locks
+
+-- enable_query_log
+-- enable_result_log
+
+INSERT INTO bug38231 VALUES (1), (10), (300);
+
+-- connect (con4,localhost,root,,)
+
+-- connection con4
+SET autocommit=0;
+SELECT * FROM bug38231 FOR UPDATE;
+
+-- connection default
+TRUNCATE TABLE bug38231;
+
+-- connection con4
+COMMIT;
+
+-- connection default
+
+-- disconnect con4
+
+DROP TABLE bug38231;
diff --git a/mysql-test/t/innodb_bug39438-master.opt b/mysql-test/t/innodb_bug39438-master.opt
new file mode 100644
index 00000000000..43fac202fd4
--- /dev/null
+++ b/mysql-test/t/innodb_bug39438-master.opt
@@ -0,0 +1 @@
+--innodb-file-per-table=1
diff --git a/mysql-test/t/innodb_bug39438.test b/mysql-test/t/innodb_bug39438.test
new file mode 100644
index 00000000000..4dc3d957c39
--- /dev/null
+++ b/mysql-test/t/innodb_bug39438.test
@@ -0,0 +1,27 @@
+#
+# Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
+# http://bugs.mysql.com/39438
+#
+# This test must be run with innodb_file_per_table=1 because the crash
+# only occurs if that option is turned on and DISCARD TABLESPACE only
+# works with innodb_file_per_table.
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not crash the server
+-- disable_query_log
+-- disable_result_log
+
+DROP TABLE IF EXISTS bug39438;
+
+CREATE TABLE bug39438 (id INT) ENGINE=INNODB;
+
+ALTER TABLE bug39438 DISCARD TABLESPACE;
+
+# this crashes the server if the bug is present
+SHOW TABLE STATUS;
+
+DROP TABLE bug39438;
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index d47406697f8..1f9c08ac43b 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -53,3 +53,42 @@ CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
CREATE INDEX i1 on t1 (a(3));
SELECT * FROM t1 WHERE a = 'abcde';
DROP TABLE t1;
+
+#
+# Bug #37742: HA_EXTRA_KEYREAD flag is set when key contains only prefix of
+# requested column
+#
+
+CREATE TABLE foo (a int, b int, c char(10),
+ PRIMARY KEY (c(3)),
+ KEY b (b)
+) engine=innodb;
+
+CREATE TABLE foo2 (a int, b int, c char(10),
+ PRIMARY KEY (c),
+ KEY b (b)
+) engine=innodb;
+
+CREATE TABLE bar (a int, b int, c char(10),
+ PRIMARY KEY (c(3)),
+ KEY b (b)
+) engine=myisam;
+
+INSERT INTO foo VALUES
+ (1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
+ (4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
+
+INSERT INTO bar SELECT * FROM foo;
+INSERT INTO foo2 SELECT * FROM foo;
+
+--query_vertical EXPLAIN SELECT c FROM bar WHERE b>2;
+--query_vertical EXPLAIN SELECT c FROM foo WHERE b>2;
+--query_vertical EXPLAIN SELECT c FROM foo2 WHERE b>2;
+
+--query_vertical EXPLAIN SELECT c FROM bar WHERE c>2;
+--query_vertical EXPLAIN SELECT c FROM foo WHERE c>2;
+--query_vertical EXPLAIN SELECT c FROM foo2 WHERE c>2;
+
+DROP TABLE foo, bar, foo2;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/log_bin_trust_function_creators_func-master.opt b/mysql-test/t/log_bin_trust_function_creators_func-master.opt
deleted file mode 100644
index 2dd562ea1aa..00000000000
--- a/mysql-test/t/log_bin_trust_function_creators_func-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin=test.log
diff --git a/mysql-test/t/log_bin_trust_function_creators_func.test b/mysql-test/t/log_bin_trust_function_creators_func.test
index db91128b225..38207babc03 100644
--- a/mysql-test/t/log_bin_trust_function_creators_func.test
+++ b/mysql-test/t/log_bin_trust_function_creators_func.test
@@ -20,6 +20,8 @@
# #
###############################################################################
+source include/have_log_bin.inc;
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -45,10 +47,10 @@ connect (test_con1,localhost,tt,,);
connection test_con1;
SELECT @@log_bin_trust_function_creators;
-SELECT @@sql_log_bin;
---echo ## Creating new function f1 ##
+--echo ## Creating new function f1 fails because no DETERMINISTIC ###
delimiter |;
+--error ER_BINLOG_UNSAFE_ROUTINE
CREATE FUNCTION f1(a INT) RETURNS INT
BEGIN
IF (a < 3) THEN
@@ -58,8 +60,30 @@ BEGIN
END|
delimiter ;|
---echo 'Bug: Create Function should give error here because non-super user';
---echo 'is creating function here';
+--echo ## Creating new function f1 fails because non-super user ##
+delimiter |;
+--error ER_BINLOG_CREATE_ROUTINE_NEED_SUPER
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+ IF (a < 3) THEN
+ INSERT INTO t2 VALUES (a);
+ END IF;
+ RETURN 1;
+END|
+delimiter ;|
+
+connection default;
+
+--echo ## Creating new function f1 succeeds ##
+delimiter |;
+CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
+BEGIN
+ IF (a < 3) THEN
+ INSERT INTO t2 VALUES (a);
+ END IF;
+ RETURN 1;
+END|
+delimiter ;|
--echo ## Creating new table t1 ##
CREATE TABLE t1 (a INT);
diff --git a/mysql-test/t/lowercase_utf8-master.opt b/mysql-test/t/lowercase_utf8-master.opt
new file mode 100644
index 00000000000..1b70aa33023
--- /dev/null
+++ b/mysql-test/t/lowercase_utf8-master.opt
@@ -0,0 +1,4 @@
+--lower-case-table-names=1 --character-set-server=utf8
+
+
+
diff --git a/mysql-test/t/lowercase_utf8.test b/mysql-test/t/lowercase_utf8.test
new file mode 100644
index 00000000000..01b154598fd
--- /dev/null
+++ b/mysql-test/t/lowercase_utf8.test
@@ -0,0 +1,9 @@
+#
+# Bug#25830 SHOW TABLE STATUS behaves differently depending on table name
+#
+set names utf8;
+create table `Ö` (id int);
+show tables from test like 'Ö';
+show tables from test like 'ö';
+drop table `Ö`;
+
diff --git a/mysql-test/t/myisam_data_pointer_size_func.test b/mysql-test/t/myisam_data_pointer_size_func.test
index 36ad31acf6c..985546cbde4 100644
--- a/mysql-test/t/myisam_data_pointer_size_func.test
+++ b/mysql-test/t/myisam_data_pointer_size_func.test
@@ -105,6 +105,7 @@ SELECT count(*) from t1;
DROP PROCEDURE sp_addRec;
DROP TABLE t1;
+SET @@global.myisam_data_pointer_size = default;
################################################################
# End of functionality Testing for myisam_data_pointer_size #
################################################################
diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test
index 6598af6318a..3b55154d433 100644
--- a/mysql-test/t/myisampack.test
+++ b/mysql-test/t/myisampack.test
@@ -31,3 +31,28 @@ FLUSH TABLES;
--exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1
CHECK TABLE t1 EXTENDED;
DROP TABLE t1;
+
+#
+# Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table.
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1(f1 int, f2 char(255));
+insert into t1 values(1, 'foo'), (2, 'bar');
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+flush tables;
+--exec $MYISAMPACK $MYSQLTEST_VARDIR/master-data/test/t1
+optimize table t1;
+drop table t1;
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 528337da77b..f17613a68a5 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -291,6 +291,25 @@ EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql;
+#
+# Bug #33812: mysql client incorrectly parsing DELIMITER
+#
+# The space and ; after delimiter are important
+--exec $MYSQL -e "select 1 delimiter ;"
+
+#
+# Bug #38158: mysql client regression, can't read dump files
+#
+--write_file $MYSQLTEST_VARDIR/tmp/bug38158.sql
+-- Testing
+--
+delimiter ||
+select 2 ||
+EOF
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug38158.sql 2>&1
+--exec $MYSQL -c < $MYSQLTEST_VARDIR/tmp/bug38158.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/bug38158.sql;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/partition_innodb_semi_consistent-master.opt b/mysql-test/t/partition_innodb_semi_consistent-master.opt
new file mode 100644
index 00000000000..e76299453d3
--- /dev/null
+++ b/mysql-test/t/partition_innodb_semi_consistent-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=2
diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test
new file mode 100644
index 00000000000..cfa170f575b
--- /dev/null
+++ b/mysql-test/t/partition_innodb_semi_consistent.test
@@ -0,0 +1,194 @@
+-- source include/have_partition.inc
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# basic tests of semi-consistent reads
+# for verifying Bug#40595: Non-matching rows not released with READ-COMMITTED
+# on tables with partitions
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+set binlog_format=mixed;
+set session transaction isolation level read committed;
+create table t1(a int not null)
+engine=innodb
+DEFAULT CHARSET=latin1
+PARTITION BY RANGE(a)
+(PARTITION p0 VALUES LESS THAN (20),
+ PARTITION p1 VALUES LESS THAN MAXVALUE);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7);
+set autocommit=0;
+# this should lock the entire table
+select * from t1 where a=3 lock in share mode;
+connection b;
+set binlog_format=mixed;
+set session transaction isolation level read committed;
+set autocommit=0;
+-- error ER_LOCK_WAIT_TIMEOUT
+update t1 set a=10 where a=5;
+connection a;
+#DELETE FROM t1 WHERE a=5;
+commit;
+connection b;
+update t1 set a=10 where a=5;
+connection a;
+-- error ER_LOCK_WAIT_TIMEOUT
+select * from t1 where a=2 for update;
+# this should lock the records (1),(2)
+select * from t1 where a=2 limit 1 for update;
+connection b;
+update t1 set a=11 where a=6;
+-- error ER_LOCK_WAIT_TIMEOUT
+update t1 set a=12 where a=2;
+-- error ER_LOCK_WAIT_TIMEOUT
+update t1 set a=13 where a=1;
+connection a;
+commit;
+connection b;
+update t1 set a=14 where a=1;
+commit;
+connection a;
+--sorted_result
+select * from t1;
+drop table t1;
+
+connection default;
+disconnect a;
+disconnect b;
+
+#
+# Bug #31310: Locked rows silently skipped in read-committed isolation level.
+# (This also tests the '*_semi_consistent*' functions in partitioning)
+# Copied from include/mix1.inc
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+SET SESSION AUTOCOMMIT = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+set binlog_format=mixed;
+--echo # Switch to connection con1
+connection con1;
+
+eval
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (300),
+ PARTITION p1 VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1,2);
+
+--echo # 1. test for locking:
+
+BEGIN;
+--enable_info
+UPDATE t1 SET b = 12 WHERE a = 1;
+--disable_info
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+
+--enable_info
+--disable_abort_on_error
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b = 21 WHERE a = 1;
+--disable_info
+
+--echo # Switch to connection con1
+connection con1;
+SELECT * FROM t1;
+ROLLBACK;
+
+--echo # 2. test for serialized update:
+
+CREATE TABLE t2 (a INT);
+
+TRUNCATE t1;
+INSERT INTO t1 VALUES (1,'init');
+
+DELIMITER |;
+CREATE PROCEDURE p1()
+BEGIN
+ UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+ INSERT INTO t2 VALUES ();
+END|
+DELIMITER ;|
+
+BEGIN;
+--enable_info
+UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
+--disable_info
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+
+--send CALL p1;
+
+--echo # Switch to connection con1
+connection con1;
+SELECT * FROM t1;
+COMMIT;
+
+let $bug31310 = 1;
+while ($bug31310)
+{
+ let $bug31310= `SELECT 1 - COUNT(*) FROM t2`;
+}
+
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+--reap
+SELECT * FROM t1;
+
+--echo # Switch to connection con1
+connection con1;
+
+--echo # 3. test for updated key column:
+
+TRUNCATE t1;
+TRUNCATE t2;
+
+INSERT INTO t1 VALUES (1,'init');
+
+BEGIN;
+--enable_info
+UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
+--disable_info
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+
+--send CALL p1;
+
+--echo # Switch to connection con1
+connection con1;
+SELECT * FROM t1;
+COMMIT;
+
+let $bug31310 = 1;
+while ($bug31310)
+{
+ let $bug31310= `SELECT 1 - COUNT(*) FROM t2`;
+}
+
+SELECT * FROM t1;
+
+--echo # Switch to connection con2
+connection con2;
+SELECT * FROM t1;
+
+connection default;
+disconnect con1;
+disconnect con2;
+DROP PROCEDURE p1;
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/t/partition_innodb_stmt.test b/mysql-test/t/partition_innodb_stmt.test
index 2ed5baee0ac..d6181ce068e 100644
--- a/mysql-test/t/partition_innodb_stmt.test
+++ b/mysql-test/t/partition_innodb_stmt.test
@@ -1,3 +1,4 @@
+--source include/have_partition.inc
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test
index 524a2e04b25..67544471a8d 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -3,6 +3,17 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
+#
+# Bug 40389: REORGANIZE PARTITION crashes when only using one partition
+#
+CREATE TABLE t1 (a INT PRIMARY KEY)
+ENGINE MYISAM
+PARTITION BY HASH (a)
+PARTITIONS 1;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+ALTER TABLE t1 REORGANIZE PARTITION;
+DROP TABLE t1;
+
#
# Bug 21143: mysqld hang when error in number of subparts in
# REORGANIZE command
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 88287e53b34..fe720ee68b7 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -300,7 +300,7 @@ select * from t1;
select * from t1;
show status like "Qcache_queries_in_cache";
insert delayed into t1 values (4);
---sleep 5 # Wait for insert delayed to be executed.
+--sleep 5 # Wait for insert delayed to be executed.
select a from t1;
show status like "Qcache_queries_in_cache";
drop table t1;
@@ -410,10 +410,10 @@ create table t1(id int auto_increment primary key);
insert into t1 values (NULL), (NULL), (NULL);
select * from t1 where id=2;
alter table t1 rename to t2;
--- error 1146
+--error ER_NO_SUCH_TABLE
select * from t1 where id=2;
drop table t2;
--- error 1146
+--error ER_NO_SUCH_TABLE
select * from t1 where id=2;
#
@@ -435,11 +435,14 @@ create table t1 (a int);
insert into t1 values (1),(2),(3);
show status like "Qcache_queries_in_cache";
select * from t1 into outfile "query_cache.out.file";
---error 1086
+--error ER_FILE_EXISTS_ERROR
select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
show status like "Qcache_queries_in_cache";
drop table t1;
+let $datadir=`select @@datadir`;
+--remove_file $datadir/test/query_cache.dump.file
+--remove_file $datadir/test/query_cache.out.file
#
# test of SQL_SELECT_LIMIT
@@ -537,7 +540,7 @@ drop table t1;
# If at least one of the above variables has changed,
# the cached query can't be reused. In the below test
# absolutely the same query is used several times,
-# SELECT should fetch different results for every instance.
+# SELECT should fetch different results for every instance.
# No hits should be produced.
# New cache entry should appear for every SELECT.
#
@@ -554,21 +557,21 @@ show status like "Qcache_queries_in_cache";
# Change collation_connection and run the same query again
#
set collation_connection=koi8r_bin;
-SELECT a,'',''='' FROM t1;
+SELECT a,'',''='' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
#
# Now change character_set_client and run the same query again
#
set character_set_client=cp1251;
-SELECT a,'',''='' FROM t1;
+SELECT a,'',''='' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
#
# And finally change character_set_results and run the same query again
#
set character_set_results=cp1251;
-SELECT a,'',''='' FROM t1;
+SELECT a,'',''='' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
SET NAMES default;
@@ -602,12 +605,12 @@ insert into t1 set c = repeat('x',24);
insert into t1 set c = concat(repeat('x',24),'x');
insert into t1 set c = concat(repeat('x',24),'w');
insert into t1 set c = concat(repeat('x',24),'y');
-set max_sort_length=200;
+set max_sort_length=200;
select c from t1 order by c, id;
reset query cache;
set max_sort_length=20;
select c from t1 order by c, id;
-set max_sort_length=200;
+set max_sort_length=200;
select c from t1 order by c, id;
set max_sort_length=default;
# sql_mode
@@ -801,9 +804,10 @@ create procedure `p1`()
begin
select a, f1() from t1;
end//
+SET @log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
call p1()//
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET GLOBAL log_bin_trust_function_creators = @log_bin_trust_function_creators;
drop procedure p1//
drop function f1//
@@ -1016,7 +1020,7 @@ set GLOBAL query_cache_size= default;
#
-# Bug #28897 UUID() returns non-unique values when query cache is enabled
+# Bug#28897 UUID() returns non-unique values when query cache is enabled
#
set GLOBAL query_cache_size=1000000;
@@ -1025,7 +1029,7 @@ create table t1 (a char);
insert into t1 values ('c');
let $q1= `select UUID(), a from t1`;
-let $q2= `select UUID(), a from t1`;
+let $q2= `select UUID(), a from t1`;
# disabling the logging of the query because the UUIDs are different each run.
--disable_query_log
@@ -1046,7 +1050,7 @@ create table t1 (a char);
insert into t1 values ('c');
let $q1= `select RAND() from t1 union select sql_cache 1 from t1;`;
-let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
+let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
# disabling the logging of the query because the times are different each run.
--disable_query_log
@@ -1181,75 +1185,6 @@ DROP PROCEDURE proc29856;
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
-#
-# Bug #28249 Query Cache returns wrong result with concurrent insert / certain lock
-#
---echo Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
-connect (user1,localhost,root,,test,,);
-connect (user2,localhost,root,,test,,);
-connect (user3,localhost,root,,test,,);
-
-connection user1;
-
-set GLOBAL query_cache_type=1;
-set GLOBAL query_cache_limit=10000;
-set GLOBAL query_cache_min_res_unit=0;
-set GLOBAL query_cache_size= 100000;
-
-flush tables;
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-create table t1 (a int);
-create table t2 (a int);
-insert into t1 values (1),(2),(3);
-connection user2;
---echo Locking table T2 with a write lock.
-lock table t2 write;
-
-connection user1;
---echo Select blocked by write lock.
---send select *, (select count(*) from t2) from t1;
---echo Sleeing is ok, because selecting should be done very fast.
-sleep 5;
-
-connection user3;
---echo Inserting into table T1.
-insert into t1 values (4);
-
-connection user2;
---echo Unlocking the tables.
-unlock tables;
-
-connection user1;
---echo Collecting result from previously blocked select.
-#
-# Since the lock ordering rule in thr_multi_lock depends on
-# pointer values, from execution to execution we might have
-# different lock order, and therefore, sometimes lock t1 and block
-# on t2, and sometimes block on t2 right away. In the second case,
-# the following insert succeeds, and only then this select can
-# proceed, and we actually test nothing, as the very first select
-# returns 4 rows right away.
-# It's fine to have a test case that covers the problematic area
-# at least once in a while.
-# We, however, need to disable the result log here to make the
-# test repeatable.
---disable_result_log
---reap
---enable_result_log
---echo Next select should contain 4 rows, as the insert is long finished.
-select *, (select count(*) from t2) from t1;
-reset query cache;
-select *, (select count(*) from t2) from t1;
-
-drop table t1,t2;
-
-connection default;
-disconnect user1;
-disconnect user2;
-disconnect user3;
-
#
--echo #
--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1
@@ -1260,7 +1195,7 @@ set global query_cache_type=0;
show status like 'Qcache_free_blocks';
--echo Restore default values.
-# Bug #28211 RENAME DATABASE and query cache don't play nicely together
+# Bug#28211 RENAME DATABASE and query cache don't play nicely together
#
# TODO: enable these tests when RENAME DATABASE is implemented.
# --disable_warnings
@@ -1278,7 +1213,7 @@ show status like 'Qcache_free_blocks';
# show status like 'Qcache_queries_in_cache';
# drop database db2;
# set global query_cache_size=default;
-#
+#
# --disable_warnings
# drop database if exists db1;
# drop database if exists db3;
diff --git a/mysql-test/t/query_cache_28249.test b/mysql-test/t/query_cache_28249.test
new file mode 100644
index 00000000000..3cf6c89369e
--- /dev/null
+++ b/mysql-test/t/query_cache_28249.test
@@ -0,0 +1,123 @@
+### t/query_cache_28249.test ###
+#
+# Test for
+# Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock
+#
+# Last modification:
+# 2008-11-27 mleich - Move this test out of query_cache.test
+# - Fix Bug#40179 Test main.query_cache failing randomly on Pushbuild,
+# test weakness
+# - Minor improvements (comments,formatting etc.)
+#
+
+--source include/have_query_cache.inc
+
+SET @query_cache_type= @@global.query_cache_type;
+SET @query_cache_limit= @@global.query_cache_limit;
+SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit;
+SET @query_cache_size= @@global.query_cache_size;
+
+--echo # Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+--echo # Establish connections user1,user2,user3 (user=root)
+connect (user1,localhost,root,,test,,);
+connect (user2,localhost,root,,test,,);
+connect (user3,localhost,root,,test,,);
+
+--echo # Switch to connection user1
+connection user1;
+
+SET GLOBAL query_cache_type=1;
+SET GLOBAL query_cache_limit=10000;
+SET GLOBAL query_cache_min_res_unit=0;
+SET GLOBAL query_cache_size= 100000;
+
+FLUSH TABLES;
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+--echo # Switch to connection user2
+connection user2;
+LOCK TABLE t2 WRITE;
+
+--echo # Switch to connection user1
+connection user1;
+--echo # "send" the next select, "reap" the result later.
+--echo # The select will be blocked by the write lock on the t1.
+let $select_for_qc =
+SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
+send;
+eval $select_for_qc;
+
+--echo # Switch to connection user3
+connection user3;
+# Typical information_schema.processlist content after sufficient sleep time
+# ID USER COMMAND TIME STATE INFO
+# ....
+# 2 root Query 5 Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+# ....
+# XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+# The values marked with 'X' must be reached.
+--echo # Poll till the select of connection user1 is blocked by the write lock on t1.
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
+WHERE state = 'Locked'
+ AND info = '$select_for_qc';
+--source include/wait_condition.inc
+eval
+SELECT user,command,state,info FROM information_schema.processlist
+WHERE state = 'Locked'
+ AND info = '$select_for_qc';
+INSERT INTO t1 VALUES (4);
+
+--echo # Switch to connection user2
+connection user2;
+UNLOCK TABLES;
+
+--echo # Switch to connection user1
+connection user1;
+#
+# Since the lock ordering rule in thr_multi_lock depends on
+# pointer values, from execution to execution we might have
+# different lock order, and therefore, sometimes lock t1 and block
+# on t2, and sometimes block on t2 right away. In the second case,
+# the following insert succeeds, and only then this select can
+# proceed, and we actually test nothing, as the very first select
+# returns 4 rows right away.
+# It's fine to have a test case that covers the problematic area
+# at least once in a while.
+--echo # Collecting ("reap") the result from the previously blocked select.
+--echo # The printing of the result (varies between 3 and 4 rows) set has to be suppressed.
+--disable_result_log
+--reap
+--enable_result_log
+
+--echo # Switch to connection user3
+connection user3;
+--echo # The next select enforces that effects of "concurrent_inserts" like the
+--echo # record with a = 4 is missing in result sets can no more happen.
+SELECT 1 FROM t1 WHERE a = 4;
+
+--echo # Switch to connection user1
+connection user1;
+--echo # The next result set must contain 4 rows.
+# If not, we have a regression of Bug#28249
+eval $select_for_qc;
+RESET QUERY CACHE;
+eval $select_for_qc;
+
+DROP TABLE t1,t2;
+
+--echo # Switch to connection default + close connections user1,user2,user3
+connection default;
+disconnect user1;
+disconnect user2;
+disconnect user3;
+
+SET GLOBAL query_cache_type= @query_cache_type;
+SET GLOBAL query_cache_limit= @query_cache_limit;
+SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit;
+SET GLOBAL query_cache_size= @query_cache_size;
+
diff --git a/mysql-test/t/rpl_init_slave_func-slave.opt b/mysql-test/t/rpl_init_slave_func-slave.opt
deleted file mode 100644
index 337e8a60d97..00000000000
--- a/mysql-test/t/rpl_init_slave_func-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---init-slave="set global max_connections=500"
diff --git a/mysql-test/t/rpl_init_slave_func.test b/mysql-test/t/rpl_init_slave_func.test
index b3d647f4394..f17cc1289b1 100644
--- a/mysql-test/t/rpl_init_slave_func.test
+++ b/mysql-test/t/rpl_init_slave_func.test
@@ -10,86 +10,92 @@
# #
# Creation Date: 2008-03-08 #
# Author: Rizwan #
+# Modified: HHunger 2008-09-29 Fixed the bug by inserting the usual wait and #
+# SQL-Satements to control master and slave, #
+# deleted the sleep and made improvements like: #
+# - Replaced the opt file by dynamic variables, #
+# - Made the tests independant of the initial #
+# values of the global variables, #
+# - Reduced the test to the needed test case to #
+# save run time, #
+# - Beautification. #
# #
# Description: Test Cases of Dynamic System Variable init_slave #
# that checks the behavior of this variable #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
source include/master-slave.inc;
-
---echo '#--------------------FN_DYNVARS_037_01-------------------------#'
-##################################################################
-# Check if setting init_slave is changed in every new connection #
-##################################################################
-
-SET @@global.init_slave = "SET @a = 10";
-
---echo 'connect (con1,localhost,root,,)'
-connect (con1,localhost,root,,);
---echo 'connection con1'
-connection con1;
-SELECT @@global.init_slave;
-disconnect con1;
---echo 'connection master'
-connection master;
-
---echo '#--------------------FN_DYNVARS_037_02-------------------------#'
-####################################################
-# Begin the functionality Testing of init_slave #
-####################################################
-
-#====================================================
---echo 'check if value in slave opt file is executed'
-#====================================================
-save_master_pos;
---echo 'connection slave'
+--echo connection slave
connection slave;
-sleep 1;
-show variables like 'init_slave';
-show variables like 'max_connections';
-sync_with_master;
-reset master;
+#
+# save the current values
-#===============================================================
---echo 'check if value in slave opt file doesnt apply to master'
-#===============================================================
+SET @start_max_connections= @@global.max_connections;
+SET @start_init_slave= @@global.init_slave;
---echo 'connection master'
-connection master;
-show variables like 'init_slave';
-show variables like 'max_connections';
-save_master_pos;
---echo 'connection slave'
-connection slave;
-sync_with_master;
+# setting of a global value with an effect on the next start of the slave server
+# check that @@global.init_slave could be set
+let $my_init_slave=
+ 'SET @@global.max_connections = @@global.max_connections + 1';
+eval SET @@global.init_slave = $my_init_slave;
-#=======================================================
---echo 'try creating a temporary variable in init_slave'
-#=======================================================
-
-SET @@global.init_slave = "SET @a=5";
-
-stop slave;
---wait_for_slave_to_stop
-reset slave;
-# Clean up old test tables
+# show the data type of the variable
--disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+DROP TABLE IF EXISTS t1;
+CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column;
--enable_warnings
-start slave;
-
+DESCRIBE t1;
+DROP TABLE t1;
+#
+# check that the new setting of @@global.init_slave becomes immediately visible
+eval SELECT @@global.init_slave = $my_init_slave;
+--echo Expect 1
+# wait for the slave threads have set the global variable.
+let $wait_timeout= 90;
+let $wait_condition= SELECT @@global.max_connections = @start_max_connections;
+--source include/wait_condition_sp.inc
+# check that the action in init_slave does not happen immediately
+SELECT @@global.max_connections= @start_max_connections;
+--echo Expect 1
+#
+# reset of the server
+STOP SLAVE;
+--wait_for_slave_to_stop
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+#
+# wait for the slave threads have set the global variable.
+let $wait_timeout= 90;
+let $wait_condition= SELECT @@global.max_connections = @start_max_connections + 1;
+--source include/wait_condition_sp.inc
+# check that the action in init_slave was executed and had the intended effect
+SELECT @@global.max_connections = @start_max_connections + 1;
+--echo Expect 1
+#
+# Setting a variable(which is local to a session) and must not be visible
+SET @@global.init_slave = "SET @a=5";
+#
+STOP SLAVE;
+--wait_for_slave_to_stop
+RESET MASTER;
+RESET SLAVE;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+#
SHOW VARIABLES LIKE 'init_slave';
+# expect NULL
SELECT @a;
-
---echo 'Bug#35365 SET statement in init_slave not execute if slave is restarted'
-
-# Restore value
-set global max_connections= default;
-
+--echo Expect NULL
+#
+# Clean up
+SET @@global.max_connections= @start_max_connections;
+SET @@global.init_slave= @start_init_slave;
##################################################
# End of functionality Testing for init_slave #
##################################################
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 30abb797e83..ccdb53ec11f 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3690,6 +3690,42 @@ SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3;
SHOW STATUS LIKE 'Handler_read%';
DROP TABLE t1, t2;
+#
+# Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error
+#
+CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
+ f2 int(11) NOT NULL default '0',
+ f3 bigint(20) NOT NULL default '0',
+ f4 varchar(255) NOT NULL default '',
+ PRIMARY KEY (f1),
+ KEY key1 (f4),
+ KEY key2 (f2));
+CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
+ f2 enum('A1','A2','A3') NOT NULL default 'A1',
+ f3 int(11) NOT NULL default '0',
+ PRIMARY KEY (f1),
+ KEY key1 (f3));
+CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
+ f2 datetime NOT NULL default '1980-01-01 00:00:00',
+ PRIMARY KEY (f1));
+
+insert into t1 values (1, 1, 1, 'abc');
+insert into t1 values (2, 1, 2, 'def');
+insert into t1 values (3, 1, 2, 'def');
+insert into t2 values (1, 'A1', 1);
+insert into t3 values (1, '1980-01-01');
+
+SELECT a.f3, cr.f4, count(*) count
+FROM t2 a
+STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
+LEFT JOIN
+(t1 cr2
+ JOIN t3 ae2 ON cr2.f3 = ae2.f1
+) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
+cr.f4 = cr2.f4
+GROUP BY a.f3, cr.f4;
+
+drop table t1, t2, t3;
--echo End of 5.0 tests
#
@@ -3701,3 +3737,36 @@ SELECT a FROM t1 ORDER BY a LIMIT 2;
SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296;
SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297;
DROP TABLE t1;
+
+#
+# Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store ,
+# Field_varstring::store
+#
+
+CREATE TABLE A (date_key date);
+
+CREATE TABLE C (
+ pk int,
+ int_nokey int,
+ int_key int,
+ date_key date NOT NULL,
+ date_nokey date,
+ varchar_key varchar(1)
+);
+
+INSERT INTO C VALUES
+(1,1,1,'0000-00-00',NULL,NULL),
+(1,1,1,'0000-00-00',NULL,NULL);
+
+SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C);
+
+SELECT COUNT(DISTINCT 1) FROM C
+ WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk;
+SELECT date_nokey FROM C
+ WHERE int_key IN (SELECT 1 FROM A)
+ HAVING date_nokey = '10:41:7'
+ ORDER BY date_key;
+
+DROP TABLE A,C;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index bc241423417..5f20bf9eceb 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -238,6 +238,8 @@ let $tmp_table2 = `show global status like 'Created_tmp_tables'`;
--disable_query_log
eval select substring_index('$rnd_next2',0x9,-1)-substring_index('$rnd_next',0x9,-1) as rnd_diff, substring_index('$tmp_table2',0x9,-1)-substring_index('$tmp_table',0x9,-1) as tmp_table_diff;
--enable_query_log
+disconnect con1;
+connection default;
#
# Bug#30252 Com_create_function is not incremented.
@@ -291,6 +293,43 @@ connection root;
drop database db37908;
drop procedure proc37908;
drop function func37908;
+
+#
+# Bug#41131 "Questions" fails to increment - ignores statements instead stored procs
+#
+connect (con1,localhost,root,,);
+connection con1;
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+DELIMITER $$;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+ DECLARE foo INTEGER;
+ DECLARE bar INTEGER;
+ SET foo=1;
+ SET bar=2;
+ RETURN foo;
+END $$
+CREATE PROCEDURE p1()
+ BEGIN
+ SELECT 1;
+END $$
+DELIMITER ;$$
+let $org_queries= `SHOW STATUS LIKE 'Queries'`;
+SELECT f1();
+CALL p1();
+let $new_queries= `SHOW STATUS LIKE 'Queries'`;
+--disable_log
+let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`;
+--enable_log
+eval SELECT $diff;
+disconnect con1;
+connection default;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
# End of 5.1 tests
# Restore global concurrent_insert value. Keep in the end of the test file.
diff --git a/mysql-test/t/status2.test b/mysql-test/t/status2.test
new file mode 100644
index 00000000000..2d1541c54f2
--- /dev/null
+++ b/mysql-test/t/status2.test
@@ -0,0 +1,68 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
+--echo #
+FLUSH STATUS;
+DELIMITER $$;
+CREATE FUNCTION testQuestion() RETURNS INTEGER
+BEGIN
+ DECLARE foo INTEGER;
+ DECLARE bar INTEGER;
+ SET foo=1;
+ SET bar=2;
+ RETURN foo;
+END $$
+CREATE PROCEDURE testQuestion2()
+BEGIN
+ SELECT 1;
+END $$
+DELIMITER ;$$
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
+ DO INSERT INTO t1 VALUES(1);
+
+--echo Assert Questions == 7
+SHOW STATUS LIKE 'Questions';
+SELECT testQuestion();
+--echo Assert Questions == 9
+SHOW STATUS LIKE 'Questions';
+CALL testQuestion2();
+--echo Assert Questions == 11
+SHOW STATUS LIKE 'Questions';
+SELECT 1;
+--echo Assert Questions == 13
+SHOW STATUS LIKE 'Questions';
+connect (con1,localhost,root,,);
+connection con1;
+SELECT 1;
+connection default;
+disconnect con1;
+--echo Assert Questions == 14
+SHOW STATUS LIKE 'Questions';
+DELIMITER $$;
+CREATE TRIGGER trigg1 AFTER INSERT ON t1
+ FOR EACH ROW BEGIN
+ INSERT INTO t2 VALUES (1);
+ END;
+$$
+DELIMITER ;$$
+--echo Assert Questions == 16
+SHOW STATUS LIKE 'Questions';
+INSERT INTO t1 VALUES (1);
+--echo Assert Questions == 18
+SHOW STATUS LIKE 'Questions';
+# TODO: Uncomment the lines below when FLUSH GLOBAL STATUS is implemented.
+# FLUSH STATUS;
+# SHOW GLOBAL STATUS LIKE 'Questions';
+DROP PROCEDURE testQuestion2;
+DROP TRIGGER trigg1;
+DROP FUNCTION testQuestion;
+DROP EVENT ev1;
+DROP TABLE t1,t2;
+--echo End of 6.0 tests
+
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 5793846a0b2..dc5120db430 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -352,6 +352,51 @@ SELECT HEX(b1), HEX(b2), i2 FROM t2
DROP TABLE t1, t2;
+#
+# Bug #35796 SHOW CREATE TABLE and default value for BIT field
+#
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b'10',
+f2 bit(14) NOT NULL default b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--error ER_INVALID_DEFAULT
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+
+#
+# Bug#31399 Wrong query result when doing join buffering over BIT fields
+#
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(7)) engine=MyISAM;
+
+insert into t1bit7 values (b'1100000');
+insert into t1bit7 values (b'1100001');
+insert into t1bit7 values (b'1100010');
+insert into t2bit7 values (b'1100001');
+insert into t2bit7 values (b'1100010');
+insert into t2bit7 values (b'1100110');
+
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+drop table t1bit7, t2bit7;
+
+create table t1bit7 (a1 bit(15) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(15)) engine=MyISAM;
+
+insert into t1bit7 values (b'110000011111111');
+insert into t1bit7 values (b'110000111111111');
+insert into t1bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110000111111111');
+insert into t2bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110011011111111');
+
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+drop table t1bit7, t2bit7;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index 9aa8c00d24a..53bcf44061d 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -252,4 +252,19 @@ insert into t1 values (2e30), (-2e30);
select f1 + 0e0 from t1;
drop table t1;
+#
+# Bug #27483: Casting 'scientific notation type' to 'unsigned bigint' fails on
+# windows.
+#
+
+create table t1(d double, u bigint unsigned);
+
+insert into t1(d) values (9.22337203685479e18),
+ (1.84e19);
+
+update t1 set u = d;
+select u from t1;
+
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/warnings_engine_disabled.test b/mysql-test/t/warnings_engine_disabled.test
index 0b09cff7b1e..b8751a062b7 100644
--- a/mysql-test/t/warnings_engine_disabled.test
+++ b/mysql-test/t/warnings_engine_disabled.test
@@ -4,7 +4,7 @@
#
disable_query_log;
--require r/true.require
-select support = 'Disabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+select support = 'NO' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
enable_query_log;
@@ -16,4 +16,9 @@ create table t1 (id int) engine=NDB;
alter table t1 engine=NDB;
drop table t1;
-
+#
+# Bug#29263 disabled storage engines omitted in SHOW ENGINES
+#
+SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
+SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE
+PLUGIN_NAME='ndbcluster';
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 5ca9c7afd76..d840e14ba5f 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -551,4 +551,29 @@ INSERT INTO t1 VALUES (0), (0);
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
DROP TABLE t1;
+#
+# BUG#38227 EXTRACTVALUE doesn't work with DTD declarations
+#
+# Check that quoted strings work fine in DOCTYPE declaration.
+#
+
+SET @xml=
+'
+
+
+ Title - document with document declaration
+
+ Hi, Im a webpage with document a declaration
+';
+
+SELECT ExtractValue(@xml, 'html/head/title');
+SELECT ExtractValue(@xml, 'html/body');
+
+# These two documents will fail.
+# Quoted strings are not allowed in regular tags
+#
+SELECT ExtractValue('CharData', '/xml');
+SELECT ExtractValue('CharData', '/xml');
+
+
--echo End of 5.1 tests
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 933674fa007..2278c467f32 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -368,17 +368,7 @@ void my_thread_end(void)
struct st_my_thread_var *_my_thread_var(void)
{
- struct st_my_thread_var *tmp=
- my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
-#if defined(USE_TLS)
- /* This can only happen in a .DLL */
- if (!tmp)
- {
- my_thread_init();
- tmp=my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
- }
-#endif
- return tmp;
+ return my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
}
diff --git a/sql/field.cc b/sql/field.cc
index e815320bc9e..f4651764b94 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -3835,7 +3835,7 @@ int Field_longlong::store(double nr)
error= 1;
}
else
- res=(longlong) (ulonglong) nr;
+ res=(longlong) double2ulonglong(nr);
}
else
{
diff --git a/sql/field.h b/sql/field.h
index 81905cc64ae..23033e6cc7a 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -209,7 +209,7 @@ public:
memcpy(ptr, ptr + l_offset, pack_length());
if (null_ptr)
*null_ptr= ((*null_ptr & (uchar) ~null_bit) |
- null_ptr[l_offset] & null_bit);
+ (null_ptr[l_offset] & null_bit));
}
virtual bool binary() const { return 1; }
virtual bool zero_pack() const { return 1; }
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 0c96b06381c..47d2d36ac8d 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2818,6 +2818,36 @@ void ha_partition::unlock_row()
DBUG_VOID_RETURN;
}
+/**
+ Check if semi consistent read was used
+
+ SYNOPSIS
+ was_semi_consistent_read()
+
+ RETURN VALUE
+ TRUE Previous read was a semi consistent read
+ FALSE Previous read was not a semi consistent read
+
+ DESCRIPTION
+ See handler.h:
+ In an UPDATE or DELETE, if the row under the cursor was locked by another
+ transaction, and the engine used an optimistic read of the last
+ committed row value under the cursor, then the engine returns 1 from this
+ function. MySQL must NOT try to update this optimistic value. If the
+ optimistic value does not match the WHERE condition, MySQL can decide to
+ skip over this row. Currently only works for InnoDB. This can be used to
+ avoid unnecessary lock waits.
+
+ If this method returns nonzero, it will also signal the storage
+ engine that the next read will be a locking re-read of the row.
+*/
+bool ha_partition::was_semi_consistent_read()
+{
+ DBUG_ENTER("ha_partition::was_semi_consistent_read");
+ DBUG_ASSERT(m_last_part < m_tot_parts &&
+ bitmap_is_set(&(m_part_info->used_partitions), m_last_part));
+ DBUG_RETURN(m_file[m_last_part]->was_semi_consistent_read());
+}
/**
Use semi consistent read if possible
@@ -3431,7 +3461,7 @@ int ha_partition::rnd_next(uchar *buf)
while (TRUE)
{
- int result= file->rnd_next(buf);
+ result= file->rnd_next(buf);
if (!result)
{
m_last_part= part_id;
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index dd06d8d647b..bae2d03a8ce 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -112,7 +112,7 @@ private:
uint m_reorged_parts; // Number of reorganised parts
uint m_tot_parts; // Total number of partitions;
uint m_no_locks; // For engines like ha_blackhole, which needs no locks
- uint m_last_part; // Last file that we update,write
+ uint m_last_part; // Last file that we update,write,read
int m_lock_type; // Remembers type of last
// external_lock
part_id_range m_part_spec; // Which parts to scan
@@ -325,6 +325,10 @@ public:
Call to unlock rows not to be updated in transaction
*/
virtual void unlock_row();
+ /*
+ Check if semi consistent read
+ */
+ virtual bool was_semi_consistent_read();
/*
Call to hint about semi consistent read
*/
diff --git a/sql/item.cc b/sql/item.cc
index 7b7c44b4719..b8fcdb832d4 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2628,7 +2628,7 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
if (value.time.year > 9999 || value.time.month > 12 ||
value.time.day > 31 ||
- time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23 ||
+ (time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23) ||
value.time.minute > 59 || value.time.second > 59)
{
char buff[MAX_DATE_STRING_REP_LENGTH];
@@ -4840,8 +4840,8 @@ int Item::save_in_field(Field *field, bool no_conversions)
{
int error;
if (result_type() == STRING_RESULT ||
- result_type() == REAL_RESULT &&
- field->result_type() == STRING_RESULT)
+ (result_type() == REAL_RESULT &&
+ field->result_type() == STRING_RESULT))
{
String *result;
CHARSET_INFO *cs= collation.collation;
@@ -5114,6 +5114,9 @@ int Item_hex_string::save_in_field(Field *field, bool no_conversions)
ulonglong nr;
uint32 length= str_value.length();
+ if (!length)
+ return 1;
+
if (length > 8)
{
nr= field->flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index c5de0b3df08..c6b70440b41 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -394,19 +394,16 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
TABLE *table= field->table;
ulong orig_sql_mode= thd->variables.sql_mode;
enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
- my_bitmap_map *old_write_map;
- my_bitmap_map *old_read_map;
+ my_bitmap_map *old_maps[2];
ulonglong orig_field_val; /* original field value if valid */
- LINT_INIT(old_write_map);
- LINT_INIT(old_read_map);
+ LINT_INIT(old_maps[0]);
+ LINT_INIT(old_maps[1]);
LINT_INIT(orig_field_val);
if (table)
- {
- old_write_map= dbug_tmp_use_all_columns(table, table->write_set);
- old_read_map= dbug_tmp_use_all_columns(table, table->read_set);
- }
+ dbug_tmp_use_all_columns(table, old_maps,
+ table->read_set, table->write_set);
/* For comparison purposes allow invalid dates like 2000-01-32 */
thd->variables.sql_mode= (orig_sql_mode & ~MODE_NO_ZERO_DATE) |
MODE_INVALID_DATES;
@@ -441,10 +438,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
thd->variables.sql_mode= orig_sql_mode;
thd->count_cuted_fields= orig_count_cuted_fields;
if (table)
- {
- dbug_tmp_restore_column_map(table->write_set, old_write_map);
- dbug_tmp_restore_column_map(table->read_set, old_read_map);
- }
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_maps);
}
return result;
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 3acda817d26..83230b10154 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -362,7 +362,10 @@ public:
Item_func_unsigned(Item *a) :Item_func_signed(a) {}
const char *func_name() const { return "cast_as_unsigned"; }
void fix_length_and_dec()
- { max_length=args[0]->max_length; unsigned_flag=1; }
+ {
+ max_length= min(args[0]->max_length, DECIMAL_MAX_PRECISION + 2);
+ unsigned_flag=1;
+ }
longlong val_int();
virtual void print(String *str, enum_query_type query_type);
};
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 4e01728f71c..bb3f4821c4f 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2033,10 +2033,11 @@ Item_func_format::Item_func_format(Item *org, Item *dec)
void Item_func_format::fix_length_and_dec()
{
- collation.set(default_charset());
uint char_length= args[0]->max_length/args[0]->collation.collation->mbmaxlen;
- max_length= ((char_length + (char_length-args[0]->decimals)/3) *
- collation.collation->mbmaxlen);
+ uint max_sep_count= char_length/3 + (decimals ? 1 : 0) + /*sign*/1;
+ collation.set(default_charset());
+ max_length= (char_length + max_sep_count + decimals) *
+ collation.collation->mbmaxlen;
}
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index c2b3b954634..1821136cc9d 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -654,8 +654,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
return TRUE;
// 'item' can be changed during fix_fields
- if (!item->fixed &&
- item->fix_fields(thd, args) ||
+ if ((!item->fixed && item->fix_fields(thd, args)) ||
(item= args[0])->check_cols(1))
return TRUE;
decimals=item->decimals;
@@ -981,8 +980,8 @@ void Item_sum_distinct::fix_length_and_dec()
integers each <= 2^32.
*/
if (table_field_type == MYSQL_TYPE_INT24 ||
- table_field_type >= MYSQL_TYPE_TINY &&
- table_field_type <= MYSQL_TYPE_LONG)
+ (table_field_type >= MYSQL_TYPE_TINY &&
+ table_field_type <= MYSQL_TYPE_LONG))
{
val.traits= Hybrid_type_traits_fast_decimal::instance();
break;
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 843a48ae118..ab20ed17cd7 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1033,12 +1033,25 @@ longlong Item_func_month::val_int()
}
+void Item_func_monthname::fix_length_and_dec()
+{
+ THD* thd= current_thd;
+ CHARSET_INFO *cs= thd->variables.collation_connection;
+ uint32 repertoire= my_charset_repertoire(cs);
+ locale= thd->variables.lc_time_names;
+ collation.set(cs, DERIVATION_COERCIBLE, repertoire);
+ decimals=0;
+ max_length= locale->max_month_name_length * collation.collation->mbmaxlen;
+ maybe_null=1;
+}
+
+
String* Item_func_monthname::val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
const char *month_name;
- uint month= (uint) val_int();
- THD *thd= current_thd;
+ uint month= (uint) val_int();
+ uint err;
if (null_value || !month)
{
@@ -1046,8 +1059,9 @@ String* Item_func_monthname::val_str(String* str)
return (String*) 0;
}
null_value=0;
- month_name= thd->variables.lc_time_names->month_names->type_names[month-1];
- str->set(month_name, strlen(month_name), system_charset_info);
+ month_name= locale->month_names->type_names[month-1];
+ str->copy(month_name, strlen(month_name), &my_charset_utf8_bin,
+ collation.collation, &err);
return str;
}
@@ -1172,19 +1186,32 @@ longlong Item_func_weekday::val_int()
odbc_type) + test(odbc_type);
}
+void Item_func_dayname::fix_length_and_dec()
+{
+ THD* thd= current_thd;
+ CHARSET_INFO *cs= thd->variables.collation_connection;
+ uint32 repertoire= my_charset_repertoire(cs);
+ locale= thd->variables.lc_time_names;
+ collation.set(cs, DERIVATION_COERCIBLE, repertoire);
+ decimals=0;
+ max_length= locale->max_day_name_length * collation.collation->mbmaxlen;
+ maybe_null=1;
+}
+
String* Item_func_dayname::val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
uint weekday=(uint) val_int(); // Always Item_func_daynr()
const char *day_name;
- THD *thd= current_thd;
+ uint err;
if (null_value)
return (String*) 0;
- day_name= thd->variables.lc_time_names->day_names->type_names[weekday];
- str->set(day_name, strlen(day_name), system_charset_info);
+ day_name= locale->day_names->type_names[weekday];
+ str->copy(day_name, strlen(day_name), &my_charset_utf8_bin,
+ collation.collation, &err);
return str;
}
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 99240b1c759..94b02d1eaf6 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -116,18 +116,13 @@ public:
class Item_func_monthname :public Item_func_month
{
+ MY_LOCALE *locale;
public:
Item_func_monthname(Item *a) :Item_func_month(a) {}
const char *func_name() const { return "monthname"; }
String *val_str(String *str);
enum Item_result result_type () const { return STRING_RESULT; }
- void fix_length_and_dec()
- {
- collation.set(&my_charset_bin);
- decimals=0;
- max_length=10*my_charset_bin.mbmaxlen;
- maybe_null=1;
- }
+ void fix_length_and_dec();
bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -291,18 +286,13 @@ public:
class Item_func_dayname :public Item_func_weekday
{
+ MY_LOCALE *locale;
public:
Item_func_dayname(Item *a) :Item_func_weekday(a,0) {}
const char *func_name() const { return "dayname"; }
String *val_str(String *str);
enum Item_result result_type () const { return STRING_RESULT; }
- void fix_length_and_dec()
- {
- collation.set(&my_charset_bin);
- decimals=0;
- max_length=9*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
- }
+ void fix_length_and_dec();
bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
diff --git a/sql/log.cc b/sql/log.cc
index fb8669a5731..b3c3734b593 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -207,6 +207,7 @@ public:
truncate(0);
before_stmt_pos= MY_OFF_T_UNDEF;
trans_log.end_of_file= max_binlog_cache_size;
+ DBUG_ASSERT(empty());
}
Rows_log_event *pending() const
@@ -1377,8 +1378,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT),
FLAGSTR(thd->options, OPTION_BEGIN)));
- thd->binlog_flush_pending_rows_event(TRUE);
-
/*
NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of
only transactional tables. If the transaction contain changes to
@@ -1387,6 +1386,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
*/
if (end_ev != NULL)
{
+ thd->binlog_flush_pending_rows_event(TRUE);
/*
Doing a commit or a rollback including non-transactional tables,
i.e., ending a transaction where we might write the transaction
@@ -1435,6 +1435,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
mysql_bin_log.update_table_map_version();
}
+ DBUG_ASSERT(thd->binlog_get_pending_rows_event() == NULL);
DBUG_RETURN(error);
}
@@ -1466,6 +1467,7 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all)
*/
static int binlog_commit(handlerton *hton, THD *thd, bool all)
{
+ int error= 0;
DBUG_ENTER("binlog_commit");
binlog_trx_data *const trx_data=
(binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
@@ -1478,60 +1480,11 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
}
/*
- Decision table for committing a transaction. The top part, the
- *conditions* represent different cases that can occur, and hte
- bottom part, the *actions*, represent what should be done in that
- particular case.
+ We commit the transaction if:
- Real transaction 'all' was true
+ - We are not in a transaction and committing a statement, or
- Statement in cache There were at least one statement in the
- transaction cache
-
- In transaction We are inside a transaction
-
- Stmt modified non-trans The statement being committed modified a
- non-transactional table
-
- All modified non-trans Some statement before this one in the
- transaction modified a non-transactional
- table
-
-
- ============================= = = = = = = = = = = = = = = = =
- Real transaction N N N N N N N N N N N N N N N N
- Statement in cache N N N N N N N N Y Y Y Y Y Y Y Y
- In transaction N N N N Y Y Y Y N N N N Y Y Y Y
- Stmt modified non-trans N N Y Y N N Y Y N N Y Y N N Y Y
- All modified non-trans N Y N Y N Y N Y N Y N Y N Y N Y
-
- Action: (C)ommit/(A)ccumulate C C - C A C - C - - - - A A - A
- ============================= = = = = = = = = = = = = = = = =
-
-
- ============================= = = = = = = = = = = = = = = = =
- Real transaction Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
- Statement in cache N N N N N N N N Y Y Y Y Y Y Y Y
- In transaction N N N N Y Y Y Y N N N N Y Y Y Y
- Stmt modified non-trans N N Y Y N N Y Y N N Y Y N N Y Y
- All modified non-trans N Y N Y N Y N Y N Y N Y N Y N Y
-
- (C)ommit/(A)ccumulate/(-) - - - - C C - C - - - - C C - C
- ============================= = = = = = = = = = = = = = = = =
-
- In other words, we commit the transaction if and only if both of
- the following are true:
- - We are not in a transaction and committing a statement
-
- - We are in a transaction and one (or more) of the following are
- true:
-
- - A full transaction is committed
-
- OR
-
- - A non-transactional statement is committed and there is
- no statement cached
+ - We are in a transaction and a full transaction is committed
Otherwise, we accumulate the statement
*/
@@ -1544,18 +1497,18 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
YESNO(in_transaction),
YESNO(thd->transaction.all.modified_non_trans_table),
YESNO(thd->transaction.stmt.modified_non_trans_table)));
- if (in_transaction &&
- (all ||
- (!trx_data->at_least_one_stmt &&
- thd->transaction.stmt.modified_non_trans_table)) ||
- !in_transaction && !all)
+ if (!in_transaction || all)
{
Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
- int error= binlog_end_trans(thd, trx_data, &qev, all);
- DBUG_RETURN(error);
+ error= binlog_end_trans(thd, trx_data, &qev, all);
+ goto end;
}
- DBUG_RETURN(0);
+
+end:
+ if (!all)
+ trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt commit
+ DBUG_RETURN(error);
}
/**
@@ -1615,6 +1568,8 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
*/
error= binlog_end_trans(thd, trx_data, 0, all);
}
+ if (!all)
+ trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt rollback
DBUG_RETURN(error);
}
@@ -2359,6 +2314,7 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG()
*/
index_file_name[0] = 0;
bzero((char*) &index_file, sizeof(index_file));
+ bzero((char*) &purge_temp, sizeof(purge_temp));
}
/* this is called only once */
@@ -2953,6 +2909,7 @@ err:
int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
{
int error;
+ char *to_purge_if_included= NULL;
DBUG_ENTER("purge_first_log");
DBUG_ASSERT(is_open());
@@ -2960,36 +2917,20 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
DBUG_ASSERT(!strcmp(rli->linfo.log_file_name,rli->event_relay_log_name));
pthread_mutex_lock(&LOCK_index);
- pthread_mutex_lock(&rli->log_space_lock);
- rli->relay_log.purge_logs(rli->group_relay_log_name, included,
- 0, 0, &rli->log_space_total);
- // Tell the I/O thread to take the relay_log_space_limit into account
- rli->ignore_log_space_limit= 0;
- pthread_mutex_unlock(&rli->log_space_lock);
+ to_purge_if_included= my_strdup(rli->group_relay_log_name, MYF(0));
- /*
- Ok to broadcast after the critical region as there is no risk of
- the mutex being destroyed by this thread later - this helps save
- context switches
- */
- pthread_cond_broadcast(&rli->log_space_cond);
-
/*
Read the next log file name from the index file and pass it back to
- the caller
- If included is true, we want the first relay log;
- otherwise we want the one after event_relay_log_name.
+ the caller.
*/
- if ((included && (error=find_log_pos(&rli->linfo, NullS, 0))) ||
- (!included &&
- ((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)) ||
- (error=find_next_log(&rli->linfo, 0)))))
+ if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)) ||
+ (error=find_next_log(&rli->linfo, 0)))
{
char buff[22];
sql_print_error("next log error: %d offset: %s log: %s included: %d",
error,
llstr(rli->linfo.index_file_offset,buff),
- rli->group_relay_log_name,
+ rli->event_relay_log_name,
included);
goto err;
}
@@ -3017,7 +2958,42 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
/* Store where we are in the new file for the execution thread */
flush_relay_log_info(rli);
+ DBUG_EXECUTE_IF("crash_before_purge_logs", abort(););
+
+ pthread_mutex_lock(&rli->log_space_lock);
+ rli->relay_log.purge_logs(to_purge_if_included, included,
+ 0, 0, &rli->log_space_total);
+ // Tell the I/O thread to take the relay_log_space_limit into account
+ rli->ignore_log_space_limit= 0;
+ pthread_mutex_unlock(&rli->log_space_lock);
+
+ /*
+ Ok to broadcast after the critical region as there is no risk of
+ the mutex being destroyed by this thread later - this helps save
+ context switches
+ */
+ pthread_cond_broadcast(&rli->log_space_cond);
+
+ /*
+ * Need to update the log pos because purge logs has been called
+ * after fetching initially the log pos at the begining of the method.
+ */
+ if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)))
+ {
+ char buff[22];
+ sql_print_error("next log error: %d offset: %s log: %s included: %d",
+ error,
+ llstr(rli->linfo.index_file_offset,buff),
+ rli->group_relay_log_name,
+ included);
+ goto err;
+ }
+
+ /* If included was passed, rli->linfo should be the first entry. */
+ DBUG_ASSERT(!included || rli->linfo.index_file_start_offset == 0);
+
err:
+ my_free(to_purge_if_included, MYF(0));
pthread_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);
}
@@ -3068,7 +3044,6 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
ulonglong *decrease_log_space)
{
int error;
- int ret = 0;
bool exit_loop= 0;
LOG_INFO log_info;
THD *thd= current_thd;
@@ -3077,8 +3052,36 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
if (need_mutex)
pthread_mutex_lock(&LOCK_index);
- if ((error=find_log_pos(&log_info, to_log, 0 /*no mutex*/)))
+ if ((error=find_log_pos(&log_info, to_log, 0 /*no mutex*/)))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs was called with file %s not "
+ "listed in the index.", to_log);
goto err;
+ }
+
+ /*
+ For crash recovery reasons the index needs to be updated before
+ any files are deleted. Move files to be deleted into a temp file
+ to be processed after the index is updated.
+ */
+ if (!my_b_inited(&purge_temp))
+ {
+ if ((error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX,
+ DISK_BUFFER_SIZE, MYF(MY_WME))))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs failed to open purge_temp");
+ goto err;
+ }
+ }
+ else
+ {
+ if ((error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1)))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs failed to reinit purge_temp "
+ "for write");
+ goto err;
+ }
+ }
/*
File name exists in index file; delete until we find this file
@@ -3089,6 +3092,61 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
while ((strcmp(to_log,log_info.log_file_name) || (exit_loop=included)) &&
!log_in_use(log_info.log_file_name))
{
+ if ((error=my_b_write(&purge_temp, (const uchar*)log_info.log_file_name,
+ strlen(log_info.log_file_name))) ||
+ (error=my_b_write(&purge_temp, (const uchar*)"\n", 1)))
+ {
+ sql_print_error("MYSQL_LOG::purge_logs failed to copy %s to purge_temp",
+ log_info.log_file_name);
+ goto err;
+ }
+
+ if (find_next_log(&log_info, 0) || exit_loop)
+ break;
+ }
+
+ /* We know how many files to delete. Update index file. */
+ if ((error=update_log_index(&log_info, need_update_threads)))
+ {
+ sql_print_error("MSYQL_LOG::purge_logs failed to update the index file");
+ goto err;
+ }
+
+ DBUG_EXECUTE_IF("crash_after_update_index", abort(););
+
+ /* Switch purge_temp for read. */
+ if ((error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0)))
+ {
+ sql_print_error("MSYQL_LOG::purge_logs failed to reinit purge_temp "
+ "for read");
+ goto err;
+ }
+
+ /* Read each entry from purge_temp and delete the file. */
+ for (;;)
+ {
+ uint length;
+
+ if ((length=my_b_gets(&purge_temp, log_info.log_file_name,
+ FN_REFLEN)) <= 1)
+ {
+ if (purge_temp.error)
+ {
+ error= purge_temp.error;
+ sql_print_error("MSYQL_LOG::purge_logs error %d reading from "
+ "purge_temp", error);
+ goto err;
+ }
+
+ /* Reached EOF */
+ break;
+ }
+
+ /* Get rid of the trailing '\n' */
+ log_info.log_file_name[length-1]= 0;
+
+ ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
+
MY_STAT s;
if (!my_stat(log_info.log_file_name, &s, MYF(0)))
{
@@ -3189,23 +3247,10 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
}
}
}
-
- ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
-
- if (find_next_log(&log_info, 0) || exit_loop)
- break;
- }
-
- /*
- If we get killed -9 here, the sysadmin would have to edit
- the log index file after restart - otherwise, this should be safe
- */
- error= update_log_index(&log_info, need_update_threads);
- if (error == 0) {
- error = ret;
}
err:
+ close_cached_file(&purge_temp);
if (need_mutex)
pthread_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);
@@ -3216,7 +3261,7 @@ err:
index file.
@param thd Thread pointer
- @param before_date Delete all log files before given date.
+ @param purge_time Delete all log files before given date.
@note
If any of the logs before the deleted one is in use,
@@ -3233,6 +3278,7 @@ err:
int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
{
int error;
+ char to_log[FN_REFLEN];
LOG_INFO log_info;
MY_STAT stat_area;
THD *thd= current_thd;
@@ -3240,12 +3286,8 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
DBUG_ENTER("purge_logs_before_date");
pthread_mutex_lock(&LOCK_index);
+ to_log[0]= 0;
- /*
- Delete until we find curren file
- or a file that is used or a file
- that is older than purge_time.
- */
if ((error=find_log_pos(&log_info, NullS, 0 /*no mutex*/)))
goto err;
@@ -3295,55 +3337,18 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
}
else
{
- if (stat_area.st_mtime >= purge_time)
+ if (stat_area.st_mtime < purge_time)
+ strmake(to_log,
+ log_info.log_file_name,
+ sizeof(log_info.log_file_name));
+ else
break;
- if (my_delete(log_info.log_file_name, MYF(0)))
- {
- if (my_errno == ENOENT)
- {
- /* It's not fatal even if we can't delete a log file */
- if (thd)
- {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
- log_info.log_file_name);
- }
- sql_print_information("Failed to delete file '%s'",
- log_info.log_file_name);
- my_errno= 0;
- }
- else
- {
- if (thd)
- {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_BINLOG_PURGE_FATAL_ERR,
- "a problem with deleting %s; "
- "consider examining correspondence "
- "of your binlog index file "
- "to the actual binlog files",
- log_info.log_file_name);
- }
- else
- {
- sql_print_information("Failed to delete log file '%s'",
- log_info.log_file_name);
- }
- error= LOG_INFO_FATAL;
- goto err;
- }
- }
- ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
}
if (find_next_log(&log_info, 0))
break;
}
- /*
- If we get killed -9 here, the sysadmin would have to edit
- the log index file after restart - otherwise, this should be safe
- */
- error= update_log_index(&log_info, 1);
+ error= (to_log[0] ? purge_logs(to_log, 1, 0, 1, (ulonglong *) 0) : 0);
err:
pthread_mutex_unlock(&LOCK_index);
diff --git a/sql/log.h b/sql/log.h
index 891134a9762..6346f38a279 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -233,6 +233,13 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
pthread_cond_t update_cond;
ulonglong bytes_written;
IO_CACHE index_file;
+ /*
+ purge_temp is a temp file used in purge_logs so that the index file
+ can be updated before deleting files from disk, yielding better crash
+ recovery. It is created on demand the first time purge_logs is called
+ and then reused for subsequent calls. It is cleaned up in cleanup().
+ */
+ IO_CACHE purge_temp;
char index_file_name[FN_REFLEN];
/*
The max size before rotation (usable only if log_type == LOG_BIN: binary
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 0d03593946d..cd8fa0c3a85 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2680,7 +2680,7 @@ void Query_log_event::print_query_header(IO_CACHE* file,
if (!(flags & LOG_EVENT_SUPPRESS_USE_F) && db)
{
- if (different_db= memcmp(print_event_info->db, db, db_len + 1))
+ if ((different_db= memcmp(print_event_info->db, db, db_len + 1)))
memcpy(print_event_info->db, db, db_len + 1);
if (db[0] && different_db)
my_b_printf(file, "use %s%s\n", db, print_event_info->delimiter);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 1d5c08c7c56..ac8a88f42cb 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -148,15 +148,20 @@ typedef struct my_locale_st
TYPELIB *ab_month_names;
TYPELIB *day_names;
TYPELIB *ab_day_names;
+ uint max_month_name_length;
+ uint max_day_name_length;
#ifdef __cplusplus
my_locale_st(uint number_par,
const char *name_par, const char *descr_par, bool is_ascii_par,
TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
- TYPELIB *day_names_par, TYPELIB *ab_day_names_par) :
+ TYPELIB *day_names_par, TYPELIB *ab_day_names_par,
+ uint max_month_name_length_par, uint max_day_name_length_par) :
number(number_par),
name(name_par), description(descr_par), is_ascii(is_ascii_par),
month_names(month_names_par), ab_month_names(ab_month_names_par),
- day_names(day_names_par), ab_day_names(ab_day_names_par)
+ day_names(day_names_par), ab_day_names(ab_day_names_par),
+ max_month_name_length(max_month_name_length_par),
+ max_day_name_length(max_day_name_length_par)
{}
#endif
} MY_LOCALE;
@@ -1768,10 +1773,9 @@ int mysql_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list,
int write_record(THD *thd, TABLE *table, COPY_INFO *info);
/* sql_manager.cc */
-extern ulong volatile manager_status;
-extern bool volatile manager_thread_in_use, mqh_used;
-extern pthread_t manager_thread;
-pthread_handler_t handle_manager(void *arg);
+extern bool volatile mqh_used;
+void start_handle_manager();
+void stop_handle_manager();
bool mysql_manager_submit(void (*action)());
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e6980318a66..b7f9457da3d 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -227,6 +227,12 @@ extern "C" int gethostname(char *name, int namelen);
extern "C" sig_handler handle_segfault(int sig);
+#if defined(__linux__)
+#define ENABLE_TEMP_POOL 1
+#else
+#define ENABLE_TEMP_TOOL 0
+#endif
+
/* Constants */
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
@@ -784,16 +790,6 @@ static void close_connections(void)
kill_cached_threads++;
flush_thread_cache();
- /* kill flush thread */
- (void) pthread_mutex_lock(&LOCK_manager);
- if (manager_thread_in_use)
- {
- DBUG_PRINT("quit", ("killing manager thread: 0x%lx",
- (ulong)manager_thread));
- (void) pthread_cond_signal(&COND_manager);
- }
- (void) pthread_mutex_unlock(&LOCK_manager);
-
/* kill connection thread */
#if !defined(__WIN__) && !defined(__NETWARE__)
DBUG_PRINT("quit", ("waiting for select thread: 0x%lx",
@@ -1196,6 +1192,7 @@ void clean_up(bool print_message)
if (cleanup_done++)
return; /* purecov: inspected */
+ stop_handle_manager();
release_ddl_log();
/*
@@ -3407,8 +3404,13 @@ static int init_common_variables(const char *conf_file_name, int argc,
sys_var_slow_log_path.value= my_strdup(s, MYF(0));
sys_var_slow_log_path.value_length= strlen(s);
+#if (ENABLE_TEMP_POOL)
if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
return 1;
+#else
+ use_temp_pool= 0;
+#endif
+
if (my_database_names_init())
return 1;
@@ -4038,17 +4040,6 @@ server.");
#ifndef EMBEDDED_LIBRARY
-static void create_maintenance_thread()
-{
- if (flush_time && flush_time != ~(ulong) 0L)
- {
- pthread_t hThread;
- if (pthread_create(&hThread,&connection_attrib,handle_manager,0))
- sql_print_warning("Can't create thread to manage maintenance");
- }
-}
-
-
static void create_shutdown_thread()
{
#ifdef __WIN__
@@ -4138,6 +4129,44 @@ void decrement_handler_count()
#ifndef EMBEDDED_LIBRARY
+#ifndef DBUG_OFF
+/*
+ Debugging helper function to keep the locale database
+ (see sql_locale.cc) and max_month_name_length and
+ max_day_name_length variable values in consistent state.
+*/
+static void test_lc_time_sz()
+{
+ DBUG_ENTER("test_lc_time_sz");
+ for (MY_LOCALE **loc= my_locales; *loc; loc++)
+ {
+ uint max_month_len= 0;
+ uint max_day_len = 0;
+ for (const char **month= (*loc)->month_names->type_names; *month; month++)
+ {
+ set_if_bigger(max_month_len,
+ my_numchars_mb(&my_charset_utf8_general_ci,
+ *month, *month + strlen(*month)));
+ }
+ for (const char **day= (*loc)->day_names->type_names; *day; day++)
+ {
+ set_if_bigger(max_day_len,
+ my_numchars_mb(&my_charset_utf8_general_ci,
+ *day, *day + strlen(*day)));
+ }
+ if ((*loc)->max_month_name_length != max_month_len ||
+ (*loc)->max_day_name_length != max_day_len)
+ {
+ DBUG_PRINT("Wrong max day name(or month name) length for locale:",
+ ("%s", (*loc)->name));
+ DBUG_ASSERT(0);
+ }
+ }
+ DBUG_VOID_RETURN;
+}
+#endif//DBUG_OFF
+
+
#ifdef __WIN__
int win_main(int argc, char **argv)
#else
@@ -4238,6 +4267,10 @@ int main(int argc, char **argv)
openlog(libwrapName, LOG_PID, LOG_AUTH);
#endif
+#ifndef DBUG_OFF
+ test_lc_time_sz();
+#endif
+
/*
We have enough space for fiddling with the argv, continue
*/
@@ -4363,7 +4396,7 @@ we force server id to 2, but this MySQL server will not act as a slave.");
execute_ddl_log_recovery();
create_shutdown_thread();
- create_maintenance_thread();
+ start_handle_manager();
if (Events::init(opt_noacl))
unireg_abort(1);
@@ -6317,9 +6350,14 @@ log and this option does nothing anymore.",
(uchar**) &opt_tc_heuristic_recover, (uchar**) &opt_tc_heuristic_recover,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"temp-pool", OPT_TEMP_POOL,
+#if (ENABLE_TEMP_POOL)
"Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
+#else
+ "This option is ignored on this OS.",
+#endif
(uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
+
{"timed_mutexes", OPT_TIMED_MUTEXES,
"Specify whether to time mutexes (only InnoDB mutexes are currently supported)",
(uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
@@ -6871,13 +6909,15 @@ The minimum value for this variable is 4096.",
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-static int show_question(THD *thd, SHOW_VAR *var, char *buff)
+
+static int show_queries(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_LONGLONG;
var->value= (char *)&thd->query_id;
return 0;
}
+
static int show_net_compression(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_MY_BOOL;
@@ -7293,7 +7333,8 @@ SHOW_VAR status_vars[]= {
{"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_NOFLUSH},
{"Qcache_total_blocks", (char*) &query_cache.total_blocks, SHOW_LONG_NOFLUSH},
#endif /*HAVE_QUERY_CACHE*/
- {"Questions", (char*) &show_question, SHOW_FUNC},
+ {"Queries", (char*) &show_queries, SHOW_FUNC},
+ {"Questions", (char*) offsetof(STATUS_VAR, questions), SHOW_LONG_STATUS},
#ifdef HAVE_REPLICATION
{"Rpl_status", (char*) &show_rpl_status, SHOW_FUNC},
#endif
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index bafc368e415..5921199f73f 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1245,6 +1245,9 @@ QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT()
quick->file= NULL;
quick_selects.delete_elements();
delete pk_quick_select;
+ /* It's ok to call the next two even if they are already deinitialized */
+ end_read_record(&read_record);
+ free_io_cache(head);
free_root(&alloc,MYF(0));
DBUG_VOID_RETURN;
}
@@ -2668,7 +2671,7 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
PART_PRUNE_PARAM prune_param;
MEM_ROOT alloc;
RANGE_OPT_PARAM *range_par= &prune_param.range_param;
- my_bitmap_map *old_read_set, *old_write_set;
+ my_bitmap_map *old_sets[2];
prune_param.part_info= part_info;
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
@@ -2682,8 +2685,8 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
DBUG_RETURN(FALSE);
}
- old_write_set= dbug_tmp_use_all_columns(table, table->write_set);
- old_read_set= dbug_tmp_use_all_columns(table, table->read_set);
+ dbug_tmp_use_all_columns(table, old_sets,
+ table->read_set, table->write_set);
range_par->thd= thd;
range_par->table= table;
/* range_par->cond doesn't need initialization */
@@ -2773,8 +2776,7 @@ all_used:
retval= FALSE; // some partitions are used
mark_all_partitions_as_used(prune_param.part_info);
end:
- dbug_tmp_restore_column_map(table->write_set, old_write_set);
- dbug_tmp_restore_column_map(table->read_set, old_read_set);
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
thd->no_errors=0;
thd->mem_root= range_par->old_root;
free_root(&alloc,MYF(0)); // Return memory & allocator
@@ -11145,9 +11147,9 @@ print_key(KEY_PART *key_part, const uchar *key, uint used_length)
String tmp(buff,sizeof(buff),&my_charset_bin);
uint store_length;
TABLE *table= key_part->field->table;
- my_bitmap_map *old_write_set, *old_read_set;
- old_write_set= dbug_tmp_use_all_columns(table, table->write_set);
- old_read_set= dbug_tmp_use_all_columns(table, table->read_set);
+ my_bitmap_map *old_sets[2];
+
+ dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set);
for (; key < key_end; key+=store_length, key_part++)
{
@@ -11173,8 +11175,7 @@ print_key(KEY_PART *key_part, const uchar *key, uint used_length)
if (key+store_length < key_end)
fputc('/',DBUG_FILE);
}
- dbug_tmp_restore_column_map(table->write_set, old_write_set);
- dbug_tmp_restore_column_map(table->read_set, old_read_set);
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
}
@@ -11182,18 +11183,16 @@ static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg)
{
char buf[MAX_KEY/8+1];
TABLE *table;
- my_bitmap_map *old_read_map, *old_write_map;
+ my_bitmap_map *old_sets[2];
DBUG_ENTER("print_quick");
if (!quick)
DBUG_VOID_RETURN;
DBUG_LOCK_FILE;
table= quick->head;
- old_read_map= dbug_tmp_use_all_columns(table, table->read_set);
- old_write_map= dbug_tmp_use_all_columns(table, table->write_set);
+ dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set);
quick->dbug_dump(0, TRUE);
- dbug_tmp_restore_column_map(table->read_set, old_read_map);
- dbug_tmp_restore_column_map(table->write_set, old_write_map);
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
fprintf(DBUG_FILE,"other_keys: 0x%s:\n", needed_reg->print(buf));
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 02f2c9b0ab1..e2027d3571e 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -867,6 +867,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
if (part_type != HASH_PARTITION || !list_of_part_fields)
{
+ DBUG_ASSERT(part_expr);
err= part_expr->walk(&Item::check_partition_func_processor, 0,
NULL);
if (!err && is_sub_partitioned() && !list_of_subpart_fields)
diff --git a/sql/set_var.cc b/sql/set_var.cc
index a371c1113ef..00b7a6d7e76 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -3548,6 +3548,7 @@ int set_var_password::check(THD *thd)
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (!user->host.str)
{
+ DBUG_ASSERT(thd->security_ctx->priv_host);
if (*thd->security_ctx->priv_host != 0)
{
user->host.str= (char *) thd->security_ctx->priv_host;
@@ -3559,6 +3560,12 @@ int set_var_password::check(THD *thd)
user->host.length= 1;
}
}
+ if (!user->user.str)
+ {
+ DBUG_ASSERT(thd->security_ctx->priv_user);
+ user->user.str= (char *) thd->security_ctx->priv_user;
+ user->user.length= strlen(thd->security_ctx->priv_user);
+ }
/* Returns 1 as the function sends error to client */
return check_change_password(thd, user->host.str, user->user.str,
password, strlen(password)) ? 1 : 0;
diff --git a/sql/spatial.h b/sql/spatial.h
index f806861290e..69a1f24506e 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -116,12 +116,12 @@ struct MBR
int touches(const MBR *mbr)
{
/* The following should be safe, even if we compare doubles */
- return ((((mbr->xmin == xmax) || (mbr->xmax == xmin)) &&
- ((mbr->ymin >= ymin) && (mbr->ymin <= ymax) ||
- (mbr->ymax >= ymin) && (mbr->ymax <= ymax))) ||
+ return ((((mbr->xmin == xmax) || (mbr->xmax == xmin)) &&
+ (((mbr->ymin >= ymin) && (mbr->ymin <= ymax)) ||
+ ((mbr->ymax >= ymin) && (mbr->ymax <= ymax)))) ||
(((mbr->ymin == ymax) || (mbr->ymax == ymin)) &&
- ((mbr->xmin >= xmin) && (mbr->xmin <= xmax) ||
- (mbr->xmax >= xmin) && (mbr->xmax <= xmax))));
+ (((mbr->xmin >= xmin) && (mbr->xmin <= xmax)) ||
+ ((mbr->xmax >= xmin) && (mbr->xmax <= xmax)))));
}
int within(const MBR *mbr)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 0043ef09229..bd940608a07 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -6304,10 +6304,12 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr)
}
-void update_schema_privilege(TABLE *table, char *buff, const char* db,
- const char* t_name, const char* column,
- uint col_length, const char *priv,
- uint priv_length, const char* is_grantable)
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+static bool update_schema_privilege(THD *thd, TABLE *table, char *buff,
+ const char* db, const char* t_name,
+ const char* column, uint col_length,
+ const char *priv, uint priv_length,
+ const char* is_grantable)
{
int i= 2;
CHARSET_INFO *cs= system_charset_info;
@@ -6320,14 +6322,16 @@ void update_schema_privilege(TABLE *table, char *buff, const char* db,
if (column)
table->field[i++]->store(column, col_length, cs);
table->field[i++]->store(priv, priv_length, cs);
- table->field[i]->store(is_grantable, (uint) strlen(is_grantable), cs);
- table->file->ha_write_row(table->record[0]);
+ table->field[i]->store(is_grantable, strlen(is_grantable), cs);
+ return schema_table_store_record(thd, table);
}
+#endif
int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint counter;
ACL_USER *acl_user;
ulong want_access;
@@ -6361,8 +6365,14 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
strxmov(buff,"'",user,"'@'",host,"'",NullS);
if (!(want_access & ~GRANT_ACL))
- update_schema_privilege(table, buff, 0, 0, 0, 0,
- STRING_WITH_LEN("USAGE"), is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, 0, 0, 0, 0,
+ STRING_WITH_LEN("USAGE"), is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
else
{
uint priv_id;
@@ -6370,16 +6380,22 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
for (priv_id=0, j = SELECT_ACL;j <= GLOBAL_ACLS; priv_id++,j <<= 1)
{
if (test_access & j)
- update_schema_privilege(table, buff, 0, 0, 0, 0,
- command_array[priv_id],
- command_lengths[priv_id], is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, 0, 0, 0, 0,
+ command_array[priv_id],
+ command_lengths[priv_id], is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
}
-
+err:
pthread_mutex_unlock(&acl_cache->lock);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return(0);
#endif
@@ -6389,6 +6405,7 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint counter;
ACL_DB *acl_db;
ulong want_access;
@@ -6426,24 +6443,36 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
}
strxmov(buff,"'",user,"'@'",host,"'",NullS);
if (!(want_access & ~GRANT_ACL))
- update_schema_privilege(table, buff, acl_db->db, 0, 0,
- 0, STRING_WITH_LEN("USAGE"), is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, acl_db->db, 0, 0,
+ 0, STRING_WITH_LEN("USAGE"), is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
else
{
int cnt;
ulong j,test_access= want_access & ~GRANT_ACL;
for (cnt=0, j = SELECT_ACL; j <= DB_ACLS; cnt++,j <<= 1)
if (test_access & j)
- update_schema_privilege(table, buff, acl_db->db, 0, 0, 0,
- command_array[cnt], command_lengths[cnt],
- is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, acl_db->db, 0, 0, 0,
+ command_array[cnt], command_lengths[cnt],
+ is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
}
-
+err:
pthread_mutex_unlock(&acl_cache->lock);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return (0);
#endif
@@ -6453,6 +6482,7 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint index;
char buff[100];
TABLE *table= tables->table;
@@ -6492,8 +6522,15 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
strxmov(buff, "'", user, "'@'", host, "'", NullS);
if (!test_access)
- update_schema_privilege(table, buff, grant_table->db, grant_table->tname,
- 0, 0, STRING_WITH_LEN("USAGE"), is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, grant_table->db,
+ grant_table->tname, 0, 0,
+ STRING_WITH_LEN("USAGE"), is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
else
{
ulong j;
@@ -6501,17 +6538,24 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
for (cnt= 0, j= SELECT_ACL; j <= TABLE_ACLS; cnt++, j<<= 1)
{
if (test_access & j)
- update_schema_privilege(table, buff, grant_table->db,
- grant_table->tname, 0, 0, command_array[cnt],
- command_lengths[cnt], is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, grant_table->db,
+ grant_table->tname, 0, 0,
+ command_array[cnt],
+ command_lengths[cnt], is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
- }
+ }
}
-
+err:
rw_unlock(&LOCK_grant);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return (0);
#endif
@@ -6521,6 +6565,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ int error= 0;
uint index;
char buff[100];
TABLE *table= tables->table;
@@ -6570,22 +6615,28 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
GRANT_COLUMN *grant_column = (GRANT_COLUMN*)
hash_element(&grant_table->hash_columns,col_index);
if ((grant_column->rights & j) && (table_access & j))
- update_schema_privilege(table, buff, grant_table->db,
- grant_table->tname,
- grant_column->column,
- grant_column->key_length,
- command_array[cnt],
- command_lengths[cnt], is_grantable);
+ {
+ if (update_schema_privilege(thd, table, buff, grant_table->db,
+ grant_table->tname,
+ grant_column->column,
+ grant_column->key_length,
+ command_array[cnt],
+ command_lengths[cnt], is_grantable))
+ {
+ error= 1;
+ goto err;
+ }
+ }
}
}
}
}
}
}
-
+err:
rw_unlock(&LOCK_grant);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
#else
return (0);
#endif
diff --git a/sql/sql_class.h b/sql/sql_class.h
index f5cf31d1030..96b73ea76a2 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -456,8 +456,15 @@ typedef struct system_status_var
ulong com_stmt_fetch;
ulong com_stmt_reset;
ulong com_stmt_close;
-
/*
+ Number of statements sent from the client
+ */
+ ulong questions;
+ /*
+ IMPORTANT!
+ SEE last_system_status_var DEFINITION BELOW.
+ Below 'last_system_status_var' are all variables which doesn't make any
+ sense to add to the /global/ status variable counter.
Status variables which it does not make sense to add to
global status variable counter
*/
@@ -470,7 +477,7 @@ typedef struct system_status_var
counter
*/
-#define last_system_status_var com_stmt_close
+#define last_system_status_var questions
void mark_transaction_to_rollback(THD *thd, bool all);
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 7c530cb9013..6f61dc40f66 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -85,6 +85,7 @@ class Materialized_cursor: public Server_side_cursor
List- item_list;
ulong fetch_limit;
ulong fetch_count;
+ bool is_rnd_inited;
public:
Materialized_cursor(select_result *result, TABLE *table);
@@ -190,7 +191,11 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
such command is SHOW VARIABLES or SHOW STATUS.
*/
if (rc)
+ {
+ if (result_materialize->materialized_cursor)
+ delete result_materialize->materialized_cursor;
goto err_open;
+ }
if (sensitive_cursor->is_open())
{
@@ -542,7 +547,8 @@ Materialized_cursor::Materialized_cursor(select_result *result_arg,
:Server_side_cursor(&table_arg->mem_root, result_arg),
table(table_arg),
fetch_limit(0),
- fetch_count(0)
+ fetch_count(0),
+ is_rnd_inited(0)
{
fake_unit.init_query();
fake_unit.thd= table->in_use;
@@ -599,11 +605,12 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
THD *thd= fake_unit.thd;
int rc;
Query_arena backup_arena;
-
thd->set_n_backup_active_arena(this, &backup_arena);
/* Create a list of fields and start sequential scan */
- rc= (result->prepare(item_list, &fake_unit) ||
- table->file->ha_rnd_init(TRUE));
+ rc= result->prepare(item_list, &fake_unit);
+ if (!rc && !(rc= table->file->ha_rnd_init(TRUE)))
+ is_rnd_inited= 1;
+
thd->restore_active_arena(this, &backup_arena);
if (rc == 0)
{
@@ -678,7 +685,8 @@ void Materialized_cursor::close()
{
/* Free item_list items */
free_items();
- (void) table->file->ha_rnd_end();
+ if (is_rnd_inited)
+ (void) table->file->ha_rnd_end();
/*
We need to grab table->mem_root to prevent free_tmp_table from freeing:
the cursor object was allocated in this memory.
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 983d53a041d..7d0a4d18d34 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2002,7 +2002,7 @@ void st_select_lex::print_limit(THD *thd,
item->substype() == Item_subselect::ALL_SUBS))
{
DBUG_ASSERT(!item->fixed ||
- select_limit->val_int() == LL(1) && offset_limit == 0);
+ (select_limit->val_int() == LL(1) && offset_limit == 0));
return;
}
diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc
index 4e61c664106..3def9864c29 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -49,7 +49,9 @@ MY_LOCALE my_locale_ar_AE
&my_locale_typelib_month_names_ar_AE,
&my_locale_typelib_ab_month_names_ar_AE,
&my_locale_typelib_day_names_ar_AE,
- &my_locale_typelib_ab_day_names_ar_AE
+ &my_locale_typelib_ab_day_names_ar_AE,
+ 6,
+ 8
);
/***** LOCALE END ar_AE *****/
@@ -79,7 +81,9 @@ MY_LOCALE my_locale_ar_BH
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_BH *****/
@@ -109,7 +113,9 @@ MY_LOCALE my_locale_ar_JO
&my_locale_typelib_month_names_ar_JO,
&my_locale_typelib_ab_month_names_ar_JO,
&my_locale_typelib_day_names_ar_JO,
- &my_locale_typelib_ab_day_names_ar_JO
+ &my_locale_typelib_ab_day_names_ar_JO,
+ 12,
+ 8
);
/***** LOCALE END ar_JO *****/
@@ -139,7 +145,9 @@ MY_LOCALE my_locale_ar_SA
&my_locale_typelib_month_names_ar_SA,
&my_locale_typelib_ab_month_names_ar_SA,
&my_locale_typelib_day_names_ar_SA,
- &my_locale_typelib_ab_day_names_ar_SA
+ &my_locale_typelib_ab_day_names_ar_SA,
+ 12,
+ 8
);
/***** LOCALE END ar_SA *****/
@@ -169,7 +177,9 @@ MY_LOCALE my_locale_ar_SY
&my_locale_typelib_month_names_ar_SY,
&my_locale_typelib_ab_month_names_ar_SY,
&my_locale_typelib_day_names_ar_SY,
- &my_locale_typelib_ab_day_names_ar_SY
+ &my_locale_typelib_ab_day_names_ar_SY,
+ 12,
+ 8
);
/***** LOCALE END ar_SY *****/
@@ -199,7 +209,9 @@ MY_LOCALE my_locale_be_BY
&my_locale_typelib_month_names_be_BY,
&my_locale_typelib_ab_month_names_be_BY,
&my_locale_typelib_day_names_be_BY,
- &my_locale_typelib_ab_day_names_be_BY
+ &my_locale_typelib_ab_day_names_be_BY,
+ 10,
+ 10
);
/***** LOCALE END be_BY *****/
@@ -229,7 +241,9 @@ MY_LOCALE my_locale_bg_BG
&my_locale_typelib_month_names_bg_BG,
&my_locale_typelib_ab_month_names_bg_BG,
&my_locale_typelib_day_names_bg_BG,
- &my_locale_typelib_ab_day_names_bg_BG
+ &my_locale_typelib_ab_day_names_bg_BG,
+ 9,
+ 10
);
/***** LOCALE END bg_BG *****/
@@ -259,7 +273,9 @@ MY_LOCALE my_locale_ca_ES
&my_locale_typelib_month_names_ca_ES,
&my_locale_typelib_ab_month_names_ca_ES,
&my_locale_typelib_day_names_ca_ES,
- &my_locale_typelib_ab_day_names_ca_ES
+ &my_locale_typelib_ab_day_names_ca_ES,
+ 8,
+ 9
);
/***** LOCALE END ca_ES *****/
@@ -289,7 +305,9 @@ MY_LOCALE my_locale_cs_CZ
&my_locale_typelib_month_names_cs_CZ,
&my_locale_typelib_ab_month_names_cs_CZ,
&my_locale_typelib_day_names_cs_CZ,
- &my_locale_typelib_ab_day_names_cs_CZ
+ &my_locale_typelib_ab_day_names_cs_CZ,
+ 8,
+ 7
);
/***** LOCALE END cs_CZ *****/
@@ -319,7 +337,9 @@ MY_LOCALE my_locale_da_DK
&my_locale_typelib_month_names_da_DK,
&my_locale_typelib_ab_month_names_da_DK,
&my_locale_typelib_day_names_da_DK,
- &my_locale_typelib_ab_day_names_da_DK
+ &my_locale_typelib_ab_day_names_da_DK,
+ 9,
+ 7
);
/***** LOCALE END da_DK *****/
@@ -349,7 +369,9 @@ MY_LOCALE my_locale_de_AT
&my_locale_typelib_month_names_de_AT,
&my_locale_typelib_ab_month_names_de_AT,
&my_locale_typelib_day_names_de_AT,
- &my_locale_typelib_ab_day_names_de_AT
+ &my_locale_typelib_ab_day_names_de_AT,
+ 9,
+ 10
);
/***** LOCALE END de_AT *****/
@@ -379,7 +401,9 @@ MY_LOCALE my_locale_de_DE
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_DE *****/
@@ -409,7 +433,9 @@ MY_LOCALE my_locale_en_US
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_US *****/
@@ -439,7 +465,9 @@ MY_LOCALE my_locale_es_ES
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_ES *****/
@@ -469,7 +497,9 @@ MY_LOCALE my_locale_et_EE
&my_locale_typelib_month_names_et_EE,
&my_locale_typelib_ab_month_names_et_EE,
&my_locale_typelib_day_names_et_EE,
- &my_locale_typelib_ab_day_names_et_EE
+ &my_locale_typelib_ab_day_names_et_EE,
+ 9,
+ 9
);
/***** LOCALE END et_EE *****/
@@ -499,7 +529,9 @@ MY_LOCALE my_locale_eu_ES
&my_locale_typelib_month_names_eu_ES,
&my_locale_typelib_ab_month_names_eu_ES,
&my_locale_typelib_day_names_eu_ES,
- &my_locale_typelib_ab_day_names_eu_ES
+ &my_locale_typelib_ab_day_names_eu_ES,
+ 9,
+ 10
);
/***** LOCALE END eu_ES *****/
@@ -529,7 +561,9 @@ MY_LOCALE my_locale_fi_FI
&my_locale_typelib_month_names_fi_FI,
&my_locale_typelib_ab_month_names_fi_FI,
&my_locale_typelib_day_names_fi_FI,
- &my_locale_typelib_ab_day_names_fi_FI
+ &my_locale_typelib_ab_day_names_fi_FI,
+ 9,
+ 11
);
/***** LOCALE END fi_FI *****/
@@ -559,7 +593,9 @@ MY_LOCALE my_locale_fo_FO
&my_locale_typelib_month_names_fo_FO,
&my_locale_typelib_ab_month_names_fo_FO,
&my_locale_typelib_day_names_fo_FO,
- &my_locale_typelib_ab_day_names_fo_FO
+ &my_locale_typelib_ab_day_names_fo_FO,
+ 9,
+ 12
);
/***** LOCALE END fo_FO *****/
@@ -589,7 +625,9 @@ MY_LOCALE my_locale_fr_FR
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_FR *****/
@@ -619,7 +657,9 @@ MY_LOCALE my_locale_gl_ES
&my_locale_typelib_month_names_gl_ES,
&my_locale_typelib_ab_month_names_gl_ES,
&my_locale_typelib_day_names_gl_ES,
- &my_locale_typelib_ab_day_names_gl_ES
+ &my_locale_typelib_ab_day_names_gl_ES,
+ 8,
+ 8
);
/***** LOCALE END gl_ES *****/
@@ -649,7 +689,9 @@ MY_LOCALE my_locale_gu_IN
&my_locale_typelib_month_names_gu_IN,
&my_locale_typelib_ab_month_names_gu_IN,
&my_locale_typelib_day_names_gu_IN,
- &my_locale_typelib_ab_day_names_gu_IN
+ &my_locale_typelib_ab_day_names_gu_IN,
+ 10,
+ 8
);
/***** LOCALE END gu_IN *****/
@@ -679,7 +721,9 @@ MY_LOCALE my_locale_he_IL
&my_locale_typelib_month_names_he_IL,
&my_locale_typelib_ab_month_names_he_IL,
&my_locale_typelib_day_names_he_IL,
- &my_locale_typelib_ab_day_names_he_IL
+ &my_locale_typelib_ab_day_names_he_IL,
+ 7,
+ 5
);
/***** LOCALE END he_IL *****/
@@ -709,7 +753,9 @@ MY_LOCALE my_locale_hi_IN
&my_locale_typelib_month_names_hi_IN,
&my_locale_typelib_ab_month_names_hi_IN,
&my_locale_typelib_day_names_hi_IN,
- &my_locale_typelib_ab_day_names_hi_IN
+ &my_locale_typelib_ab_day_names_hi_IN,
+ 7,
+ 9
);
/***** LOCALE END hi_IN *****/
@@ -739,7 +785,9 @@ MY_LOCALE my_locale_hr_HR
&my_locale_typelib_month_names_hr_HR,
&my_locale_typelib_ab_month_names_hr_HR,
&my_locale_typelib_day_names_hr_HR,
- &my_locale_typelib_ab_day_names_hr_HR
+ &my_locale_typelib_ab_day_names_hr_HR,
+ 8,
+ 11
);
/***** LOCALE END hr_HR *****/
@@ -769,7 +817,9 @@ MY_LOCALE my_locale_hu_HU
&my_locale_typelib_month_names_hu_HU,
&my_locale_typelib_ab_month_names_hu_HU,
&my_locale_typelib_day_names_hu_HU,
- &my_locale_typelib_ab_day_names_hu_HU
+ &my_locale_typelib_ab_day_names_hu_HU,
+ 10,
+ 9
);
/***** LOCALE END hu_HU *****/
@@ -799,7 +849,9 @@ MY_LOCALE my_locale_id_ID
&my_locale_typelib_month_names_id_ID,
&my_locale_typelib_ab_month_names_id_ID,
&my_locale_typelib_day_names_id_ID,
- &my_locale_typelib_ab_day_names_id_ID
+ &my_locale_typelib_ab_day_names_id_ID,
+ 9,
+ 6
);
/***** LOCALE END id_ID *****/
@@ -829,7 +881,9 @@ MY_LOCALE my_locale_is_IS
&my_locale_typelib_month_names_is_IS,
&my_locale_typelib_ab_month_names_is_IS,
&my_locale_typelib_day_names_is_IS,
- &my_locale_typelib_ab_day_names_is_IS
+ &my_locale_typelib_ab_day_names_is_IS,
+ 9,
+ 12
);
/***** LOCALE END is_IS *****/
@@ -859,7 +913,9 @@ MY_LOCALE my_locale_it_CH
&my_locale_typelib_month_names_it_CH,
&my_locale_typelib_ab_month_names_it_CH,
&my_locale_typelib_day_names_it_CH,
- &my_locale_typelib_ab_day_names_it_CH
+ &my_locale_typelib_ab_day_names_it_CH,
+ 9,
+ 9
);
/***** LOCALE END it_CH *****/
@@ -889,7 +945,9 @@ MY_LOCALE my_locale_ja_JP
&my_locale_typelib_month_names_ja_JP,
&my_locale_typelib_ab_month_names_ja_JP,
&my_locale_typelib_day_names_ja_JP,
- &my_locale_typelib_ab_day_names_ja_JP
+ &my_locale_typelib_ab_day_names_ja_JP,
+ 3,
+ 3
);
/***** LOCALE END ja_JP *****/
@@ -919,7 +977,9 @@ MY_LOCALE my_locale_ko_KR
&my_locale_typelib_month_names_ko_KR,
&my_locale_typelib_ab_month_names_ko_KR,
&my_locale_typelib_day_names_ko_KR,
- &my_locale_typelib_ab_day_names_ko_KR
+ &my_locale_typelib_ab_day_names_ko_KR,
+ 3,
+ 3
);
/***** LOCALE END ko_KR *****/
@@ -949,7 +1009,9 @@ MY_LOCALE my_locale_lt_LT
&my_locale_typelib_month_names_lt_LT,
&my_locale_typelib_ab_month_names_lt_LT,
&my_locale_typelib_day_names_lt_LT,
- &my_locale_typelib_ab_day_names_lt_LT
+ &my_locale_typelib_ab_day_names_lt_LT,
+ 9,
+ 14
);
/***** LOCALE END lt_LT *****/
@@ -979,7 +1041,9 @@ MY_LOCALE my_locale_lv_LV
&my_locale_typelib_month_names_lv_LV,
&my_locale_typelib_ab_month_names_lv_LV,
&my_locale_typelib_day_names_lv_LV,
- &my_locale_typelib_ab_day_names_lv_LV
+ &my_locale_typelib_ab_day_names_lv_LV,
+ 10,
+ 11
);
/***** LOCALE END lv_LV *****/
@@ -1009,7 +1073,9 @@ MY_LOCALE my_locale_mk_MK
&my_locale_typelib_month_names_mk_MK,
&my_locale_typelib_ab_month_names_mk_MK,
&my_locale_typelib_day_names_mk_MK,
- &my_locale_typelib_ab_day_names_mk_MK
+ &my_locale_typelib_ab_day_names_mk_MK,
+ 9,
+ 10
);
/***** LOCALE END mk_MK *****/
@@ -1039,7 +1105,9 @@ MY_LOCALE my_locale_mn_MN
&my_locale_typelib_month_names_mn_MN,
&my_locale_typelib_ab_month_names_mn_MN,
&my_locale_typelib_day_names_mn_MN,
- &my_locale_typelib_ab_day_names_mn_MN
+ &my_locale_typelib_ab_day_names_mn_MN,
+ 18,
+ 6
);
/***** LOCALE END mn_MN *****/
@@ -1069,7 +1137,9 @@ MY_LOCALE my_locale_ms_MY
&my_locale_typelib_month_names_ms_MY,
&my_locale_typelib_ab_month_names_ms_MY,
&my_locale_typelib_day_names_ms_MY,
- &my_locale_typelib_ab_day_names_ms_MY
+ &my_locale_typelib_ab_day_names_ms_MY,
+ 9,
+ 6
);
/***** LOCALE END ms_MY *****/
@@ -1099,7 +1169,9 @@ MY_LOCALE my_locale_nb_NO
&my_locale_typelib_month_names_nb_NO,
&my_locale_typelib_ab_month_names_nb_NO,
&my_locale_typelib_day_names_nb_NO,
- &my_locale_typelib_ab_day_names_nb_NO
+ &my_locale_typelib_ab_day_names_nb_NO,
+ 9,
+ 7
);
/***** LOCALE END nb_NO *****/
@@ -1129,7 +1201,9 @@ MY_LOCALE my_locale_nl_NL
&my_locale_typelib_month_names_nl_NL,
&my_locale_typelib_ab_month_names_nl_NL,
&my_locale_typelib_day_names_nl_NL,
- &my_locale_typelib_ab_day_names_nl_NL
+ &my_locale_typelib_ab_day_names_nl_NL,
+ 9,
+ 9
);
/***** LOCALE END nl_NL *****/
@@ -1159,7 +1233,9 @@ MY_LOCALE my_locale_pl_PL
&my_locale_typelib_month_names_pl_PL,
&my_locale_typelib_ab_month_names_pl_PL,
&my_locale_typelib_day_names_pl_PL,
- &my_locale_typelib_ab_day_names_pl_PL
+ &my_locale_typelib_ab_day_names_pl_PL,
+ 11,
+ 12
);
/***** LOCALE END pl_PL *****/
@@ -1189,7 +1265,9 @@ MY_LOCALE my_locale_pt_BR
&my_locale_typelib_month_names_pt_BR,
&my_locale_typelib_ab_month_names_pt_BR,
&my_locale_typelib_day_names_pt_BR,
- &my_locale_typelib_ab_day_names_pt_BR
+ &my_locale_typelib_ab_day_names_pt_BR,
+ 9,
+ 7
);
/***** LOCALE END pt_BR *****/
@@ -1219,7 +1297,9 @@ MY_LOCALE my_locale_pt_PT
&my_locale_typelib_month_names_pt_PT,
&my_locale_typelib_ab_month_names_pt_PT,
&my_locale_typelib_day_names_pt_PT,
- &my_locale_typelib_ab_day_names_pt_PT
+ &my_locale_typelib_ab_day_names_pt_PT,
+ 9,
+ 7
);
/***** LOCALE END pt_PT *****/
@@ -1249,7 +1329,9 @@ MY_LOCALE my_locale_ro_RO
&my_locale_typelib_month_names_ro_RO,
&my_locale_typelib_ab_month_names_ro_RO,
&my_locale_typelib_day_names_ro_RO,
- &my_locale_typelib_ab_day_names_ro_RO
+ &my_locale_typelib_ab_day_names_ro_RO,
+ 10,
+ 8
);
/***** LOCALE END ro_RO *****/
@@ -1279,7 +1361,9 @@ MY_LOCALE my_locale_ru_RU
&my_locale_typelib_month_names_ru_RU,
&my_locale_typelib_ab_month_names_ru_RU,
&my_locale_typelib_day_names_ru_RU,
- &my_locale_typelib_ab_day_names_ru_RU
+ &my_locale_typelib_ab_day_names_ru_RU,
+ 8,
+ 11
);
/***** LOCALE END ru_RU *****/
@@ -1309,7 +1393,9 @@ MY_LOCALE my_locale_ru_UA
&my_locale_typelib_month_names_ru_UA,
&my_locale_typelib_ab_month_names_ru_UA,
&my_locale_typelib_day_names_ru_UA,
- &my_locale_typelib_ab_day_names_ru_UA
+ &my_locale_typelib_ab_day_names_ru_UA,
+ 8,
+ 11
);
/***** LOCALE END ru_UA *****/
@@ -1339,7 +1425,9 @@ MY_LOCALE my_locale_sk_SK
&my_locale_typelib_month_names_sk_SK,
&my_locale_typelib_ab_month_names_sk_SK,
&my_locale_typelib_day_names_sk_SK,
- &my_locale_typelib_ab_day_names_sk_SK
+ &my_locale_typelib_ab_day_names_sk_SK,
+ 9,
+ 8
);
/***** LOCALE END sk_SK *****/
@@ -1369,7 +1457,9 @@ MY_LOCALE my_locale_sl_SI
&my_locale_typelib_month_names_sl_SI,
&my_locale_typelib_ab_month_names_sl_SI,
&my_locale_typelib_day_names_sl_SI,
- &my_locale_typelib_ab_day_names_sl_SI
+ &my_locale_typelib_ab_day_names_sl_SI,
+ 9,
+ 10
);
/***** LOCALE END sl_SI *****/
@@ -1399,7 +1489,9 @@ MY_LOCALE my_locale_sq_AL
&my_locale_typelib_month_names_sq_AL,
&my_locale_typelib_ab_month_names_sq_AL,
&my_locale_typelib_day_names_sq_AL,
- &my_locale_typelib_ab_day_names_sq_AL
+ &my_locale_typelib_ab_day_names_sq_AL,
+ 7,
+ 10
);
/***** LOCALE END sq_AL *****/
@@ -1429,7 +1521,9 @@ MY_LOCALE my_locale_sr_YU
&my_locale_typelib_month_names_sr_YU,
&my_locale_typelib_ab_month_names_sr_YU,
&my_locale_typelib_day_names_sr_YU,
- &my_locale_typelib_ab_day_names_sr_YU
+ &my_locale_typelib_ab_day_names_sr_YU,
+ 9,
+ 10
);
/***** LOCALE END sr_YU *****/
@@ -1459,7 +1553,9 @@ MY_LOCALE my_locale_sv_SE
&my_locale_typelib_month_names_sv_SE,
&my_locale_typelib_ab_month_names_sv_SE,
&my_locale_typelib_day_names_sv_SE,
- &my_locale_typelib_ab_day_names_sv_SE
+ &my_locale_typelib_ab_day_names_sv_SE,
+ 9,
+ 7
);
/***** LOCALE END sv_SE *****/
@@ -1489,7 +1585,9 @@ MY_LOCALE my_locale_ta_IN
&my_locale_typelib_month_names_ta_IN,
&my_locale_typelib_ab_month_names_ta_IN,
&my_locale_typelib_day_names_ta_IN,
- &my_locale_typelib_ab_day_names_ta_IN
+ &my_locale_typelib_ab_day_names_ta_IN,
+ 10,
+ 8
);
/***** LOCALE END ta_IN *****/
@@ -1519,7 +1617,9 @@ MY_LOCALE my_locale_te_IN
&my_locale_typelib_month_names_te_IN,
&my_locale_typelib_ab_month_names_te_IN,
&my_locale_typelib_day_names_te_IN,
- &my_locale_typelib_ab_day_names_te_IN
+ &my_locale_typelib_ab_day_names_te_IN,
+ 10,
+ 9
);
/***** LOCALE END te_IN *****/
@@ -1549,7 +1649,9 @@ MY_LOCALE my_locale_th_TH
&my_locale_typelib_month_names_th_TH,
&my_locale_typelib_ab_month_names_th_TH,
&my_locale_typelib_day_names_th_TH,
- &my_locale_typelib_ab_day_names_th_TH
+ &my_locale_typelib_ab_day_names_th_TH,
+ 10,
+ 8
);
/***** LOCALE END th_TH *****/
@@ -1579,7 +1681,9 @@ MY_LOCALE my_locale_tr_TR
&my_locale_typelib_month_names_tr_TR,
&my_locale_typelib_ab_month_names_tr_TR,
&my_locale_typelib_day_names_tr_TR,
- &my_locale_typelib_ab_day_names_tr_TR
+ &my_locale_typelib_ab_day_names_tr_TR,
+ 7,
+ 9
);
/***** LOCALE END tr_TR *****/
@@ -1609,7 +1713,9 @@ MY_LOCALE my_locale_uk_UA
&my_locale_typelib_month_names_uk_UA,
&my_locale_typelib_ab_month_names_uk_UA,
&my_locale_typelib_day_names_uk_UA,
- &my_locale_typelib_ab_day_names_uk_UA
+ &my_locale_typelib_ab_day_names_uk_UA,
+ 8,
+ 9
);
/***** LOCALE END uk_UA *****/
@@ -1639,7 +1745,9 @@ MY_LOCALE my_locale_ur_PK
&my_locale_typelib_month_names_ur_PK,
&my_locale_typelib_ab_month_names_ur_PK,
&my_locale_typelib_day_names_ur_PK,
- &my_locale_typelib_ab_day_names_ur_PK
+ &my_locale_typelib_ab_day_names_ur_PK,
+ 6,
+ 6
);
/***** LOCALE END ur_PK *****/
@@ -1669,7 +1777,9 @@ MY_LOCALE my_locale_vi_VN
&my_locale_typelib_month_names_vi_VN,
&my_locale_typelib_ab_month_names_vi_VN,
&my_locale_typelib_day_names_vi_VN,
- &my_locale_typelib_ab_day_names_vi_VN
+ &my_locale_typelib_ab_day_names_vi_VN,
+ 16,
+ 11
);
/***** LOCALE END vi_VN *****/
@@ -1699,7 +1809,9 @@ MY_LOCALE my_locale_zh_CN
&my_locale_typelib_month_names_zh_CN,
&my_locale_typelib_ab_month_names_zh_CN,
&my_locale_typelib_day_names_zh_CN,
- &my_locale_typelib_ab_day_names_zh_CN
+ &my_locale_typelib_ab_day_names_zh_CN,
+ 3,
+ 3
);
/***** LOCALE END zh_CN *****/
@@ -1729,7 +1841,9 @@ MY_LOCALE my_locale_zh_TW
&my_locale_typelib_month_names_zh_TW,
&my_locale_typelib_ab_month_names_zh_TW,
&my_locale_typelib_day_names_zh_TW,
- &my_locale_typelib_ab_day_names_zh_TW
+ &my_locale_typelib_ab_day_names_zh_TW,
+ 3,
+ 2
);
/***** LOCALE END zh_TW *****/
@@ -1743,7 +1857,9 @@ MY_LOCALE my_locale_ar_DZ
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_DZ *****/
@@ -1757,7 +1873,9 @@ MY_LOCALE my_locale_ar_EG
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_EG *****/
@@ -1771,7 +1889,9 @@ MY_LOCALE my_locale_ar_IN
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_IN *****/
@@ -1785,7 +1905,9 @@ MY_LOCALE my_locale_ar_IQ
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_IQ *****/
@@ -1799,7 +1921,9 @@ MY_LOCALE my_locale_ar_KW
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_KW *****/
@@ -1813,7 +1937,9 @@ MY_LOCALE my_locale_ar_LB
&my_locale_typelib_month_names_ar_JO,
&my_locale_typelib_ab_month_names_ar_JO,
&my_locale_typelib_day_names_ar_JO,
- &my_locale_typelib_ab_day_names_ar_JO
+ &my_locale_typelib_ab_day_names_ar_JO,
+ 12,
+ 8
);
/***** LOCALE END ar_LB *****/
@@ -1827,7 +1953,9 @@ MY_LOCALE my_locale_ar_LY
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_LY *****/
@@ -1841,7 +1969,9 @@ MY_LOCALE my_locale_ar_MA
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_MA *****/
@@ -1855,7 +1985,9 @@ MY_LOCALE my_locale_ar_OM
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_OM *****/
@@ -1869,7 +2001,9 @@ MY_LOCALE my_locale_ar_QA
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_QA *****/
@@ -1883,7 +2017,9 @@ MY_LOCALE my_locale_ar_SD
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_SD *****/
@@ -1897,7 +2033,9 @@ MY_LOCALE my_locale_ar_TN
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_TN *****/
@@ -1911,7 +2049,9 @@ MY_LOCALE my_locale_ar_YE
&my_locale_typelib_month_names_ar_BH,
&my_locale_typelib_ab_month_names_ar_BH,
&my_locale_typelib_day_names_ar_BH,
- &my_locale_typelib_ab_day_names_ar_BH
+ &my_locale_typelib_ab_day_names_ar_BH,
+ 6,
+ 8
);
/***** LOCALE END ar_YE *****/
@@ -1925,7 +2065,9 @@ MY_LOCALE my_locale_de_BE
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_BE *****/
@@ -1939,7 +2081,9 @@ MY_LOCALE my_locale_de_CH
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_CH *****/
@@ -1953,7 +2097,9 @@ MY_LOCALE my_locale_de_LU
&my_locale_typelib_month_names_de_DE,
&my_locale_typelib_ab_month_names_de_DE,
&my_locale_typelib_day_names_de_DE,
- &my_locale_typelib_ab_day_names_de_DE
+ &my_locale_typelib_ab_day_names_de_DE,
+ 9,
+ 10
);
/***** LOCALE END de_LU *****/
@@ -1967,7 +2113,9 @@ MY_LOCALE my_locale_en_AU
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_AU *****/
@@ -1981,7 +2129,9 @@ MY_LOCALE my_locale_en_CA
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_CA *****/
@@ -1995,7 +2145,9 @@ MY_LOCALE my_locale_en_GB
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_GB *****/
@@ -2009,7 +2161,9 @@ MY_LOCALE my_locale_en_IN
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_IN *****/
@@ -2023,7 +2177,9 @@ MY_LOCALE my_locale_en_NZ
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_NZ *****/
@@ -2037,7 +2193,9 @@ MY_LOCALE my_locale_en_PH
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_PH *****/
@@ -2051,7 +2209,9 @@ MY_LOCALE my_locale_en_ZA
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_ZA *****/
@@ -2065,7 +2225,9 @@ MY_LOCALE my_locale_en_ZW
&my_locale_typelib_month_names_en_US,
&my_locale_typelib_ab_month_names_en_US,
&my_locale_typelib_day_names_en_US,
- &my_locale_typelib_ab_day_names_en_US
+ &my_locale_typelib_ab_day_names_en_US,
+ 9,
+ 9
);
/***** LOCALE END en_ZW *****/
@@ -2079,7 +2241,9 @@ MY_LOCALE my_locale_es_AR
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_AR *****/
@@ -2093,7 +2257,9 @@ MY_LOCALE my_locale_es_BO
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_BO *****/
@@ -2107,7 +2273,9 @@ MY_LOCALE my_locale_es_CL
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_CL *****/
@@ -2121,7 +2289,9 @@ MY_LOCALE my_locale_es_CO
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_CO *****/
@@ -2135,7 +2305,9 @@ MY_LOCALE my_locale_es_CR
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_CR *****/
@@ -2149,7 +2321,9 @@ MY_LOCALE my_locale_es_DO
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_DO *****/
@@ -2163,7 +2337,9 @@ MY_LOCALE my_locale_es_EC
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_EC *****/
@@ -2177,7 +2353,9 @@ MY_LOCALE my_locale_es_GT
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_GT *****/
@@ -2191,7 +2369,9 @@ MY_LOCALE my_locale_es_HN
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_HN *****/
@@ -2205,7 +2385,9 @@ MY_LOCALE my_locale_es_MX
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_MX *****/
@@ -2219,7 +2401,9 @@ MY_LOCALE my_locale_es_NI
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_NI *****/
@@ -2233,7 +2417,9 @@ MY_LOCALE my_locale_es_PA
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PA *****/
@@ -2247,7 +2433,9 @@ MY_LOCALE my_locale_es_PE
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PE *****/
@@ -2261,7 +2449,9 @@ MY_LOCALE my_locale_es_PR
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PR *****/
@@ -2275,7 +2465,9 @@ MY_LOCALE my_locale_es_PY
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_PY *****/
@@ -2289,7 +2481,9 @@ MY_LOCALE my_locale_es_SV
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_SV *****/
@@ -2303,7 +2497,9 @@ MY_LOCALE my_locale_es_US
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_US *****/
@@ -2317,7 +2513,9 @@ MY_LOCALE my_locale_es_UY
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_UY *****/
@@ -2331,7 +2529,9 @@ MY_LOCALE my_locale_es_VE
&my_locale_typelib_month_names_es_ES,
&my_locale_typelib_ab_month_names_es_ES,
&my_locale_typelib_day_names_es_ES,
- &my_locale_typelib_ab_day_names_es_ES
+ &my_locale_typelib_ab_day_names_es_ES,
+ 10,
+ 9
);
/***** LOCALE END es_VE *****/
@@ -2345,7 +2545,9 @@ MY_LOCALE my_locale_fr_BE
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_BE *****/
@@ -2359,7 +2561,9 @@ MY_LOCALE my_locale_fr_CA
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_CA *****/
@@ -2373,7 +2577,9 @@ MY_LOCALE my_locale_fr_CH
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_CH *****/
@@ -2387,7 +2593,9 @@ MY_LOCALE my_locale_fr_LU
&my_locale_typelib_month_names_fr_FR,
&my_locale_typelib_ab_month_names_fr_FR,
&my_locale_typelib_day_names_fr_FR,
- &my_locale_typelib_ab_day_names_fr_FR
+ &my_locale_typelib_ab_day_names_fr_FR,
+ 9,
+ 8
);
/***** LOCALE END fr_LU *****/
@@ -2401,7 +2609,9 @@ MY_LOCALE my_locale_it_IT
&my_locale_typelib_month_names_it_CH,
&my_locale_typelib_ab_month_names_it_CH,
&my_locale_typelib_day_names_it_CH,
- &my_locale_typelib_ab_day_names_it_CH
+ &my_locale_typelib_ab_day_names_it_CH,
+ 9,
+ 9
);
/***** LOCALE END it_IT *****/
@@ -2415,7 +2625,9 @@ MY_LOCALE my_locale_nl_BE
&my_locale_typelib_month_names_nl_NL,
&my_locale_typelib_ab_month_names_nl_NL,
&my_locale_typelib_day_names_nl_NL,
- &my_locale_typelib_ab_day_names_nl_NL
+ &my_locale_typelib_ab_day_names_nl_NL,
+ 9,
+ 9
);
/***** LOCALE END nl_BE *****/
@@ -2429,7 +2641,9 @@ MY_LOCALE my_locale_no_NO
&my_locale_typelib_month_names_nb_NO,
&my_locale_typelib_ab_month_names_nb_NO,
&my_locale_typelib_day_names_nb_NO,
- &my_locale_typelib_ab_day_names_nb_NO
+ &my_locale_typelib_ab_day_names_nb_NO,
+ 9,
+ 7
);
/***** LOCALE END no_NO *****/
@@ -2443,7 +2657,9 @@ MY_LOCALE my_locale_sv_FI
&my_locale_typelib_month_names_sv_SE,
&my_locale_typelib_ab_month_names_sv_SE,
&my_locale_typelib_day_names_sv_SE,
- &my_locale_typelib_ab_day_names_sv_SE
+ &my_locale_typelib_ab_day_names_sv_SE,
+ 9,
+ 7
);
/***** LOCALE END sv_FI *****/
@@ -2457,7 +2673,9 @@ MY_LOCALE my_locale_zh_HK
&my_locale_typelib_month_names_zh_CN,
&my_locale_typelib_ab_month_names_zh_CN,
&my_locale_typelib_day_names_zh_CN,
- &my_locale_typelib_ab_day_names_zh_CN
+ &my_locale_typelib_ab_day_names_zh_CN,
+ 3,
+ 3
);
/***** LOCALE END zh_HK *****/
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index 171ab55145a..b082f65bfb9 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -23,8 +23,9 @@
#include "mysql_priv.h"
-ulong volatile manager_status;
-bool volatile manager_thread_in_use;
+
+static bool volatile manager_thread_in_use;
+static bool abort_manager;
pthread_t manager_thread;
pthread_mutex_t LOCK_manager;
@@ -63,7 +64,6 @@ bool mysql_manager_submit(void (*action)())
pthread_handler_t handle_manager(void *arg __attribute__((unused)))
{
int error = 0;
- ulong status;
struct timespec abstime;
bool reset_flush_time = TRUE;
struct handler_cb *cb= NULL;
@@ -72,7 +72,6 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused)))
pthread_detach_this_thread();
manager_thread = pthread_self();
- manager_status = 0;
manager_thread_in_use = 1;
for (;;)
@@ -87,16 +86,14 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused)))
set_timespec(abstime, flush_time);
reset_flush_time = FALSE;
}
- while (!manager_status && (!error || error == EINTR) && !abort_loop)
+ while ((!error || error == EINTR) && !abort_manager)
error= pthread_cond_timedwait(&COND_manager, &LOCK_manager, &abstime);
}
else
{
- while (!manager_status && (!error || error == EINTR) && !abort_loop)
+ while ((!error || error == EINTR) && !abort_manager)
error= pthread_cond_wait(&COND_manager, &LOCK_manager);
}
- status = manager_status;
- manager_status = 0;
if (cb == NULL)
{
cb= cb_list;
@@ -104,7 +101,7 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused)))
}
pthread_mutex_unlock(&LOCK_manager);
- if (abort_loop)
+ if (abort_manager)
break;
if (error == ETIMEDOUT || error == ETIME)
@@ -121,11 +118,42 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused)))
my_free((uchar*)cb, MYF(0));
cb= next;
}
-
- if (status)
- DBUG_PRINT("error", ("manager did not handle something: %lx", status));
}
manager_thread_in_use = 0;
+ DBUG_LEAVE; // Can't use DBUG_RETURN after my_thread_end
my_thread_end();
- DBUG_RETURN(NULL);
+ return (NULL);
}
+
+
+/* Start handle manager thread */
+void start_handle_manager()
+{
+ DBUG_ENTER("start_handle_manager");
+ abort_manager = false;
+ if (flush_time && flush_time != ~(ulong) 0L)
+ {
+ pthread_t hThread;
+ if (pthread_create(&hThread,&connection_attrib,handle_manager,0))
+ sql_print_warning("Can't create handle_manager thread");
+ }
+ DBUG_VOID_RETURN;
+}
+
+
+/* Initiate shutdown of handle manager thread */
+void stop_handle_manager()
+{
+ DBUG_ENTER("stop_handle_manager");
+ abort_manager = true;
+ pthread_mutex_lock(&LOCK_manager);
+ if (manager_thread_in_use)
+ {
+ DBUG_PRINT("quit", ("initiate shutdown of handle manager thread: 0x%lx",
+ (ulong)manager_thread));
+ pthread_cond_signal(&COND_manager);
+ }
+ pthread_mutex_unlock(&LOCK_manager);
+ DBUG_VOID_RETURN;
+}
+
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index f518e1ef9e8..bc10cadad48 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -971,8 +971,24 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->set_time();
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id= global_query_id;
- if (command != COM_STATISTICS && command != COM_PING)
+
+ switch( command ) {
+ /* Ignore these statements. */
+ case COM_STATISTICS:
+ case COM_PING:
+ break;
+ /* Only increase id on these statements but don't count them. */
+ case COM_STMT_PREPARE:
+ case COM_STMT_CLOSE:
+ case COM_STMT_RESET:
next_query_id();
+ break;
+ /* Increase id and count all other statements. */
+ default:
+ statistic_increment(thd->status_var.questions, &LOCK_status);
+ next_query_id();
+ }
+
thread_running++;
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
VOID(pthread_mutex_unlock(&LOCK_thread_count));
@@ -1229,6 +1245,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_length= length;
thd->query= beginning_of_next_stmt;
+ /*
+ Count each statement from the client.
+ */
+ statistic_increment(thd->status_var.questions, &LOCK_status);
thd->query_id= next_query_id();
thd->set_time(); /* Reset the query start time. */
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 5ed64ea8fd5..c1df5552eb9 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -4233,9 +4233,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
after the change as before. Thus we can reply ok immediately
without any changes at all.
*/
- DBUG_RETURN(fast_end_partition(thd, ULL(0), ULL(0),
- table, NULL,
- TRUE, NULL, FALSE));
+ *fast_alter_partition= TRUE;
+ DBUG_RETURN(FALSE);
}
else if (new_part_no > curr_part_no)
{
@@ -5304,8 +5303,8 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
DDL_LOG_ENTRY ddl_log_entry;
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
- char tmp_path[FN_LEN];
- char normal_path[FN_LEN];
+ char tmp_path[FN_REFLEN];
+ char normal_path[FN_REFLEN];
List_iterator part_it(part_info->partitions);
uint temp_partitions= part_info->temp_partitions.elements;
uint no_elements= part_info->partitions.elements;
@@ -5516,7 +5515,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
- char shadow_path[FN_LEN];
+ char shadow_path[FN_REFLEN];
DBUG_ENTER("write_log_drop_shadow_frm");
build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
@@ -5559,8 +5558,8 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
- char path[FN_LEN];
- char shadow_path[FN_LEN];
+ char path[FN_REFLEN];
+ char shadow_path[FN_REFLEN];
DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
DBUG_ENTER("write_log_rename_frm");
@@ -5610,8 +5609,8 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
- char tmp_path[FN_LEN];
- char path[FN_LEN];
+ char tmp_path[FN_REFLEN];
+ char path[FN_REFLEN];
uint next_entry= 0;
DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
DBUG_ENTER("write_log_drop_partition");
@@ -5669,8 +5668,8 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
- char tmp_path[FN_LEN];
- char path[FN_LEN];
+ char tmp_path[FN_REFLEN];
+ char path[FN_REFLEN];
uint next_entry= 0;
DBUG_ENTER("write_log_add_change_partition");
@@ -5723,8 +5722,8 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
- char path[FN_LEN];
- char shadow_path[FN_LEN];
+ char path[FN_REFLEN];
+ char shadow_path[FN_REFLEN];
DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
uint next_entry= 0;
DBUG_ENTER("write_log_final_change_partition");
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 13b2bfef24d..0df1631294b 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -751,21 +751,22 @@ static bool plugin_add(MEM_ROOT *tmp_root,
tmp.name.length= name_len;
tmp.ref_count= 0;
tmp.state= PLUGIN_IS_UNINITIALIZED;
- if (!test_plugin_options(tmp_root, &tmp, argc, argv, true))
+ if (test_plugin_options(tmp_root, &tmp, argc, argv, true))
+ tmp.state= PLUGIN_IS_DISABLED;
+
+ if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
{
- if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
+ plugin_array_version++;
+ if (!my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
{
- plugin_array_version++;
- if (!my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
- {
- init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
- DBUG_RETURN(FALSE);
- }
- tmp_plugin_ptr->state= PLUGIN_IS_FREED;
+ init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
+ DBUG_RETURN(FALSE);
}
- mysql_del_sys_var_chain(tmp.system_vars);
- goto err;
+ tmp_plugin_ptr->state= PLUGIN_IS_FREED;
}
+ mysql_del_sys_var_chain(tmp.system_vars);
+ goto err;
+
/* plugin was disabled */
plugin_dl_del(dl);
DBUG_RETURN(FALSE);
@@ -1145,11 +1146,12 @@ int plugin_init(int *argc, char **argv, int flags)
tmp.plugin= plugin;
tmp.name.str= (char *)plugin->name;
tmp.name.length= strlen(plugin->name);
-
+ tmp.state= 0;
free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE));
if (test_plugin_options(&tmp_root, &tmp, argc, argv, def_enabled))
- continue;
-
+ tmp.state= PLUGIN_IS_DISABLED;
+ else
+ tmp.state= PLUGIN_IS_UNINITIALIZED;
if (register_builtin(plugin, &tmp, &plugin_ptr))
goto err_unlock;
@@ -1159,7 +1161,8 @@ int plugin_init(int *argc, char **argv, int flags)
my_strcasecmp(&my_charset_latin1, plugin->name, "CSV"))
continue;
- if (plugin_initialize(plugin_ptr))
+ if (plugin_ptr->state == PLUGIN_IS_UNINITIALIZED &&
+ plugin_initialize(plugin_ptr))
goto err_unlock;
/*
@@ -1246,8 +1249,6 @@ static bool register_builtin(struct st_mysql_plugin *plugin,
struct st_plugin_int **ptr)
{
DBUG_ENTER("register_builtin");
-
- tmp->state= PLUGIN_IS_UNINITIALIZED;
tmp->ref_count= 0;
tmp->plugin_dl= 0;
@@ -1296,7 +1297,7 @@ bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
if (test_plugin_options(thd->mem_root, &tmp, &dummy_argc, NULL, true))
goto end;
-
+ tmp.state= PLUGIN_IS_UNINITIALIZED;
if ((result= register_builtin(plugin, &tmp, &ptr)))
mysql_del_sys_var_chain(tmp.system_vars);
@@ -1555,7 +1556,8 @@ void plugin_shutdown(void)
We loop through all plugins and call deinit() if they have one.
*/
for (i= 0; i < count; i++)
- if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED)))
+ if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED |
+ PLUGIN_IS_DISABLED)))
{
sql_print_information("Plugin '%s' will be forced to shutdown",
plugins[i]->name.str);
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index e8f2cb6ee5e..8ae38d58845 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -54,6 +54,7 @@ typedef struct st_mysql_show_var SHOW_VAR;
#define PLUGIN_IS_UNINITIALIZED 4
#define PLUGIN_IS_READY 8
#define PLUGIN_IS_DYING 16
+#define PLUGIN_IS_DISABLED 32
/* A handle for the dynamic library containing a plugin or plugins. */
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b1f74d26db3..14ddccd9229 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1667,8 +1667,11 @@ JOIN::exec()
(zero_result_cause?zero_result_cause:"No tables used"));
else
{
- result->send_fields(*columns_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
+ if (result->send_fields(*columns_list,
+ Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
+ {
+ DBUG_VOID_RETURN;
+ }
/*
We have to test for 'conds' here as the WHERE may not be constant
even if we don't have any tables for prepared statements or if
@@ -2584,7 +2587,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
if (s->dependent & table->map)
s->dependent |= table->reginfo.join_tab->dependent;
}
- if (s->dependent)
+ if (outer_join & s->table->map)
s->table->maybe_null= 1;
}
/* Catch illegal cross references for outer joins */
@@ -13856,6 +13859,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length=0;
for (i=0 ; i < table_count ; i++)
{
+ bool have_bit_fields= FALSE;
uint null_fields=0,used_fields;
Field **f_ptr,*field;
MY_BITMAP *read_set= tables[i].table->read_set;
@@ -13870,13 +13874,16 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length+=field->fill_cache_field(copy);
if (copy->blob_field)
(*blob_ptr++)=copy;
- if (field->maybe_null())
+ if (field->real_maybe_null())
null_fields++;
+ if (field->type() == MYSQL_TYPE_BIT &&
+ ((Field_bit*)field)->bit_len)
+ have_bit_fields= TRUE;
copy++;
}
}
/* Copy null bits from table */
- if (null_fields && tables[i].table->s->null_fields)
+ if (null_fields || have_bit_fields)
{ /* must copy null bits */
copy->str= tables[i].table->null_flags;
copy->length= tables[i].table->s->null_bytes;
diff --git a/sql/sql_select.h b/sql/sql_select.h
index be159c523e0..c5961f097c2 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -285,7 +285,11 @@ public:
fetching data from a cursor
*/
bool resume_nested_loop;
- table_map const_table_map,found_const_table_map,outer_join;
+ table_map const_table_map,found_const_table_map;
+ /*
+ Bitmap of all inner tables from outer joins
+ */
+ table_map outer_join;
ha_rows send_records,found_records,examined_rows,row_limit, select_limit;
/**
Used to fetch no more than given amount of rows per one
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 28e8c028362..7b96aaf72fe 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -124,6 +124,9 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
case PLUGIN_IS_READY:
table->field[2]->store(STRING_WITH_LEN("ACTIVE"), cs);
break;
+ case PLUGIN_IS_DISABLED:
+ table->field[2]->store(STRING_WITH_LEN("DISABLED"), cs);
+ break;
default:
DBUG_ASSERT(0);
}
@@ -465,11 +468,18 @@ find_files(THD *thd, List *files, const char *db,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint col_access=thd->col_access;
#endif
+ uint wild_length= 0;
TABLE_LIST table_list;
DBUG_ENTER("find_files");
- if (wild && !wild[0])
- wild=0;
+ if (wild)
+ {
+ if (!wild[0])
+ wild= 0;
+ else
+ wild_length= strlen(wild);
+ }
+
bzero((char*) &table_list,sizeof(table_list));
@@ -533,8 +543,11 @@ find_files(THD *thd, List *files, const char *db,
{
if (lower_case_table_names)
{
- if (wild_case_compare(files_charset_info, uname, wild))
- continue;
+ if (my_wildcmp(files_charset_info,
+ uname, uname + file_name_len,
+ wild, wild + wild_length,
+ wild_prefix, wild_one, wild_many))
+ continue;
}
else if (wild_compare(uname, wild, 0))
continue;
@@ -993,7 +1006,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
{
bool has_default;
bool has_now_default;
-
+ enum enum_field_types field_type= field->type();
/*
We are using CURRENT_TIMESTAMP instead of NOW because it is
more standard
@@ -1001,7 +1014,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
has_now_default= table->timestamp_field == field &&
field->unireg_check != Field::TIMESTAMP_UN_FIELD;
- has_default= (field->type() != FIELD_TYPE_BLOB &&
+ has_default= (field_type != FIELD_TYPE_BLOB &&
!(field->flags & NO_DEFAULT_VALUE_FLAG) &&
field->unireg_check != Field::NEXT_NUMBER &&
!((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
@@ -1016,7 +1029,19 @@ static bool get_field_default_value(THD *thd, TABLE *table,
{ // Not null by default
char tmp[MAX_FIELD_WIDTH];
String type(tmp, sizeof(tmp), field->charset());
- field->val_str(&type);
+ if (field_type == MYSQL_TYPE_BIT)
+ {
+ longlong dec= field->val_int();
+ char *ptr= longlong2str(dec, tmp + 2, 2);
+ uint32 length= (uint32) (ptr - tmp);
+ tmp[0]= 'b';
+ tmp[1]= '\'';
+ tmp[length]= '\'';
+ type.length(length + 1);
+ quoted= 0;
+ }
+ else
+ field->val_str(&type);
if (type.length())
{
String def_val;
@@ -3577,6 +3602,11 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
(share->transactional == HA_CHOICE_YES ? "1" : "0"),
NullS);
}
+ if (share->key_block_size)
+ {
+ ptr= strmov(ptr, " KEY_BLOCK_SIZE=");
+ ptr= longlong10_to_str(share->key_block_size, ptr, 10);
+ }
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (is_partitioned)
ptr= strmov(ptr, " partitioned");
@@ -3913,6 +3943,25 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
handlerton *default_type= ha_default_handlerton(thd);
DBUG_ENTER("iter_schema_engines");
+
+ /* Disabled plugins */
+ if (plugin_state(plugin) != PLUGIN_IS_READY)
+ {
+
+ struct st_mysql_plugin *plug= plugin_decl(plugin);
+ if (!(wild && wild[0] &&
+ wild_case_compare(scs, plug->name,wild)))
+ {
+ restore_record(table, s->default_values);
+ table->field[0]->store(plug->name, strlen(plug->name), scs);
+ table->field[1]->store(C_STRING_WITH_LEN("NO"), scs);
+ table->field[2]->store(plug->descr, strlen(plug->descr), scs);
+ if (schema_table_store_record(thd, table))
+ DBUG_RETURN(1);
+ }
+ DBUG_RETURN(0);
+ }
+
if (!(hton->flags & HTON_HIDDEN))
{
LEX_STRING *name= plugin_name(plugin);
@@ -3933,10 +3982,13 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
strlen(plugin_decl(plugin)->descr), scs);
tmp= &yesno[test(hton->commit)];
table->field[3]->store(tmp->str, tmp->length, scs);
+ table->field[3]->set_notnull();
tmp= &yesno[test(hton->prepare)];
table->field[4]->store(tmp->str, tmp->length, scs);
+ table->field[4]->set_notnull();
tmp= &yesno[test(hton->savepoint_set)];
table->field[5]->store(tmp->str, tmp->length, scs);
+ table->field[5]->set_notnull();
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
@@ -3947,8 +3999,12 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
int fill_schema_engines(THD *thd, TABLE_LIST *tables, COND *cond)
{
- return plugin_foreach(thd, iter_schema_engines,
- MYSQL_STORAGE_ENGINE_PLUGIN, tables->table);
+ DBUG_ENTER("fill_schema_engines");
+ if (plugin_foreach_with_mask(thd, iter_schema_engines,
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ ~PLUGIN_IS_FREED, tables->table))
+ DBUG_RETURN(1);
+ DBUG_RETURN(0);
}
@@ -6145,9 +6201,9 @@ ST_FIELD_INFO engines_fields_info[]=
{"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine", SKIP_OPEN_TABLE},
{"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support", SKIP_OPEN_TABLE},
{"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
- {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 0, "Transactions", SKIP_OPEN_TABLE},
- {"XA", 3, MYSQL_TYPE_STRING, 0, 0, "XA", SKIP_OPEN_TABLE},
- {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 0, "Savepoints", SKIP_OPEN_TABLE},
+ {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 1, "Transactions", SKIP_OPEN_TABLE},
+ {"XA", 3, MYSQL_TYPE_STRING, 0, 1, "XA", SKIP_OPEN_TABLE},
+ {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 1, "Savepoints", SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index ec35616bc89..f20117ebac7 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3111,10 +3111,12 @@ static bool prepare_blob_field(THD *thd, Create_field *sql_field)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_AUTO_CONVERT,
warn_buff);
}
-
+
if ((sql_field->flags & BLOB_FLAG) && sql_field->length)
{
- if (sql_field->sql_type == MYSQL_TYPE_BLOB)
+ if (sql_field->sql_type == FIELD_TYPE_BLOB ||
+ sql_field->sql_type == FIELD_TYPE_TINY_BLOB ||
+ sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB)
{
/* The user has given a length to the blob column */
sql_field->sql_type= get_blob_type_from_length(sql_field->length);
@@ -3425,14 +3427,6 @@ bool mysql_create_table_no_lock(THD *thd,
}
else
{
- #ifdef FN_DEVCHAR
- /* check if the table name contains FN_DEVCHAR when defined */
- if (strchr(alias, FN_DEVCHAR))
- {
- my_error(ER_WRONG_TABLE_NAME, MYF(0), alias);
- DBUG_RETURN(TRUE);
- }
-#endif
path_length= build_table_filename(path, sizeof(path), db, alias, reg_ext,
internal_tmp_table ? FN_IS_TMP : 0);
}
@@ -4319,6 +4313,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
table->table=0; // For query cache
if (protocol->write())
goto err;
+ thd->main_da.reset_diagnostics_area();
continue;
/* purecov: end */
}
@@ -5867,7 +5862,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (key_info->flags & HA_USES_BLOCK_SIZE)
key_create_info.block_size= key_info->block_size;
if (key_info->flags & HA_USES_PARSER)
- key_create_info.parser_name= *key_info->parser_name;
+ key_create_info.parser_name= *plugin_name(key_info->parser);
if (key_info->flags & HA_SPATIAL)
key_type= Key::SPATIAL;
diff --git a/sql/table.cc b/sql/table.cc
index 89714e4e47e..95753e5353a 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -400,6 +400,8 @@ void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
void free_table_share(TABLE_SHARE *share)
{
MEM_ROOT mem_root;
+ uint idx;
+ KEY *key_info;
DBUG_ENTER("free_table_share");
DBUG_PRINT("enter", ("table: %s.%s", share->db.str, share->table_name.str));
DBUG_ASSERT(share->ref_count == 0);
@@ -426,6 +428,16 @@ void free_table_share(TABLE_SHARE *share)
plugin_unlock(NULL, share->db_plugin);
share->db_plugin= NULL;
+ /* Release fulltext parsers */
+ key_info= share->key_info;
+ for (idx= share->keys; idx; idx--, key_info++)
+ {
+ if (key_info->flags & HA_USES_PARSER)
+ {
+ plugin_unlock(NULL, key_info->parser);
+ key_info->flags= 0;
+ }
+ }
/* We must copy mem_root from share because share is allocated through it */
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
free_root(&mem_root, MYF(0)); // Free's share
@@ -1416,7 +1428,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
*/
if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX)
{
- field->part_of_key= share->keys_in_use;
+ if (field->key_length() == key_part->length &&
+ !(field->flags & BLOB_FLAG))
+ field->part_of_key= share->keys_in_use;
if (field->part_of_sortkey.is_set(key))
field->part_of_sortkey= share->keys_in_use;
}
@@ -1941,22 +1955,11 @@ partititon_err:
int closefrm(register TABLE *table, bool free_share)
{
int error=0;
- uint idx;
- KEY *key_info;
DBUG_ENTER("closefrm");
DBUG_PRINT("enter", ("table: 0x%lx", (long) table));
if (table->db_stat)
error=table->file->close();
- key_info= table->key_info;
- for (idx= table->s->keys; idx; idx--, key_info++)
- {
- if (key_info->flags & HA_USES_PARSER)
- {
- plugin_unlock(NULL, key_info->parser);
- key_info->flags= 0;
- }
- }
my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR));
table->alias= 0;
if (table->field)
diff --git a/sql/table.h b/sql/table.h
index 77bd7bb9e77..a6a256b30b6 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1363,7 +1363,7 @@ struct TABLE_LIST
void cleanup_items();
bool placeholder()
{
- return derived || view || schema_table || create && !table->db_stat ||
+ return derived || view || schema_table || (create && !table->db_stat) ||
!table;
}
void print(THD *thd, String *str, enum_query_type query_type);
@@ -1691,5 +1691,35 @@ static inline void dbug_tmp_restore_column_map(MY_BITMAP *bitmap,
#endif
}
+
+/*
+ Variant of the above : handle both read and write sets.
+ Provide for the possiblity of the read set being the same as the write set
+*/
+static inline void dbug_tmp_use_all_columns(TABLE *table,
+ my_bitmap_map **save,
+ MY_BITMAP *read_set,
+ MY_BITMAP *write_set)
+{
+#ifndef DBUG_OFF
+ save[0]= read_set->bitmap;
+ save[1]= write_set->bitmap;
+ (void) tmp_use_all_columns(table, read_set);
+ (void) tmp_use_all_columns(table, write_set);
+#endif
+}
+
+
+static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set,
+ MY_BITMAP *write_set,
+ my_bitmap_map **old)
+{
+#ifndef DBUG_OFF
+ tmp_restore_column_map(read_set, old[0]);
+ tmp_restore_column_map(write_set, old[1]);
+#endif
+}
+
+
size_t max_row_length(TABLE *table, const uchar *data);
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index a1ff0e29ad1..368ce7e28f3 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1439,6 +1439,17 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
a file, which descriptor is still open. EACCES will be returned
when trying to delete the "to"-file in my_rename().
*/
+ if (share->tina_write_opened)
+ {
+ /*
+ Data file might be opened twice, on table opening stage and
+ during write_row execution. We need to close both instances
+ to satisfy Win.
+ */
+ if (my_close(share->tina_write_filedes, MYF(0)))
+ DBUG_RETURN(my_errno ? my_errno : -1);
+ share->tina_write_opened= FALSE;
+ }
if (my_close(data_file,MYF(0)) || my_close(repair_file, MYF(0)) ||
my_rename(repaired_fname, share->data_file_name, MYF(0)))
DBUG_RETURN(-1);
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 2f1c5e51caa..6cfbd355c40 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2828,7 +2828,7 @@ int ha_federated::info(uint flag)
if (!(row= mysql_fetch_row(result)))
goto error;
- if (flag & HA_STATUS_VARIABLE | HA_STATUS_CONST)
+ if (flag & (HA_STATUS_VARIABLE | HA_STATUS_CONST))
{
/*
deleted is set in ha_federated::info
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index be2914adac4..19863d83874 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -91,7 +91,7 @@ const char **ha_heap::bas_ext() const
int ha_heap::open(const char *name, int mode, uint test_if_locked)
{
if ((test_if_locked & HA_OPEN_INTERNAL_TABLE) ||
- !(file= heap_open(name, mode)) && my_errno == ENOENT)
+ (!(file= heap_open(name, mode)) && my_errno == ENOENT))
{
HA_CREATE_INFO create_info;
internal_table= test(test_if_locked & HA_OPEN_INTERNAL_TABLE);
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index b5e5c5375dc..7410bf7e591 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -15,21 +15,21 @@
# Process this file with automake to create Makefile.in
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
+MYSQLDATAdir= $(localstatedir)
+MYSQLSHAREdir= $(pkgdatadir)
+MYSQLBASEdir= $(prefix)
+MYSQLLIBdir= $(pkglibdir)
+pkgplugindir= $(pkglibdir)/plugin
+INCLUDES= -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/storage/innobase/include \
-I$(top_srcdir)/sql \
- -I$(srcdir)
+ -I$(srcdir)
-DEFS = @DEFS@
+DEFS= @DEFS@
-noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
+noinst_HEADERS= include/btr0btr.h include/btr0btr.ic \
include/btr0cur.h include/btr0cur.ic \
include/btr0pcur.h include/btr0pcur.ic \
include/btr0sea.h include/btr0sea.ic \
@@ -121,9 +121,9 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
include/ut0list.ic include/ut0wqueue.h \
include/ha_prototypes.h handler/ha_innodb.h
-EXTRA_LIBRARIES = libinnobase.a
-noinst_LIBRARIES = @plugin_innobase_static_target@
-libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
+EXTRA_LIBRARIES= libinnobase.a
+noinst_LIBRARIES= @plugin_innobase_static_target@
+libinnobase_a_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \
buf/buf0lru.c buf/buf0rea.c data/data0data.c \
data/data0type.c dict/dict0boot.c \
@@ -156,17 +156,17 @@ libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
handler/ha_innodb.cc
libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
-libinnobase_a_CFLAGS = $(AM_CFLAGS)
+libinnobase_a_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES = ha_innodb.la
+EXTRA_LTLIBRARIES= ha_innodb.la
pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@
-ha_innodb_la_LDFLAGS = -module -rpath $(pkgplugindir)
-ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_innodb_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_innodb_la_SOURCES = $(libinnobase_a_SOURCES)
+ha_innodb_la_LDFLAGS= -module -rpath $(pkgplugindir)
+ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
+ha_innodb_la_CFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
+ha_innodb_la_SOURCES= $(libinnobase_a_SOURCES)
-EXTRA_DIST = CMakeLists.txt plug.in \
+EXTRA_DIST= CMakeLists.txt plug.in \
pars/make_bison.sh pars/make_flex.sh \
pars/pars0grm.y pars/pars0lex.l
diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
index 2fe3606a390..3482e16497a 100644
--- a/storage/innobase/btr/btr0sea.c
+++ b/storage/innobase/btr/btr0sea.c
@@ -161,6 +161,7 @@ btr_search_info_create(
info->magic_n = BTR_SEARCH_MAGIC_N;
#endif /* UNIV_DEBUG */
+ info->ref_count = 0;
info->root_guess = NULL;
info->hash_analysis = 0;
@@ -184,6 +185,31 @@ btr_search_info_create(
return(info);
}
+/*********************************************************************
+Returns the value of ref_count. The value is protected by
+btr_search_latch. */
+ulint
+btr_search_info_get_ref_count(
+/*==========================*/
+ /* out: ref_count value. */
+ btr_search_t* info) /* in: search info. */
+{
+ ulint ret;
+
+ ut_ad(info);
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
+
+ rw_lock_s_lock(&btr_search_latch);
+ ret = info->ref_count;
+ rw_lock_s_unlock(&btr_search_latch);
+
+ return(ret);
+}
+
/*************************************************************************
Updates the search info of an index about hash successes. NOTE that info
is NOT protected by any semaphore, to save CPU time! Do not assume its fields
@@ -1022,8 +1048,12 @@ next_rec:
ha_remove_all_nodes_to_page(table, folds[i], page);
}
+ ut_a(index->search_info->ref_count > 0);
+ index->search_info->ref_count--;
+
block->is_hashed = FALSE;
block->index = NULL;
+
cleanup:
if (UNIV_UNLIKELY(block->n_pointers)) {
/* Corruption */
@@ -1244,6 +1274,15 @@ btr_search_build_page_hash_index(
goto exit_func;
}
+ /* This counter is decremented every time we drop page
+ hash index entries and is incremented here. Since we can
+ rebuild hash index for a page that is already hashed, we
+ have to take care not to increment the counter in that
+ case. */
+ if (!block->is_hashed) {
+ index->search_info->ref_count++;
+ }
+
block->is_hashed = TRUE;
block->n_hash_helps = 0;
diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
index f3913ed49b7..d3c787d1578 100644
--- a/storage/innobase/buf/buf0lru.c
+++ b/storage/innobase/buf/buf0lru.c
@@ -42,6 +42,11 @@ initial segment in buf_LRU_get_recent_limit */
#define BUF_LRU_INITIAL_RATIO 8
+/* When dropping the search hash index entries before deleting an ibd
+file, we build a local array of pages belonging to that tablespace
+in the buffer pool. Following is the size of that array. */
+#define BUF_LRU_DROP_SEARCH_HASH_SIZE 1024
+
/* If we switch on the InnoDB monitor because there are too few available
frames in the buffer pool, we set this to TRUE */
ibool buf_lru_switched_on_innodb_mon = FALSE;
@@ -65,6 +70,120 @@ buf_LRU_block_free_hashed_page(
buf_block_t* block); /* in: block, must contain a file page and
be in a state where it can be freed */
+/**********************************************************************
+Attempts to drop page hash index on a batch of pages belonging to a
+particular space id. */
+static
+void
+buf_LRU_drop_page_hash_batch(
+/*=========================*/
+ ulint id, /* in: space id */
+ const ulint* arr, /* in: array of page_no */
+ ulint count) /* in: number of entries in array */
+{
+ ulint i;
+
+ ut_ad(arr != NULL);
+ ut_ad(count <= BUF_LRU_DROP_SEARCH_HASH_SIZE);
+
+ for (i = 0; i < count; ++i) {
+ btr_search_drop_page_hash_when_freed(id, arr[i]);
+ }
+}
+
+/**********************************************************************
+When doing a DROP TABLE/DISCARD TABLESPACE we have to drop all page
+hash index entries belonging to that table. This function tries to
+do that in batch. Note that this is a 'best effort' attempt and does
+not guarantee that ALL hash entries will be removed. */
+static
+void
+buf_LRU_drop_page_hash_for_tablespace(
+/*==================================*/
+ ulint id) /* in: space id */
+{
+ buf_block_t* block;
+ ulint* page_arr;
+ ulint num_entries;
+
+ page_arr = ut_malloc(sizeof(ulint)
+ * BUF_LRU_DROP_SEARCH_HASH_SIZE);
+ mutex_enter(&buf_pool->mutex);
+
+scan_again:
+ num_entries = 0;
+ block = UT_LIST_GET_LAST(buf_pool->LRU);
+
+ while (block != NULL) {
+ buf_block_t* prev_block;
+
+ mutex_enter(&block->mutex);
+ prev_block = UT_LIST_GET_PREV(LRU, block);
+
+ ut_a(block->state == BUF_BLOCK_FILE_PAGE);
+
+ if (block->space != id
+ || block->buf_fix_count > 0
+ || block->io_fix != 0) {
+ /* We leave the fixed pages as is in this scan.
+ To be dealt with later in the final scan. */
+ mutex_exit(&block->mutex);
+ goto next_page;
+ }
+
+ ut_ad(block->space == id);
+ if (block->is_hashed) {
+
+ /* Store the offset(i.e.: page_no) in the array
+ so that we can drop hash index in a batch
+ later. */
+ page_arr[num_entries] = block->offset;
+ mutex_exit(&block->mutex);
+ ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE);
+ ++num_entries;
+
+ if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) {
+ goto next_page;
+ }
+ /* Array full. We release the buf_pool->mutex to
+ obey the latching order. */
+ mutex_exit(&buf_pool->mutex);
+
+ buf_LRU_drop_page_hash_batch(id, page_arr,
+ num_entries);
+ num_entries = 0;
+ mutex_enter(&buf_pool->mutex);
+ } else {
+ mutex_exit(&block->mutex);
+ }
+
+next_page:
+ /* Note that we may have released the buf_pool->mutex
+ above after reading the prev_block during processing
+ of a page_hash_batch (i.e.: when the array was full).
+ This means that prev_block can change in LRU list.
+ This is OK because this function is a 'best effort'
+ to drop as many search hash entries as possible and
+ it does not guarantee that ALL such entries will be
+ dropped. */
+ block = prev_block;
+
+ /* If, however, block has been removed from LRU list
+ to the free list then we should restart the scan.
+ block->state is protected by buf_pool->mutex. */
+ if (block && block->state != BUF_BLOCK_FILE_PAGE) {
+ ut_a(num_entries == 0);
+ goto scan_again;
+ }
+ }
+
+ mutex_exit(&buf_pool->mutex);
+
+ /* Drop any remaining batch of search hashed pages. */
+ buf_LRU_drop_page_hash_batch(id, page_arr, num_entries);
+ ut_free(page_arr);
+}
+
/**********************************************************************
Invalidates all pages belonging to a given tablespace when we are deleting
the data file(s) of that tablespace. */
@@ -78,6 +197,14 @@ buf_LRU_invalidate_tablespace(
ulint page_no;
ibool all_freed;
+ /* Before we attempt to drop pages one by one we first
+ attempt to drop page hash index entries in batches to make
+ it more efficient. The batching attempt is a best effort
+ attempt and does not guarantee that all pages hash entries
+ will be dropped. We get rid of remaining page hash entries
+ one by one below. */
+ buf_LRU_drop_page_hash_for_tablespace(id);
+
scan_again:
mutex_enter(&(buf_pool->mutex));
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index 5eaa44b4615..c7a57d6a2b8 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -422,8 +422,7 @@ dict_table_autoinc_lock(
}
/************************************************************************
-Initializes the autoinc counter. It is not an error to initialize an already
-initialized counter. */
+Unconditionally set the autoinc counter. */
void
dict_table_autoinc_initialize(
@@ -433,7 +432,6 @@ dict_table_autoinc_initialize(
{
ut_ad(mutex_own(&table->autoinc_mutex));
- table->autoinc_inited = TRUE;
table->autoinc = value;
}
@@ -447,32 +445,25 @@ dict_table_autoinc_read(
/* out: value for a new row, or 0 */
dict_table_t* table) /* in: table */
{
- ib_longlong value;
-
ut_ad(mutex_own(&table->autoinc_mutex));
- if (!table->autoinc_inited) {
-
- value = 0;
- } else {
- value = table->autoinc;
- }
-
- return(value);
+ return(table->autoinc);
}
/************************************************************************
Updates the autoinc counter if the value supplied is greater than the
-current value. If not inited, does nothing. */
+current value. */
void
-dict_table_autoinc_update(
-/*======================*/
+dict_table_autoinc_update_if_greater(
+/*=================================*/
dict_table_t* table, /* in: table */
ib_ulonglong value) /* in: value which was assigned to a row */
{
- if (table->autoinc_inited && value > table->autoinc) {
+ ut_ad(mutex_own(&table->autoinc_mutex));
+
+ if (value > table->autoinc) {
table->autoinc = value;
}
@@ -1394,12 +1385,59 @@ dict_index_remove_from_cache(
dict_index_t* index) /* in, own: index */
{
ulint size;
+ ulint retries = 0;
+ btr_search_t* info;
ut_ad(table && index);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(mutex_own(&(dict_sys->mutex)));
+ /* We always create search info whether or not adaptive
+ hash index is enabled or not. */
+ info = index->search_info;
+ ut_ad(info);
+
+ /* We are not allowed to free the in-memory index struct
+ dict_index_t until all entries in the adaptive hash index
+ that point to any of the page belonging to his b-tree index
+ are dropped. This is so because dropping of these entries
+ require access to dict_index_t struct. To avoid such scenario
+ We keep a count of number of such pages in the search_info and
+ only free the dict_index_t struct when this count drops to
+ zero. */
+
+ for (;;) {
+ ulint ref_count = btr_search_info_get_ref_count(info);
+ if (ref_count == 0) {
+ break;
+ }
+
+ /* Sleep for 10ms before trying again. */
+ os_thread_sleep(10000);
+ ++retries;
+
+ if (retries % 500 == 0) {
+ /* No luck after 5 seconds of wait. */
+ fprintf(stderr, "InnoDB: Error: Waited for"
+ " %lu secs for hash index"
+ " ref_count (%lu) to drop"
+ " to 0.\n"
+ "index: \"%s\""
+ " table: \"%s\"\n",
+ retries/100,
+ ref_count,
+ index->name,
+ table->name);
+ }
+
+ /* To avoid a hang here we commit suicide if the
+ ref_count doesn't drop to zero in 600 seconds. */
+ if (retries >= 60000) {
+ ut_error;
+ }
+ }
+
rw_lock_free(&index->lock);
/* Remove the index from the list of indexes of the table */
diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
index 47cf7a0bc9c..168771ca307 100644
--- a/storage/innobase/dict/dict0mem.c
+++ b/storage/innobase/dict/dict0mem.c
@@ -89,11 +89,7 @@ dict_mem_table_create(
mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
- table->autoinc_inited = FALSE;
-
- /* The actual increment value will be set by MySQL, we simply
- default to 1 here.*/
- table->autoinc_increment = 1;
+ table->autoinc = 0;
/* The number of transactions that are either waiting on the
AUTOINC lock or have been granted the lock. */
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 887acacbd1f..bf777b982db 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -507,6 +507,18 @@ thd_has_edited_nontrans_tables(
return((ibool) thd_non_transactional_update((THD*) thd));
}
+/**********************************************************************
+Returns true if the thread is executing a SELECT statement. */
+extern "C"
+ibool
+thd_is_select(
+/*==========*/
+ /* out: true if thd is executing SELECT */
+ const void* thd) /* in: thread handle (THD*) */
+{
+ return(thd_sql_command((const THD*) thd) == SQLCOM_SELECT);
+}
+
/************************************************************************
Obtain the InnoDB transaction of a MySQL thread. */
inline
@@ -909,6 +921,81 @@ innobase_convert_string(
errors));
}
+/*************************************************************************
+Compute the next autoinc value.
+
+For MySQL replication the autoincrement values can be partitioned among
+the nodes. The offset is the start or origin of the autoincrement value
+for a particular node. For n nodes the increment will be n and the offset
+will be in the interval [1, n]. The formula tries to allocate the next
+value for a particular node.
+
+Note: This function is also called with increment set to the number of
+values we want to reserve for multi-value inserts e.g.,
+
+ INSERT INTO T VALUES(), (), ();
+
+innobase_next_autoinc() will be called with increment set to
+n * 3 where autoinc_lock_mode != TRADITIONAL because we want
+to reserve 3 values for the multi-value INSERT above. */
+static
+ulonglong
+innobase_next_autoinc(
+/*==================*/
+ /* out: the next value */
+ ulonglong current, /* in: Current value */
+ ulonglong increment, /* in: increment current by */
+ ulonglong offset, /* in: AUTOINC offset */
+ ulonglong max_value) /* in: max value for type */
+{
+ ulonglong next_value;
+
+ /* Should never be 0. */
+ ut_a(increment > 0);
+
+ if (max_value <= current) {
+ next_value = max_value;
+ } else if (offset <= 1) {
+ /* Offset 0 and 1 are the same, because there must be at
+ least one node in the system. */
+ if (max_value - current <= increment) {
+ next_value = max_value;
+ } else {
+ next_value = current + increment;
+ }
+ } else {
+ if (current > offset) {
+ next_value = ((current - offset) / increment) + 1;
+ } else {
+ next_value = ((offset - current) / increment) + 1;
+ }
+
+ ut_a(increment > 0);
+ ut_a(next_value > 0);
+
+ /* Check for multiplication overflow. */
+ if (increment > (max_value / next_value)) {
+
+ next_value = max_value;
+ } else {
+ next_value *= increment;
+
+ ut_a(max_value >= next_value);
+
+ /* Check for overflow. */
+ if (max_value - next_value <= offset) {
+ next_value = max_value;
+ } else {
+ next_value += offset;
+ }
+ }
+ }
+
+ ut_a(next_value <= max_value);
+
+ return(next_value);
+}
+
/*************************************************************************
Gets the InnoDB transaction handle for a MySQL handler object, creates
an InnoDB transaction struct if the corresponding MySQL thread struct still
@@ -2262,6 +2349,44 @@ normalize_table_name(
#endif
}
+/************************************************************************
+Set the autoinc column max value. This should only be called once from
+ha_innobase::open(). Therefore there's no need for a covering lock. */
+
+ulong
+ha_innobase::innobase_initialize_autoinc()
+/*======================================*/
+{
+ dict_index_t* index;
+ ulonglong auto_inc;
+ const char* col_name;
+ ulint error = DB_SUCCESS;
+ dict_table_t* innodb_table = prebuilt->table;
+
+ col_name = table->found_next_number_field->field_name;
+ index = innobase_get_index(table->s->next_number_index);
+
+ /* Execute SELECT MAX(col_name) FROM TABLE; */
+ error = row_search_max_autoinc(index, col_name, &auto_inc);
+
+ if (error == DB_SUCCESS) {
+
+ /* At the this stage we dont' know the increment
+ or the offset, so use default inrement of 1. */
+ ++auto_inc;
+
+ dict_table_autoinc_initialize(innodb_table, auto_inc);
+
+ } else {
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Error: (%lu) Couldn't read "
+ "the MAX(%s) autoinc value from the "
+ "index (%s).\n", error, col_name, index->name);
+ }
+
+ return(ulong(error));
+}
+
/*********************************************************************
Creates and opens a handle to a table which already exists in an InnoDB
database. */
@@ -2286,6 +2411,14 @@ ha_innobase::open(
UT_NOT_USED(test_if_locked);
thd = ha_thd();
+
+ /* Under some cases MySQL seems to call this function while
+ holding btr_search_latch. This breaks the latching order as
+ we acquire dict_sys->mutex below and leads to a deadlock. */
+ if (thd != NULL) {
+ innobase_release_temporary_latches(ht, thd);
+ }
+
normalize_table_name(norm_name, name);
user_thd = NULL;
@@ -2445,6 +2578,26 @@ retry:
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
+ /* Only if the table has an AUTOINC column. */
+ if (prebuilt->table != NULL && table->found_next_number_field != NULL) {
+ ulint error;
+
+ dict_table_autoinc_lock(prebuilt->table);
+
+ /* Since a table can already be "open" in InnoDB's internal
+ data dictionary, we only init the autoinc counter once, the
+ first time the table is loaded. We can safely reuse the
+ autoinc value from a previous MySQL open. */
+ if (dict_table_autoinc_read(prebuilt->table) == 0) {
+
+ error = innobase_initialize_autoinc();
+ /* Should always succeed! */
+ ut_a(error == DB_SUCCESS);
+ }
+
+ dict_table_autoinc_unlock(prebuilt->table);
+ }
+
DBUG_RETURN(0);
}
@@ -3251,6 +3404,59 @@ skip_field:
}
}
+/************************************************************************
+Get the upper limit of the MySQL integral type. */
+
+ulonglong
+ha_innobase::innobase_get_int_col_max_value(
+/*========================================*/
+ const Field* field)
+{
+ ulonglong max_value = 0;
+
+ switch(field->key_type()) {
+ /* TINY */
+ case HA_KEYTYPE_BINARY:
+ max_value = 0xFFULL;
+ break;
+ case HA_KEYTYPE_INT8:
+ max_value = 0x7FULL;
+ break;
+ /* SHORT */
+ case HA_KEYTYPE_USHORT_INT:
+ max_value = 0xFFFFULL;
+ break;
+ case HA_KEYTYPE_SHORT_INT:
+ max_value = 0x7FFFULL;
+ break;
+ /* MEDIUM */
+ case HA_KEYTYPE_UINT24:
+ max_value = 0xFFFFFFULL;
+ break;
+ case HA_KEYTYPE_INT24:
+ max_value = 0x7FFFFFULL;
+ break;
+ /* LONG */
+ case HA_KEYTYPE_ULONG_INT:
+ max_value = 0xFFFFFFFFULL;
+ break;
+ case HA_KEYTYPE_LONG_INT:
+ max_value = 0x7FFFFFFFULL;
+ break;
+ /* BIG */
+ case HA_KEYTYPE_ULONGLONG:
+ max_value = 0xFFFFFFFFFFFFFFFFULL;
+ break;
+ case HA_KEYTYPE_LONGLONG:
+ max_value = 0x7FFFFFFFFFFFFFFFULL;
+ break;
+ default:
+ ut_error;
+ }
+
+ return(max_value);
+}
+
/************************************************************************
This special handling is really to overcome the limitations of MySQL's
binlogging. We need to eliminate the non-determinism that will arise in
@@ -3259,7 +3465,7 @@ min value of the autoinc interval. Once that is fixed we can get rid of
the special lock handling.*/
ulong
-ha_innobase::innobase_autoinc_lock(void)
+ha_innobase::innobase_lock_autoinc(void)
/*====================================*/
/* out: DB_SUCCESS if all OK else
error code */
@@ -3324,7 +3530,7 @@ ha_innobase::innobase_reset_autoinc(
{
ulint error;
- error = innobase_autoinc_lock();
+ error = innobase_lock_autoinc();
if (error == DB_SUCCESS) {
@@ -3349,11 +3555,11 @@ ha_innobase::innobase_set_max_autoinc(
{
ulint error;
- error = innobase_autoinc_lock();
+ error = innobase_lock_autoinc();
if (error == DB_SUCCESS) {
- dict_table_autoinc_update(prebuilt->table, auto_inc);
+ dict_table_autoinc_update_if_greater(prebuilt->table, auto_inc);
dict_table_autoinc_unlock(prebuilt->table);
}
@@ -3473,8 +3679,20 @@ no_commit:
/* This is the case where the table has an auto-increment column */
if (table->next_number_field && record == table->record[0]) {
+ /* Reset the error code before calling
+ innobase_get_auto_increment(). */
+ prebuilt->autoinc_error = DB_SUCCESS;
+
if ((error = update_auto_increment())) {
+ /* We don't want to mask autoinc overflow errors. */
+ if (prebuilt->autoinc_error != DB_SUCCESS) {
+ error = prebuilt->autoinc_error;
+
+ goto report_error;
+ }
+
+ /* MySQL errors are passed straight back. */
goto func_exit;
}
@@ -3498,6 +3716,7 @@ no_commit:
if (auto_inc_used) {
ulint err;
ulonglong auto_inc;
+ ulonglong col_max_value;
/* Note the number of rows processed for this statement, used
by get_auto_increment() to determine the number of AUTO-INC
@@ -3507,6 +3726,11 @@ no_commit:
--trx->n_autoinc_rows;
}
+ /* We need the upper limit of the col type to check for
+ whether we update the table autoinc counter or not. */
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
+
/* Get the value that MySQL attempted to store in the table.*/
auto_inc = table->next_number_field->val_int();
@@ -3545,22 +3769,19 @@ no_commit:
update the table upper limit. Note: last_value
will be 0 if get_auto_increment() was not called.*/
- if (auto_inc > prebuilt->last_value) {
+ if (auto_inc <= col_max_value
+ && auto_inc > prebuilt->autoinc_last_value) {
set_max_autoinc:
- ut_a(prebuilt->table->autoinc_increment > 0);
+ ut_a(prebuilt->autoinc_increment > 0);
- ulonglong have;
ulonglong need;
+ ulonglong offset;
- /* Check for overflow conditions. */
- need = prebuilt->table->autoinc_increment;
- have = ~0x0ULL - auto_inc;
+ offset = prebuilt->autoinc_offset;
+ need = prebuilt->autoinc_increment;
- if (have < need) {
- need = have;
- }
-
- auto_inc += need;
+ auto_inc = innobase_next_autoinc(
+ auto_inc, need, offset, col_max_value);
err = innobase_set_max_autoinc(auto_inc);
@@ -3574,6 +3795,7 @@ set_max_autoinc:
innodb_srv_conc_exit_innodb(prebuilt->trx);
+report_error:
error = convert_error_code_to_mysql(error, user_thd);
func_exit:
@@ -3755,6 +3977,8 @@ ha_innobase::update_row(
ut_a(prebuilt->trx == trx);
+ ha_statistic_increment(&SSV::ha_update_count);
+
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
@@ -3795,12 +4019,26 @@ ha_innobase::update_row(
&& (trx->duplicates & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))
== TRX_DUP_IGNORE) {
- longlong auto_inc;
+ ulonglong auto_inc;
+ ulonglong col_max_value;
auto_inc = table->next_number_field->val_int();
- if (auto_inc != 0) {
- auto_inc += prebuilt->table->autoinc_increment;
+ /* We need the upper limit of the col type to check for
+ whether we update the table autoinc counter or not. */
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
+
+ if (auto_inc <= col_max_value && auto_inc != 0) {
+
+ ulonglong need;
+ ulonglong offset;
+
+ offset = prebuilt->autoinc_offset;
+ need = prebuilt->autoinc_increment;
+
+ auto_inc = innobase_next_autoinc(
+ auto_inc, need, offset, col_max_value);
error = innobase_set_max_autoinc(auto_inc);
}
@@ -3844,29 +4082,7 @@ ha_innobase::delete_row(
ut_a(prebuilt->trx == trx);
- /* Only if the table has an AUTOINC column */
- if (table->found_next_number_field && record == table->record[0]) {
- ulonglong dummy = 0;
-
- /* First check whether the AUTOINC sub-system has been
- initialized using the AUTOINC mutex. If not then we
- do it the "proper" way, by acquiring the heavier locks. */
- dict_table_autoinc_lock(prebuilt->table);
-
- if (!prebuilt->table->autoinc_inited) {
- dict_table_autoinc_unlock(prebuilt->table);
-
- error = innobase_get_auto_increment(&dummy);
-
- if (error == DB_SUCCESS) {
- dict_table_autoinc_unlock(prebuilt->table);
- } else {
- goto error_exit;
- }
- } else {
- dict_table_autoinc_unlock(prebuilt->table);
- }
- }
+ ha_statistic_increment(&SSV::ha_delete_count);
if (!prebuilt->upd_node) {
row_get_prebuilt_update_vector(prebuilt);
@@ -3882,7 +4098,6 @@ ha_innobase::delete_row(
innodb_srv_conc_exit_innodb(trx);
-error_exit:
error = convert_error_code_to_mysql(error, user_thd);
/* Tell the InnoDB server that there might be work for
@@ -4986,6 +5201,29 @@ ha_innobase::create(
DBUG_ENTER("ha_innobase::create");
DBUG_ASSERT(thd != NULL);
+ DBUG_ASSERT(create_info != NULL);
+
+#ifdef __WIN__
+ /* Names passed in from server are in two formats:
+ 1. /: for normal table creation
+ 2. full path: for temp table creation, or sym link
+
+ When srv_file_per_table is on, check for full path pattern, i.e.
+ X:\dir\..., X is a driver letter, or
+ \\dir1\dir2\..., UNC path
+ returns error if it is in full path format, but not creating a temp.
+ table. Currently InnoDB does not support symbolic link on Windows. */
+
+ if (srv_file_per_table
+ && (!create_info->options & HA_LEX_CREATE_TMP_TABLE)) {
+
+ if ((name[1] == ':')
+ || (name[0] == '\\' && name[1] == '\\')) {
+ sql_print_error("Cannot create table %s\n", name);
+ DBUG_RETURN(HA_ERR_GENERIC);
+ }
+ }
+#endif
if (form->s->fields > 1000) {
/* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020,
@@ -5216,7 +5454,8 @@ ha_innobase::delete_all_rows(void)
if (thd_sql_command(user_thd) != SQLCOM_TRUNCATE) {
fallback:
/* We only handle TRUNCATE TABLE t as a special case.
- DELETE FROM t will have to use ha_innobase::delete_row(). */
+ DELETE FROM t will have to use ha_innobase::delete_row(),
+ because DELETE is transactional while TRUNCATE is not. */
DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
}
@@ -5797,7 +6036,7 @@ ha_innobase::info(
not be updated. This will force write_row() into
attempting an update of the table's AUTOINC counter. */
- prebuilt->last_value = 0;
+ prebuilt->autoinc_last_value = 0;
}
stats.records = (ha_rows)n_rows;
@@ -5818,9 +6057,39 @@ ha_innobase::info(
so the "old" value can remain. delete_length is initialized
to 0 in the ha_statistics' constructor. */
if (!(flag & HA_STATUS_NO_LOCK)) {
- stats.delete_length =
- fsp_get_available_space_in_free_extents(
- ib_table->space) * 1024;
+
+ /* lock the data dictionary to avoid races with
+ ibd_file_missing and tablespace_discarded */
+ row_mysql_lock_data_dictionary(prebuilt->trx);
+
+ /* ib_table->space must be an existent tablespace */
+ if (!ib_table->ibd_file_missing
+ && !ib_table->tablespace_discarded) {
+
+ stats.delete_length =
+ fsp_get_available_space_in_free_extents(
+ ib_table->space) * 1024;
+ } else {
+
+ THD* thd;
+
+ thd = ha_thd();
+
+ push_warning_printf(
+ thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_CANT_GET_STAT,
+ "InnoDB: Trying to get the free "
+ "space for table %s but its "
+ "tablespace has been discarded or "
+ "the .ibd file is missing. Setting "
+ "the free space to zero.",
+ ib_table->name);
+
+ stats.delete_length = 0;
+ }
+
+ row_mysql_unlock_data_dictionary(prebuilt->trx);
}
stats.check_time = 0;
@@ -5905,29 +6174,7 @@ ha_innobase::info(
}
if (flag & HA_STATUS_AUTO && table->found_next_number_field) {
- ulonglong auto_inc;
- int ret;
-
- /* The following function call can the first time fail in
- a lock wait timeout error because it reserves the auto-inc
- lock on the table. If it fails, then someone is already initing
- the auto-inc counter, and the second call is guaranteed to
- succeed. */
-
- ret = innobase_read_and_init_auto_inc(&auto_inc);
-
- if (ret != 0) {
- ret = innobase_read_and_init_auto_inc(&auto_inc);
-
- if (ret != 0) {
- sql_print_error("Cannot get table %s auto-inc"
- "counter value in ::info\n",
- ib_table->name);
- auto_inc = 0;
- }
- }
-
- stats.auto_increment_value = auto_inc;
+ stats.auto_increment_value = innobase_peek_autoinc();
}
prebuilt->trx->op_info = (char*)"";
@@ -6390,15 +6637,26 @@ ha_innobase::extra(
return(0);
}
+/**********************************************************************
+Reset state of file to after 'open'.
+This function is called after every statement for all tables used
+by that statement. */
int ha_innobase::reset()
{
- if (prebuilt->blob_heap) {
- row_mysql_prebuilt_free_blob_heap(prebuilt);
- }
- reset_template(prebuilt);
- return 0;
-}
+ if (prebuilt->blob_heap) {
+ row_mysql_prebuilt_free_blob_heap(prebuilt);
+ }
+ reset_template(prebuilt);
+
+ /* TODO: This should really be reset in reset_template() but for now
+ it's safer to do it explicitly here. */
+
+ /* This is a statement level counter. */
+ prebuilt->autoinc_last_value = 0;
+
+ return(0);
+}
/**********************************************************************
MySQL calls this function at the start of each SQL statement inside LOCK
@@ -7247,169 +7505,59 @@ ha_innobase::store_lock(
return(to);
}
-/***********************************************************************
-This function initializes the auto-inc counter if it has not been
-initialized yet. This function does not change the value of the auto-inc
-counter if it already has been initialized. In parameter ret returns
-the value of the auto-inc counter. */
-
-int
-ha_innobase::innobase_read_and_init_auto_inc(
-/*=========================================*/
- /* out: 0 or generic MySQL
- error code */
- ulonglong* value) /* out: the autoinc value */
-{
- ulonglong auto_inc;
- ibool stmt_start;
- int mysql_error = 0;
- dict_table_t* innodb_table = prebuilt->table;
- ibool trx_was_not_started = FALSE;
-
- ut_a(prebuilt);
- ut_a(prebuilt->table);
-
- /* Remember if we are in the beginning of an SQL statement.
- This function must not change that flag. */
- stmt_start = prebuilt->sql_stat_start;
-
- /* Prepare prebuilt->trx in the table handle */
- update_thd(ha_thd());
-
- if (prebuilt->trx->conc_state == TRX_NOT_STARTED) {
- trx_was_not_started = TRUE;
- }
-
- /* In case MySQL calls this in the middle of a SELECT query, release
- possible adaptive hash latch to avoid deadlocks of threads */
-
- trx_search_latch_release_if_reserved(prebuilt->trx);
-
- dict_table_autoinc_lock(prebuilt->table);
-
- auto_inc = dict_table_autoinc_read(prebuilt->table);
-
- /* Was the AUTOINC counter reset during normal processing, if
- so then we simply start count from 1. No need to go to the index.*/
- if (auto_inc == 0 && innodb_table->autoinc_inited) {
- ++auto_inc;
- dict_table_autoinc_initialize(innodb_table, auto_inc);
- }
-
- if (auto_inc == 0) {
- dict_index_t* index;
- ulint error;
- const char* autoinc_col_name;
-
- ut_a(!innodb_table->autoinc_inited);
-
- index = innobase_get_index(table->s->next_number_index);
-
- autoinc_col_name = table->found_next_number_field->field_name;
-
- error = row_search_max_autoinc(
- index, autoinc_col_name, &auto_inc);
-
- if (error == DB_SUCCESS) {
- if (auto_inc < ~0x0ULL) {
- ++auto_inc;
- }
- dict_table_autoinc_initialize(innodb_table, auto_inc);
- } else {
- ut_print_timestamp(stderr);
- fprintf(stderr, " InnoDB: Error: (%lu) Couldn't read "
- "the max AUTOINC value from the index (%s).\n",
- error, index->name);
-
- mysql_error = 1;
- }
- }
-
- *value = auto_inc;
-
- dict_table_autoinc_unlock(prebuilt->table);
-
- /* Since MySQL does not seem to call autocommit after SHOW TABLE
- STATUS (even if we would register the trx here), we commit our
- transaction here if it was started here. This is to eliminate a
- dangling transaction. If the user had AUTOCOMMIT=0, then SHOW
- TABLE STATUS does leave a dangling transaction if the user does not
- himself call COMMIT. */
-
- if (trx_was_not_started) {
-
- innobase_commit_low(prebuilt->trx);
- }
-
- prebuilt->sql_stat_start = stmt_start;
-
- return(mysql_error);
-}
-
/*******************************************************************************
-Read the next autoinc value, initialize the table if it's not initialized.
-On return if there is no error then the tables AUTOINC lock is locked.*/
+Read the next autoinc value. Acquire the relevant locks before reading
+the AUTOINC value. If SUCCESS then the table AUTOINC mutex will be locked
+on return and all relevant locks acquired. */
ulong
-ha_innobase::innobase_get_auto_increment(
-/*=====================================*/
+ha_innobase::innobase_get_autoinc(
+/*==============================*/
+ /* out: DB_SUCCESS or error code */
ulonglong* value) /* out: autoinc value */
{
- ulong error;
+ *value = 0;
+
+ prebuilt->autoinc_error = innobase_lock_autoinc();
- *value = 0;
+ if (prebuilt->autoinc_error == DB_SUCCESS) {
- /* Note: If the table is not initialized when we attempt the
- read below. We initialize the table's auto-inc counter and
- always do a reread of the AUTOINC value. */
- do {
- error = innobase_autoinc_lock();
+ /* Determine the first value of the interval */
+ *value = dict_table_autoinc_read(prebuilt->table);
- if (error == DB_SUCCESS) {
- ulonglong autoinc;
+ /* It should have been initialized during open. */
+ ut_a(*value != 0);
+ }
+
+ return(ulong(prebuilt->autoinc_error));
+}
- /* Determine the first value of the interval */
- autoinc = dict_table_autoinc_read(prebuilt->table);
+/***********************************************************************
+This function reads the global auto-inc counter. It doesn't use the
+AUTOINC lock even if the lock mode is set to TRADITIONAL. */
- /* We need to initialize the AUTO-INC value, for
- that we release all locks.*/
- if (autoinc == 0) {
- trx_t* trx;
+ulonglong
+ha_innobase::innobase_peek_autoinc()
+/*================================*/
+ /* out: the autoinc value */
+{
+ ulonglong auto_inc;
+ dict_table_t* innodb_table;
- trx = prebuilt->trx;
- dict_table_autoinc_unlock(prebuilt->table);
+ ut_a(prebuilt != NULL);
+ ut_a(prebuilt->table != NULL);
- /* If we had reserved the AUTO-INC
- lock in this SQL statement we release
- it before retrying.*/
- row_unlock_table_autoinc_for_mysql(trx);
+ innodb_table = prebuilt->table;
- /* Just to make sure */
- ut_a(!trx->auto_inc_lock);
+ dict_table_autoinc_lock(innodb_table);
- int mysql_error;
+ auto_inc = dict_table_autoinc_read(innodb_table);
- mysql_error = innobase_read_and_init_auto_inc(
- &autoinc);
+ ut_a(auto_inc > 0);
- if (mysql_error) {
- error = DB_ERROR;
- }
- } else {
- *value = autoinc;
- }
- /* A deadlock error during normal processing is OK
- and can be ignored. */
- } else if (error != DB_DEADLOCK) {
-
- sql_print_error("InnoDB: Error: %lu in "
- "::innobase_get_auto_increment()",
- error);
- }
-
- } while (*value == 0 && error == DB_SUCCESS);
-
- return(error);
+ dict_table_autoinc_unlock(innodb_table);
+
+ return(auto_inc);
}
/*******************************************************************************
@@ -7436,7 +7584,7 @@ ha_innobase::get_auto_increment(
/* Prepare prebuilt->trx in the table handle */
update_thd(ha_thd());
- error = innobase_get_auto_increment(&autoinc);
+ error = innobase_get_autoinc(&autoinc);
if (error != DB_SUCCESS) {
*first_value = (~(ulonglong) 0);
@@ -7472,7 +7620,7 @@ ha_innobase::get_auto_increment(
set_if_bigger(*first_value, autoinc);
/* Not in the middle of a mult-row INSERT. */
- } else if (prebuilt->last_value == 0) {
+ } else if (prebuilt->autoinc_last_value == 0) {
set_if_bigger(*first_value, autoinc);
}
@@ -7481,35 +7629,40 @@ ha_innobase::get_auto_increment(
/* With old style AUTOINC locking we only update the table's
AUTOINC counter after attempting to insert the row. */
if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) {
- ulonglong have;
ulonglong need;
+ ulonglong next_value;
+ ulonglong col_max_value;
+
+ /* We need the upper limit of the col type to check for
+ whether we update the table autoinc counter or not. */
+ col_max_value = innobase_get_int_col_max_value(
+ table->next_number_field);
- /* Check for overflow conditions. */
need = *nb_reserved_values * increment;
- have = ~0x0ULL - *first_value;
-
- if (have < need) {
- need = have;
- }
/* Compute the last value in the interval */
- prebuilt->last_value = *first_value + need;
+ next_value = innobase_next_autoinc(
+ *first_value, need, offset, col_max_value);
- ut_a(prebuilt->last_value >= *first_value);
+ prebuilt->autoinc_last_value = next_value;
+
+ ut_a(prebuilt->autoinc_last_value >= *first_value);
/* Update the table autoinc variable */
- dict_table_autoinc_update(
- prebuilt->table, prebuilt->last_value);
+ dict_table_autoinc_update_if_greater(
+ prebuilt->table, prebuilt->autoinc_last_value);
} else {
/* This will force write_row() into attempting an update
of the table's AUTOINC counter. */
- prebuilt->last_value = 0;
+ prebuilt->autoinc_last_value = 0;
}
/* The increment to be used to increase the AUTOINC value, we use
this in write_row() and update_row() to increase the autoinc counter
- for columns that are filled by the user.*/
- prebuilt->table->autoinc_increment = increment;
+ for columns that are filled by the user. We need the offset and
+ the increment. */
+ prebuilt->autoinc_offset = offset;
+ prebuilt->autoinc_increment = increment;
dict_table_autoinc_unlock(prebuilt->table);
}
@@ -7534,6 +7687,11 @@ ha_innobase::reset_auto_increment(
DBUG_RETURN(error);
}
+ /* The next value can never be 0. */
+ if (value == 0) {
+ value = 1;
+ }
+
innobase_reset_autoinc(value);
DBUG_RETURN(0);
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 4ffcdb1e3c2..8ca72ee1a60 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -72,12 +72,15 @@ class ha_innobase: public handler
int update_thd(THD* thd);
int change_active_index(uint keynr);
int general_fetch(uchar* buf, uint direction, uint match_mode);
- int innobase_read_and_init_auto_inc(ulonglong* ret);
- ulong innobase_autoinc_lock();
+ ulong innobase_lock_autoinc();
+ ulonglong innobase_peek_autoinc();
ulong innobase_set_max_autoinc(ulonglong auto_inc);
ulong innobase_reset_autoinc(ulonglong auto_inc);
- ulong innobase_get_auto_increment(ulonglong* value);
+ ulong innobase_get_autoinc(ulonglong* value);
+ ulong innobase_update_autoinc(ulonglong auto_inc);
+ ulong innobase_initialize_autoinc();
dict_index_t* innobase_get_index(uint keynr);
+ ulonglong innobase_get_int_col_max_value(const Field* field);
/* Init values for the class: */
public:
diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h
index 281587ad060..6d1c2bb86d3 100644
--- a/storage/innobase/include/btr0sea.h
+++ b/storage/innobase/include/btr0sea.h
@@ -40,6 +40,14 @@ btr_search_info_create(
/*===================*/
/* out, own: search info struct */
mem_heap_t* heap); /* in: heap where created */
+/*********************************************************************
+Returns the value of ref_count. The value is protected by
+btr_search_latch. */
+ulint
+btr_search_info_get_ref_count(
+/*==========================*/
+ /* out: ref_count value. */
+ btr_search_t* info); /* in: search info. */
/*************************************************************************
Updates the search info. */
UNIV_INLINE
@@ -137,6 +145,13 @@ btr_search_validate(void);
/* The search info struct in an index */
struct btr_search_struct{
+ ulint ref_count; /* Number of blocks in this index tree
+ that have search index built
+ i.e. block->index points to this index.
+ Protected by btr_search_latch except
+ when during initialization in
+ btr_search_info_create(). */
+
/* The following fields are not protected by any latch.
Unfortunately, this means that they must be aligned to
the machine word, i.e., they cannot be turned into bit-fields. */
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index f60775c8c2f..7d5ff09c7a6 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -178,8 +178,7 @@ dict_table_autoinc_lock(
/*====================*/
dict_table_t* table); /* in: table */
/************************************************************************
-Initializes the autoinc counter. It is not an error to initialize an already
-initialized counter. */
+Unconditionally set the autoinc counter. */
void
dict_table_autoinc_initialize(
@@ -196,12 +195,12 @@ dict_table_autoinc_read(
/* out: value for a new row, or 0 */
dict_table_t* table); /* in: table */
/************************************************************************
-Updates the autoinc counter if the value supplied is equal or bigger than the
-current value. If not inited, does nothing. */
+Updates the autoinc counter if the value supplied is greater than the
+current value. */
void
-dict_table_autoinc_update(
-/*======================*/
+dict_table_autoinc_update_if_greater(
+/*=================================*/
dict_table_t* table, /* in: table */
ib_ulonglong value); /* in: value which was assigned to a row */
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 2fe72498989..ac28fdb1bae 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -405,17 +405,8 @@ struct dict_table_struct{
mutex_t autoinc_mutex;
/* mutex protecting the autoincrement
counter */
- ibool autoinc_inited;
- /* TRUE if the autoinc counter has been
- inited; MySQL gets the init value by executing
- SELECT MAX(auto inc column) */
ib_ulonglong autoinc;/* autoinc counter value to give to the
next inserted row */
-
- ib_longlong autoinc_increment;
- /* The increment step of the auto increment
- column. Value must be greater than or equal
- to 1 */
ulong n_waiting_or_granted_auto_inc_locks;
/* This counter is used to track the number
of granted and pending autoinc locks on this
@@ -425,6 +416,7 @@ struct dict_table_struct{
acquired the AUTOINC lock or not. Of course
only one transaction can be granted the
lock but there can be multiple waiters. */
+ /*----------------------*/
#ifdef UNIV_DEBUG
ulint magic_n;/* magic number */
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index ef0722321af..6bfc43579b3 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -63,5 +63,14 @@ thd_has_edited_nontrans_tables(
been edited */
void* thd); /* in: thread handle (THD*) */
+/**********************************************************************
+Returns true if the thread is executing a SELECT statement. */
+
+ibool
+thd_is_select(
+/*==========*/
+ /* out: true if thd is executing SELECT */
+ const void* thd); /* in: thread handle (THD*) */
+
#endif
#endif
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index 8b08b6284f6..635724bf5a1 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -463,14 +463,21 @@ void
lock_cancel_waiting_and_release(
/*============================*/
lock_t* lock); /* in: waiting lock request */
+
/*************************************************************************
-Resets all locks, both table and record locks, on a table to be dropped.
-No lock is allowed to be a wait lock. */
+Removes locks on a table to be dropped or truncated.
+If remove_also_table_sx_locks is TRUE then table-level S and X locks are
+also removed in addition to other table-level and record-level locks.
+No lock, that is going to be removed, is allowed to be a wait lock. */
void
-lock_reset_all_on_table(
-/*====================*/
- dict_table_t* table); /* in: table to be dropped */
+lock_remove_all_on_table(
+/*=====================*/
+ dict_table_t* table, /* in: table to be dropped
+ or truncated */
+ ibool remove_also_table_sx_locks);/* in: also removes
+ table S and X locks */
+
/*************************************************************************
Calculates the fold value of a page file address: used in inserting or
searching for a lock in the hash table. */
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index ca9d9c6b8f8..9c3ba558d3c 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -683,7 +683,21 @@ struct row_prebuilt_struct {
to this heap */
mem_heap_t* old_vers_heap; /* memory heap where a previous
version is built in consistent read */
- ulonglong last_value; /* last value of AUTO-INC interval */
+ /*----------------------*/
+ ulonglong autoinc_last_value;/* last value of AUTO-INC interval */
+ ulonglong autoinc_increment;/* The increment step of the auto
+ increment column. Value must be
+ greater than or equal to 1. Required to
+ calculate the next value */
+ ulonglong autoinc_offset; /* The offset passed to
+ get_auto_increment() by MySQL. Required
+ to calculate the next value */
+ ulint autoinc_error; /* The actual error code encountered
+ while trying to init or read the
+ autoinc value from the table. We
+ store it here so that we can return
+ it to MySQL */
+ /*----------------------*/
ulint magic_n2; /* this should be the same as
magic_n */
};
diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic
index 908797f9729..ee640abefa6 100644
--- a/storage/innobase/include/sync0sync.ic
+++ b/storage/innobase/include/sync0sync.ic
@@ -197,7 +197,7 @@ mutex_exit(
{
ut_ad(mutex_own(mutex));
- ut_d(mutex->thread_id = ULINT_UNDEFINED);
+ ut_d(mutex->thread_id = (os_thread_id_t) ULINT_UNDEFINED);
#ifdef UNIV_SYNC_DEBUG
sync_thread_reset_level(mutex);
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index a60ce73c35a..8ad1782b178 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -145,11 +145,15 @@ ib_time_t
ut_time(void);
/*=========*/
/**************************************************************
-Returns system time. */
+Returns system time.
+Upon successful completion, the value 0 is returned; otherwise the
+value -1 is returned and the global variable errno is set to indicate the
+error. */
-void
+int
ut_usectime(
/*========*/
+ /* out: 0 on success, -1 otherwise */
ulint* sec, /* out: seconds since the Epoch */
ulint* ms); /* out: microseconds since the Epoch+*sec */
/**************************************************************
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index c2ede22dccb..173d074cb82 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -3920,15 +3920,25 @@ lock_cancel_waiting_and_release(
trx_end_lock_wait(lock->trx);
}
+/* True if a lock mode is S or X */
+#define IS_LOCK_S_OR_X(lock) \
+ (lock_get_mode(lock) == LOCK_S \
+ || lock_get_mode(lock) == LOCK_X)
+
+
/*************************************************************************
-Resets all record and table locks of a transaction on a table to be dropped.
-No lock is allowed to be a wait lock. */
+Removes locks of a transaction on a table to be dropped.
+If remove_also_table_sx_locks is TRUE then table-level S and X locks are
+also removed in addition to other table-level and record-level locks.
+No lock, that is going to be removed, is allowed to be a wait lock. */
static
void
-lock_reset_all_on_table_for_trx(
-/*============================*/
- dict_table_t* table, /* in: table to be dropped */
- trx_t* trx) /* in: a transaction */
+lock_remove_all_on_table_for_trx(
+/*=============================*/
+ dict_table_t* table, /* in: table to be dropped */
+ trx_t* trx, /* in: a transaction */
+ ibool remove_also_table_sx_locks)/* in: also removes
+ table S and X locks */
{
lock_t* lock;
lock_t* prev_lock;
@@ -3946,7 +3956,9 @@ lock_reset_all_on_table_for_trx(
lock_rec_discard(lock);
} else if (lock_get_type(lock) & LOCK_TABLE
- && lock->un_member.tab_lock.table == table) {
+ && lock->un_member.tab_lock.table == table
+ && (remove_also_table_sx_locks
+ || !IS_LOCK_S_OR_X(lock))) {
ut_a(!lock_get_wait(lock));
@@ -3958,26 +3970,65 @@ lock_reset_all_on_table_for_trx(
}
/*************************************************************************
-Resets all locks, both table and record locks, on a table to be dropped.
-No lock is allowed to be a wait lock. */
+Removes locks on a table to be dropped or truncated.
+If remove_also_table_sx_locks is TRUE then table-level S and X locks are
+also removed in addition to other table-level and record-level locks.
+No lock, that is going to be removed, is allowed to be a wait lock. */
void
-lock_reset_all_on_table(
-/*====================*/
- dict_table_t* table) /* in: table to be dropped */
+lock_remove_all_on_table(
+/*=====================*/
+ dict_table_t* table, /* in: table to be dropped
+ or truncated */
+ ibool remove_also_table_sx_locks)/* in: also removes
+ table S and X locks */
{
lock_t* lock;
+ lock_t* prev_lock;
mutex_enter(&kernel_mutex);
lock = UT_LIST_GET_FIRST(table->locks);
- while (lock) {
- ut_a(!lock_get_wait(lock));
+ while (lock != NULL) {
- lock_reset_all_on_table_for_trx(table, lock->trx);
+ prev_lock = UT_LIST_GET_PREV(un_member.tab_lock.locks,
+ lock);
- lock = UT_LIST_GET_FIRST(table->locks);
+ /* If we should remove all locks (remove_also_table_sx_locks
+ is TRUE), or if the lock is not table-level S or X lock,
+ then check we are not going to remove a wait lock. */
+ if (remove_also_table_sx_locks
+ || !(lock_get_type(lock) == LOCK_TABLE
+ && IS_LOCK_S_OR_X(lock))) {
+
+ ut_a(!lock_get_wait(lock));
+ }
+
+ lock_remove_all_on_table_for_trx(table, lock->trx,
+ remove_also_table_sx_locks);
+
+ if (prev_lock == NULL) {
+ if (lock == UT_LIST_GET_FIRST(table->locks)) {
+ /* lock was not removed, pick its successor */
+ lock = UT_LIST_GET_NEXT(
+ un_member.tab_lock.locks, lock);
+ } else {
+ /* lock was removed, pick the first one */
+ lock = UT_LIST_GET_FIRST(table->locks);
+ }
+ } else if (UT_LIST_GET_NEXT(un_member.tab_lock.locks,
+ prev_lock) != lock) {
+ /* If lock was removed by
+ lock_remove_all_on_table_for_trx() then pick the
+ successor of prev_lock ... */
+ lock = UT_LIST_GET_NEXT(
+ un_member.tab_lock.locks, prev_lock);
+ } else {
+ /* ... otherwise pick the successor of lock. */
+ lock = UT_LIST_GET_NEXT(
+ un_member.tab_lock.locks, lock);
+ }
}
mutex_exit(&kernel_mutex);
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index 9adb9ddac50..8fd959512c1 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -1267,9 +1267,19 @@ try_again:
if (file == INVALID_HANDLE_VALUE) {
*success = FALSE;
- retry = os_file_handle_error(name,
- create_mode == OS_FILE_CREATE ?
- "create" : "open");
+ /* When srv_file_per_table is on, file creation failure may not
+ be critical to the whole instance. Do not crash the server in
+ case of unknown errors. */
+ if (srv_file_per_table) {
+ retry = os_file_handle_error_no_exit(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ } else {
+ retry = os_file_handle_error(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ }
+
if (retry) {
goto try_again;
}
@@ -1344,9 +1354,19 @@ try_again:
if (file == -1) {
*success = FALSE;
- retry = os_file_handle_error(name,
- create_mode == OS_FILE_CREATE ?
- "create" : "open");
+ /* When srv_file_per_table is on, file creation failure may not
+ be critical to the whole instance. Do not crash the server in
+ case of unknown errors. */
+ if (srv_file_per_table) {
+ retry = os_file_handle_error_no_exit(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ } else {
+ retry = os_file_handle_error(name,
+ create_mode == OS_FILE_CREATE ?
+ "create" : "open");
+ }
+
if (retry) {
goto try_again;
} else {
diff --git a/storage/innobase/plug.in b/storage/innobase/plug.in
index b252d471fba..f7d2abed751 100644
--- a/storage/innobase/plug.in
+++ b/storage/innobase/plug.in
@@ -15,25 +15,30 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_FUNCS(localtime_r)
AC_C_BIGENDIAN
case "$target_os" in
- lin*)
- CFLAGS="$CFLAGS -DUNIV_LINUX";;
- hpux10*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
- hp*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
- aix*)
- CFLAGS="$CFLAGS -DUNIV_AIX";;
- irix*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
- osf*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
- *solaris*|*SunOS*)
- CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
- sysv5uw7*)
- # Problem when linking on SCO
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
- openbsd*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
+ lin*)
+ CFLAGS="$CFLAGS -DUNIV_LINUX";;
+ hpux10*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
+ hp*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
+ aix*)
+ CFLAGS="$CFLAGS -DUNIV_AIX";;
+ irix*|osf*|sysv5uw7*|openbsd*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
+ *solaris*|*SunOS*)
+ CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
esac
+ INNODB_DYNAMIC_CFLAGS="-DMYSQL_DYNAMIC_PLUGIN"
+ case "$target_cpu" in
+ x86_64)
+ # The AMD64 ABI forbids absolute addresses in shared libraries
+ ;;
+ *86)
+ # Use absolute addresses on IA-32
+ INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
+ ;;
+ esac
+ AC_SUBST(INNODB_DYNAMIC_CFLAGS)
])
+# vim: set ft=config:
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index d5ef12d0af2..d76af54b420 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -661,7 +661,14 @@ row_create_prebuilt(
prebuilt->old_vers_heap = NULL;
- prebuilt->last_value = 0;
+ prebuilt->autoinc_error = 0;
+ prebuilt->autoinc_offset = 0;
+
+ /* Default to 1, we will set the actual value later in
+ ha_innobase::get_auto_increment(). */
+ prebuilt->autoinc_increment = 1;
+
+ prebuilt->autoinc_last_value = 0;
return(prebuilt);
}
@@ -1963,6 +1970,7 @@ row_create_index_for_mysql(
ulint err;
ulint i, j;
ulint len;
+ char* table_name;
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
@@ -1972,6 +1980,11 @@ row_create_index_for_mysql(
trx->op_info = "creating index";
+ /* Copy the table name because we may want to drop the
+ table later, after the index object is freed (inside
+ que_run_threads()) and thus index->table_name is not available. */
+ table_name = mem_strdup(index->table_name);
+
trx_start_if_not_started(trx);
/* Check that the same column does not appear twice in the index.
@@ -2044,13 +2057,15 @@ error_handling:
trx_general_rollback_for_mysql(trx, FALSE, NULL);
- row_drop_table_for_mysql(index->table_name, trx, FALSE);
+ row_drop_table_for_mysql(table_name, trx, FALSE);
trx->error_state = DB_SUCCESS;
}
trx->op_info = "";
+ mem_free(table_name);
+
return((int) err);
}
@@ -2443,8 +2458,8 @@ row_discard_tablespace_for_mysql(
new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID);
- /* Remove any locks there are on the table or its records */
- lock_reset_all_on_table(table);
+ /* Remove all locks except the table-level S and X locks. */
+ lock_remove_all_on_table(table, FALSE);
info = pars_info_create();
@@ -2779,9 +2794,8 @@ row_truncate_table_for_mysql(
goto funct_exit;
}
- /* Remove any locks there are on the table or its records */
-
- lock_reset_all_on_table(table);
+ /* Remove all locks except the table-level S and X locks. */
+ lock_remove_all_on_table(table, FALSE);
trx->table_id = table->id;
@@ -2896,7 +2910,7 @@ next_rec:
/* MySQL calls ha_innobase::reset_auto_increment() which does
the same thing. */
dict_table_autoinc_lock(table);
- dict_table_autoinc_initialize(table, 0);
+ dict_table_autoinc_initialize(table, 1);
dict_table_autoinc_unlock(table);
dict_update_statistics(table);
@@ -3131,9 +3145,8 @@ check_next_foreign:
goto funct_exit;
}
- /* Remove any locks there are on the table or its records */
-
- lock_reset_all_on_table(table);
+ /* Remove all locks there are on the table or its records */
+ lock_remove_all_on_table(table, TRUE);
trx->dict_operation = TRUE;
trx->table_id = table->id;
@@ -3429,8 +3442,6 @@ loop:
err = row_drop_table_for_mysql(table_name, trx, TRUE);
- mem_free(table_name);
-
if (err != DB_SUCCESS) {
fputs("InnoDB: DROP DATABASE ", stderr);
ut_print_name(stderr, trx, TRUE, name);
@@ -3438,8 +3449,11 @@ loop:
(ulint) err);
ut_print_name(stderr, trx, TRUE, table_name);
putc('\n', stderr);
+ mem_free(table_name);
break;
}
+
+ mem_free(table_name);
}
if (err == DB_SUCCESS) {
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index 6ff135e4f5a..79f107ce77d 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -32,6 +32,7 @@ Created 12/19/1997 Heikki Tuuri
#include "row0mysql.h"
#include "read0read.h"
#include "buf0lru.h"
+#include "ha_prototypes.h"
/* Maximum number of rows to prefetch; MySQL interface has another parameter */
#define SEL_MAX_N_PREFETCH 16
@@ -3577,20 +3578,12 @@ shortcut_fails_too_big_rec:
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
&& prebuilt->select_lock_type != LOCK_NONE
- && trx->mysql_query_str != NULL
- && *trx->mysql_query_str != NULL
- && trx->mysql_thd != NULL) {
+ && trx->mysql_thd != NULL
+ && thd_is_select(trx->mysql_thd)) {
+ /* It is a plain locking SELECT and the isolation
+ level is low: do not lock gaps */
- /* Scan the MySQL query string; check if SELECT is the first
- word there */
-
- if (dict_str_starts_with_keyword(
- trx->mysql_thd, *trx->mysql_query_str, "SELECT")) {
- /* It is a plain locking SELECT and the isolation
- level is low: do not lock gaps */
-
- set_also_gap_locks = FALSE;
- }
+ set_also_gap_locks = FALSE;
}
/* Note that if the search mode was GE or G, then the cursor
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 773b5d583e0..e8b7bd4cee2 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -1453,8 +1453,11 @@ srv_suspend_mysql_thread(
srv_n_lock_wait_count++;
srv_n_lock_wait_current_count++;
- ut_usectime(&sec, &ms);
- start_time = (ib_longlong)sec * 1000000 + ms;
+ if (ut_usectime(&sec, &ms) == -1) {
+ start_time = -1;
+ } else {
+ start_time = (ib_longlong)sec * 1000000 + ms;
+ }
}
/* Wake the lock timeout monitor thread, if it is suspended */
@@ -1508,14 +1511,20 @@ srv_suspend_mysql_thread(
wait_time = ut_difftime(ut_time(), slot->suspend_time);
if (thr->lock_state == QUE_THR_LOCK_ROW) {
- ut_usectime(&sec, &ms);
- finish_time = (ib_longlong)sec * 1000000 + ms;
+ if (ut_usectime(&sec, &ms) == -1) {
+ finish_time = -1;
+ } else {
+ finish_time = (ib_longlong)sec * 1000000 + ms;
+ }
diff_time = (ulint) (finish_time - start_time);
srv_n_lock_wait_current_count--;
srv_n_lock_wait_time = srv_n_lock_wait_time + diff_time;
- if (diff_time > srv_n_lock_max_wait_time) {
+ if (diff_time > srv_n_lock_max_wait_time &&
+ /* only update the variable if we successfully
+ retrieved the start and finish times. See Bug#36819. */
+ start_time != -1 && finish_time != -1) {
srv_n_lock_max_wait_time = diff_time;
}
}
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index 979d882307a..ea88039f3dd 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -202,13 +202,13 @@ srv_parse_data_file_paths_and_sizes(
str = srv_parse_megabytes(str, &size);
- if (0 == memcmp(str, ":autoextend",
- (sizeof ":autoextend") - 1)) {
+ if (0 == strncmp(str, ":autoextend",
+ (sizeof ":autoextend") - 1)) {
str += (sizeof ":autoextend") - 1;
- if (0 == memcmp(str, ":max:",
- (sizeof ":max:") - 1)) {
+ if (0 == strncmp(str, ":max:",
+ (sizeof ":max:") - 1)) {
str += (sizeof ":max:") - 1;
@@ -290,14 +290,15 @@ srv_parse_data_file_paths_and_sizes(
(*data_file_names)[i] = path;
(*data_file_sizes)[i] = size;
- if (0 == memcmp(str, ":autoextend",
- (sizeof ":autoextend") - 1)) {
+ if (0 == strncmp(str, ":autoextend",
+ (sizeof ":autoextend") - 1)) {
*is_auto_extending = TRUE;
str += (sizeof ":autoextend") - 1;
- if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
+ if (0 == strncmp(str, ":max:",
+ (sizeof ":max:") - 1)) {
str += (sizeof ":max:") - 1;
diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c
index 1ca278cd633..6b5bcef1830 100644
--- a/storage/innobase/ut/ut0ut.c
+++ b/storage/innobase/ut/ut0ut.c
@@ -112,19 +112,45 @@ ut_time(void)
}
/**************************************************************
-Returns system time. */
+Returns system time.
+Upon successful completion, the value 0 is returned; otherwise the
+value -1 is returned and the global variable errno is set to indicate the
+error. */
-void
+int
ut_usectime(
/*========*/
+ /* out: 0 on success, -1 otherwise */
ulint* sec, /* out: seconds since the Epoch */
ulint* ms) /* out: microseconds since the Epoch+*sec */
{
struct timeval tv;
+ int ret;
+ int errno_gettimeofday;
+ int i;
- ut_gettimeofday(&tv, NULL);
- *sec = (ulint) tv.tv_sec;
- *ms = (ulint) tv.tv_usec;
+ for (i = 0; i < 10; i++) {
+
+ ret = ut_gettimeofday(&tv, NULL);
+
+ if (ret == -1) {
+ errno_gettimeofday = errno;
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: gettimeofday(): %s\n",
+ strerror(errno_gettimeofday));
+ os_thread_sleep(100000); /* 0.1 sec */
+ errno = errno_gettimeofday;
+ } else {
+ break;
+ }
+ }
+
+ if (ret != -1) {
+ *sec = (ulint) tv.tv_sec;
+ *ms = (ulint) tv.tv_usec;
+ }
+
+ return(ret);
}
/**************************************************************
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 051a21b3307..66097864622 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -161,11 +161,11 @@ static int FTB_WORD_cmp(my_off_t *v, FTB_WORD *a, FTB_WORD *b)
static int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b)
{
- /* ORDER BY word DESC, ndepth DESC */
- int i= ha_compare_text(cs, (uchar*) (*b)->word+1,(*b)->len-1,
- (uchar*) (*a)->word+1,(*a)->len-1,0,0);
+ /* ORDER BY word, ndepth */
+ int i= ha_compare_text(cs, (uchar*) (*a)->word + 1, (*a)->len - 1,
+ (uchar*) (*b)->word + 1, (*b)->len - 1, 0, 0);
if (!i)
- i=CMP_NUM((*b)->ndepth,(*a)->ndepth);
+ i= CMP_NUM((*a)->ndepth, (*b)->ndepth);
return i;
}
@@ -865,23 +865,49 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
FT_INFO *ftb= ftb_param->ftb;
FTB_WORD *ftbw;
int a, b, c;
+ /*
+ Find right-most element in the array of query words matching this
+ word from a document.
+ */
for (a= 0, b= ftb->queue.elements, c= (a+b)/2; b-a>1; c= (a+b)/2)
{
ftbw= ftb->list[c];
if (ha_compare_text(ftb->charset, (uchar*)word, len,
(uchar*)ftbw->word+1, ftbw->len-1,
- (my_bool)(ftbw->flags&FTB_FLAG_TRUNC), 0) > 0)
+ (my_bool) (ftbw->flags & FTB_FLAG_TRUNC), 0) < 0)
b= c;
else
a= c;
}
+ /*
+ If there were no words with truncation operator, we iterate to the
+ beginning of an array until array element is equal to the word from
+ a document. This is done mainly because the same word may be
+ mentioned twice (or more) in the query.
+
+ In case query has words with truncation operator we must iterate
+ to the beginning of the array. There may be non-matching query words
+ between matching word with truncation operator and the right-most
+ matching element. E.g., if we're looking for 'aaa15' in an array of
+ 'aaa1* aaa14 aaa15 aaa16'.
+
+ Worse of that there still may be match even if the binary search
+ above didn't find matching element. E.g., if we're looking for
+ 'aaa15' in an array of 'aaa1* aaa14 aaa16'. The binary search will
+ stop at 'aaa16'.
+ */
for (; c >= 0; c--)
{
ftbw= ftb->list[c];
if (ha_compare_text(ftb->charset, (uchar*)word, len,
(uchar*)ftbw->word + 1,ftbw->len - 1,
(my_bool)(ftbw->flags & FTB_FLAG_TRUNC), 0))
- break;
+ {
+ if (ftb->with_scan & FTB_FLAG_TRUNC)
+ continue;
+ else
+ break;
+ }
if (ftbw->docid[1] == ftb->info->lastpos)
continue;
ftbw->docid[1]= ftb->info->lastpos;
diff --git a/strings/ctype.c b/strings/ctype.c
index c313708f3f6..2c0fe09c07b 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -338,6 +338,16 @@ my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong length)
}
+/*
+ Returns repertoire for charset
+*/
+uint my_charset_repertoire(CHARSET_INFO *cs)
+{
+ return cs->state & MY_CS_PUREASCII ?
+ MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
+}
+
+
/*
Detect whether a character set is ASCII compatible.
diff --git a/strings/xml.c b/strings/xml.c
index 5c62a8e8603..1b697ec6b26 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -328,7 +328,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
}
while ((MY_XML_IDENT == (lex=my_xml_scan(p,&a))) ||
- (MY_XML_STRING == lex))
+ ((MY_XML_STRING == lex && exclam)))
{
MY_XML_ATTR b;
if (MY_XML_EQ == (lex=my_xml_scan(p,&b)))
@@ -349,13 +349,22 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
return MY_XML_ERROR;
}
}
- else if ((MY_XML_STRING == lex) || (MY_XML_IDENT == lex))
+ else if (MY_XML_IDENT == lex)
{
p->current_node_type= MY_XML_NODE_ATTR;
if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) ||
(MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg))))
return MY_XML_ERROR;
}
+ else if ((MY_XML_STRING == lex) && exclam)
+ {
+ /*
+ We are in , e.g.
+
+
+ Just skip "SystemLiteral" and "PublicidLiteral"
+ */
+ }
else
break;
}
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 94ede2a625b..5f04dc48b4c 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16552,6 +16552,61 @@ static void test_change_user()
DBUG_VOID_RETURN;
}
+#ifdef HAVE_SPATIAL
+/**
+ Bug#37956 memory leak and / or crash with geometry and prepared statements!
+*/
+
+static void test_bug37956(void)
+{
+ const char *query="select point(?,?)";
+ MYSQL_STMT *stmt=NULL;
+ ulong val=0;
+ MYSQL_BIND bind_param[2];
+ unsigned char buff[2]= { 134, 211 };
+ DBUG_ENTER("test_bug37956");
+ myheader("test_bug37956");
+
+ stmt= mysql_simple_prepare(mysql, query);
+ check_stmt(stmt);
+
+ val=1;
+ mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void *)&val);
+ val=CURSOR_TYPE_READ_ONLY;
+ mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&val);
+ val=0;
+ mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, (void *)&val);
+
+ memset(bind_param, 0, sizeof(bind_param));
+ bind_param[0].buffer_type=MYSQL_TYPE_TINY;
+ bind_param[0].buffer= (void *)buff;
+ bind_param[0].is_null=NULL;
+ bind_param[0].error=NULL;
+ bind_param[0].is_unsigned=1;
+ bind_param[1].buffer_type=MYSQL_TYPE_TINY;
+ bind_param[1].buffer= (void *)(buff+1);
+ bind_param[1].is_null=NULL;
+ bind_param[1].error=NULL;
+ bind_param[1].is_unsigned=1;
+
+ if (mysql_stmt_bind_param(stmt, bind_param))
+ {
+ mysql_stmt_close(stmt);
+ DIE_UNLESS(0);
+ }
+
+ if (mysql_stmt_execute(stmt))
+ {
+ mysql_stmt_close(stmt);
+ DBUG_VOID_RETURN;
+ }
+ /* Should never reach here: execution returns an error. */
+ mysql_stmt_close(stmt);
+ DIE_UNLESS(0);
+ DBUG_VOID_RETURN;
+}
+#endif
+
/*
Bug#27592 (stack overrun when storing datetime value using prepared statements)
*/
@@ -17967,6 +18022,9 @@ static struct my_tests_st my_tests[]= {
{ "test_wl4166_2", test_wl4166_2 },
{ "test_bug38486", test_bug38486 },
{ "test_bug40365", test_bug40365 },
+#ifdef HAVE_SPATIAL
+ { "test_bug37956", test_bug37956 },
+#endif
{ 0, 0 }
};
diff --git a/win/configure.js b/win/configure.js
index c86ec0cf47c..ac51b15b9f0 100644
--- a/win/configure.js
+++ b/win/configure.js
@@ -48,6 +48,7 @@ try
case "__NT__":
case "CYBOZU":
case "EMBED_MANIFESTS":
+ case "EXTRA_DEBUG":
case "WITH_EMBEDDED_SERVER":
configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
break;