summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzr-mysql/default.conf2
-rwxr-xr-xCMakeLists.txt4
-rw-r--r--client/mysql.cc49
-rw-r--r--client/mysql_upgrade.c17
-rw-r--r--client/mysqlcheck.c27
-rw-r--r--client/mysqltest.cc88
-rw-r--r--configure.in2
-rw-r--r--extra/resolve_stack_dump.c3
-rw-r--r--extra/yassl/include/openssl/ssl.h4
-rw-r--r--include/config-win.h9
-rw-r--r--include/m_ctype.h1
-rw-r--r--include/my_global.h3
-rw-r--r--mysql-test/extra/binlog_tests/database.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test17
-rw-r--r--mysql-test/include/check_events_off.inc31
-rw-r--r--mysql-test/include/cleanup_fake_relay_log.inc16
-rw-r--r--mysql-test/include/commit.inc13
-rw-r--r--mysql-test/include/have_32bit.inc2
-rw-r--r--mysql-test/include/have_64bit.inc2
-rw-r--r--mysql-test/include/have_simple_parser.inc16
-rw-r--r--mysql-test/include/index_merge1.inc26
-rw-r--r--mysql-test/include/linux_sys_vars.inc1
-rw-r--r--mysql-test/include/no_running_event_scheduler.inc23
-rw-r--r--mysql-test/include/no_running_events.inc25
-rw-r--r--mysql-test/include/running_event_scheduler.inc30
-rw-r--r--mysql-test/include/setup_fake_relay_log.inc78
-rw-r--r--mysql-test/include/wait_condition_sp.inc62
-rw-r--r--mysql-test/include/windows_sys_vars.inc1
-rw-r--r--mysql-test/lib/mtr_report.pm2
-rwxr-xr-xmysql-test/mysql-test-run.pl17
-rw-r--r--mysql-test/r/alter_table.result16
-rw-r--r--mysql-test/r/commit_1innodb.result13
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/r/csv.result13
-rw-r--r--mysql-test/r/ctype_ucs.result53
-rw-r--r--mysql-test/r/date_formats.result10
-rw-r--r--mysql-test/r/events_bugs.result27
-rw-r--r--mysql-test/r/events_scheduling.result12
-rw-r--r--mysql-test/r/fulltext.result9
-rw-r--r--mysql-test/r/fulltext_plugin.result5
-rw-r--r--mysql-test/r/func_if.result9
-rw-r--r--mysql-test/r/func_in.result12
-rw-r--r--mysql-test/r/func_str.result12
-rw-r--r--mysql-test/r/func_time.result15
-rw-r--r--mysql-test/r/grant.result5
-rw-r--r--mysql-test/r/have_simple_parser.require2
-rw-r--r--mysql-test/r/index_merge_myisam.result28
-rw-r--r--mysql-test/r/information_schema.result5
-rw-r--r--mysql-test/r/innodb-autoinc.result410
-rw-r--r--mysql-test/r/innodb.result8
-rw-r--r--mysql-test/r/innodb_bug38231.result11
-rw-r--r--mysql-test/r/innodb_bug39438.result1
-rw-r--r--mysql-test/r/innodb_mysql.result164
-rw-r--r--mysql-test/r/innodb_mysql_rbk.result21
-rw-r--r--mysql-test/r/log_bin_trust_function_creators_func.result25
-rw-r--r--mysql-test/r/log_state.result87
-rw-r--r--mysql-test/r/myisampack.result22
-rw-r--r--mysql-test/r/mysql.result8
-rw-r--r--mysql-test/r/mysqlcheck.result54
-rw-r--r--mysql-test/r/partition_datatype.result2
-rw-r--r--mysql-test/r/partition_innodb_semi_consistent.result128
-rw-r--r--mysql-test/r/partition_mgm.result7
-rw-r--r--mysql-test/r/partition_pruning.result12
-rw-r--r--mysql-test/r/query_cache.result35
-rw-r--r--mysql-test/r/query_cache_28249.result62
-rw-r--r--mysql-test/r/read_buffer_size_basic.result4
-rw-r--r--mysql-test/r/read_rnd_buffer_size_basic.result4
-rw-r--r--mysql-test/r/rpl_init_slave_func.result67
-rw-r--r--mysql-test/r/select.result59
-rw-r--r--mysql-test/r/status.result25
-rw-r--r--mysql-test/r/status2.result73
-rw-r--r--mysql-test/r/strict.result7
-rw-r--r--mysql-test/r/temp_table.result16
-rw-r--r--mysql-test/r/type_bit.result41
-rw-r--r--mysql-test/r/type_date.result13
-rw-r--r--mysql-test/r/type_float.result9
-rw-r--r--mysql-test/r/warnings_engine_disabled.result10
-rw-r--r--mysql-test/r/xml.result24
-rw-r--r--mysql-test/std_data/bug40482-bin.000001bin0 -> 172 bytes
-rw-r--r--mysql-test/suite/binlog/r/binlog_database.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb.result7
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb_row.result31
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result18
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb_row.test42
-rw-r--r--mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result (renamed from mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result)0
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines.result18
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result1212
-rw-r--r--mysql-test/suite/funcs_1/storedproc/param_check.inc19
-rw-r--r--mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test (renamed from mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test)4
-rw-r--r--mysql-test/suite/funcs_2/t/disabled.def8
-rw-r--r--mysql-test/suite/ndb/t/disabled.def3
-rw-r--r--mysql-test/suite/parts/r/partition_bit_innodb.result18
-rw-r--r--mysql-test/suite/parts/r/partition_bit_myisam.result18
-rw-r--r--mysql-test/suite/parts/r/partition_bit_ndb.result126
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result5
-rw-r--r--mysql-test/suite/parts/t/disabled.def5
-rw-r--r--mysql-test/suite/parts/t/partition_bit_ndb.test60
-rw-r--r--mysql-test/suite/parts/t/partition_sessions.test391
-rw-r--r--mysql-test/suite/parts/t/partition_special_innodb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_value_innodb.test12
-rw-r--r--mysql-test/suite/parts/t/partition_value_myisam.test12
-rw-r--r--mysql-test/suite/parts/t/partition_value_ndb.test12
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_corruption.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result95
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result19
-rw-r--r--mysql-test/suite/rpl/t/disabled.def1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test28
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test44
-rw-r--r--mysql-test/suite/rpl_ndb/t/disabled.def4
-rw-r--r--mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc54
-rw-r--r--mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc104
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result55
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result55
-rw-r--r--mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result123
-rw-r--r--mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result119
-rw-r--r--mysql-test/suite/sys_vars/r/tmp_table_size_basic.result (renamed from mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result)54
-rw-r--r--mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result172
-rw-r--r--mysql-test/suite/sys_vars/t/tmp_table_size_basic.test (renamed from mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc)119
-rw-r--r--mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test9
-rw-r--r--mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test9
-rw-r--r--mysql-test/t/alter_table.test13
-rw-r--r--mysql-test/t/create.test6
-rw-r--r--mysql-test/t/csv.test13
-rw-r--r--mysql-test/t/ctype_ucs.test25
-rw-r--r--mysql-test/t/date_formats.test12
-rw-r--r--mysql-test/t/disabled.def5
-rw-r--r--mysql-test/t/events_bugs.test273
-rw-r--r--mysql-test/t/events_scheduling.test28
-rw-r--r--mysql-test/t/fulltext.test9
-rw-r--r--mysql-test/t/fulltext_plugin-master.opt1
-rw-r--r--mysql-test/t/fulltext_plugin.test10
-rw-r--r--mysql-test/t/func_if.test14
-rw-r--r--mysql-test/t/func_in.test13
-rw-r--r--mysql-test/t/func_str.test10
-rw-r--r--mysql-test/t/func_time.test9
-rw-r--r--mysql-test/t/grant.test7
-rw-r--r--mysql-test/t/information_schema.test7
-rw-r--r--mysql-test/t/innodb-autoinc.test259
-rw-r--r--mysql-test/t/innodb.test31
-rw-r--r--mysql-test/t/innodb_bug38231.test75
-rw-r--r--mysql-test/t/innodb_bug39438-master.opt1
-rw-r--r--mysql-test/t/innodb_bug39438.test27
-rw-r--r--mysql-test/t/innodb_mysql.test132
-rw-r--r--mysql-test/t/innodb_mysql_rbk-master.opt1
-rw-r--r--mysql-test/t/innodb_mysql_rbk.test35
-rw-r--r--mysql-test/t/log_bin_trust_function_creators_func-master.opt1
-rw-r--r--mysql-test/t/log_bin_trust_function_creators_func.test32
-rw-r--r--mysql-test/t/log_state.test200
-rw-r--r--mysql-test/t/myisam_data_pointer_size_func.test1
-rw-r--r--mysql-test/t/myisampack.test26
-rw-r--r--mysql-test/t/mysql.test24
-rw-r--r--mysql-test/t/mysqlcheck.test75
-rw-r--r--mysql-test/t/partition_innodb_semi_consistent-master.opt1
-rw-r--r--mysql-test/t/partition_innodb_semi_consistent.test194
-rw-r--r--mysql-test/t/partition_innodb_stmt.test1
-rw-r--r--mysql-test/t/partition_mgm.test11
-rw-r--r--mysql-test/t/partition_pruning.test16
-rw-r--r--mysql-test/t/query_cache.test102
-rw-r--r--mysql-test/t/query_cache_28249.test123
-rw-r--r--mysql-test/t/rpl_init_slave_func-slave.opt1
-rw-r--r--mysql-test/t/rpl_init_slave_func.test133
-rw-r--r--mysql-test/t/select.test69
-rw-r--r--mysql-test/t/status.test40
-rw-r--r--mysql-test/t/status2.test68
-rw-r--r--mysql-test/t/strict.test9
-rw-r--r--mysql-test/t/temp_table.test31
-rw-r--r--mysql-test/t/type_bit.test45
-rw-r--r--mysql-test/t/type_date.test31
-rw-r--r--mysql-test/t/type_float.test15
-rw-r--r--mysql-test/t/warnings_engine_disabled.test9
-rw-r--r--mysql-test/t/xml.test25
-rw-r--r--mysys/my_getopt.c14
-rw-r--r--mysys/my_init.c8
-rw-r--r--scripts/mysql_install_db.sh51
-rw-r--r--sql-common/my_time.c13
-rw-r--r--sql/field.cc2
-rw-r--r--sql/field.h2
-rw-r--r--sql/filesort.cc3
-rw-r--r--sql/ha_partition.cc38
-rw-r--r--sql/ha_partition.h6
-rw-r--r--sql/item.cc9
-rw-r--r--sql/item_cmpfunc.cc28
-rw-r--r--sql/item_func.h5
-rw-r--r--sql/item_strfunc.cc13
-rw-r--r--sql/item_sum.cc7
-rw-r--r--sql/item_timefunc.cc41
-rw-r--r--sql/item_timefunc.h18
-rw-r--r--sql/log.cc301
-rw-r--r--sql/log.h7
-rw-r--r--sql/log_event.cc75
-rw-r--r--sql/log_event.h35
-rw-r--r--sql/mysql_priv.h10
-rw-r--r--sql/mysqld.cc67
-rw-r--r--sql/opt_range.cc29
-rw-r--r--sql/partition_info.cc1
-rw-r--r--sql/repl_failsafe.cc10
-rw-r--r--sql/rpl_constants.h4
-rw-r--r--sql/set_var.cc12
-rw-r--r--sql/slave.cc39
-rw-r--r--sql/spatial.h10
-rw-r--r--sql/sql_acl.cc123
-rw-r--r--sql/sql_base.cc23
-rw-r--r--sql/sql_binlog.cc5
-rw-r--r--sql/sql_class.h11
-rw-r--r--sql/sql_cursor.cc18
-rw-r--r--sql/sql_delete.cc40
-rw-r--r--sql/sql_lex.cc2
-rw-r--r--sql/sql_lex.h9
-rw-r--r--sql/sql_locale.cc436
-rw-r--r--sql/sql_parse.cc22
-rw-r--r--sql/sql_partition.cc33
-rw-r--r--sql/sql_plugin.cc40
-rw-r--r--sql/sql_plugin.h1
-rw-r--r--sql/sql_profile.cc4
-rw-r--r--sql/sql_repl.cc123
-rw-r--r--sql/sql_select.cc17
-rw-r--r--sql/sql_select.h6
-rw-r--r--sql/sql_show.cc63
-rw-r--r--sql/sql_table.cc48
-rw-r--r--sql/sql_trigger.cc88
-rw-r--r--sql/sql_trigger.h6
-rw-r--r--sql/table.cc27
-rw-r--r--sql/table.h32
-rw-r--r--sql/unireg.cc26
-rw-r--r--storage/csv/ha_tina.cc11
-rw-r--r--storage/federated/ha_federated.cc2
-rw-r--r--storage/heap/ha_heap.cc2
-rw-r--r--storage/innobase/Makefile.am38
-rw-r--r--storage/innobase/btr/btr0sea.c39
-rw-r--r--storage/innobase/buf/buf0lru.c127
-rw-r--r--storage/innobase/dict/dict0dict.c72
-rw-r--r--storage/innobase/dict/dict0mem.c6
-rw-r--r--storage/innobase/handler/ha_innodb.cc642
-rw-r--r--storage/innobase/handler/ha_innodb.h9
-rw-r--r--storage/innobase/include/btr0sea.h15
-rw-r--r--storage/innobase/include/dict0dict.h11
-rw-r--r--storage/innobase/include/dict0mem.h10
-rw-r--r--storage/innobase/include/ha_prototypes.h9
-rw-r--r--storage/innobase/include/lock0lock.h17
-rw-r--r--storage/innobase/include/row0mysql.h16
-rw-r--r--storage/innobase/include/sync0sync.ic2
-rw-r--r--storage/innobase/include/ut0ut.h8
-rw-r--r--storage/innobase/lock/lock0lock.c83
-rw-r--r--storage/innobase/os/os0file.c32
-rw-r--r--storage/innobase/plug.in43
-rw-r--r--storage/innobase/row/row0mysql.c40
-rw-r--r--storage/innobase/row/row0sel.c19
-rw-r--r--storage/innobase/srv/srv0srv.c19
-rw-r--r--storage/innobase/srv/srv0start.c15
-rw-r--r--storage/innobase/ut/ut0ut.c36
-rw-r--r--storage/myisam/ft_boolean_search.c38
-rw-r--r--strings/ctype.c10
-rw-r--r--strings/xml.c13
-rw-r--r--tests/mysql_client_test.c58
-rw-r--r--win/configure.js1
265 files changed, 7148 insertions, 4062 deletions
diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf
index f044f8e62da..adedd4e3367 100644
--- a/.bzr-mysql/default.conf
+++ b/.bzr-mysql/default.conf
@@ -1,4 +1,4 @@
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
-tree_name = "mysql-5.1"
+tree_name = "mysql-5.1-rpl"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d41cde72d04..0657013089b 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 4c00890a6ca..3de616ae407 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2020,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;
@@ -2103,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
@@ -2196,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/client/mysqlcheck.c b/client/mysqlcheck.c
index 17ebca497e4..86e1b3352b4 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -40,15 +40,13 @@ static uint verbose = 0, opt_mysql_port=0;
static int my_end_arg;
static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
- *default_charset = (char *)MYSQL_DEFAULT_CHARSET_NAME,
- *current_host = 0;
+ *default_charset= 0, *current_host= 0;
static int first_error = 0;
DYNAMIC_ARRAY tables4repair;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol=0;
-static CHARSET_INFO *charset_info= &my_charset_latin1;
enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
@@ -282,12 +280,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case OPT_FIX_DB_NAMES:
what_to_do= DO_UPGRADE;
- default_charset= (char*) "utf8";
opt_databases= 1;
break;
case OPT_FIX_TABLE_NAMES:
what_to_do= DO_UPGRADE;
- default_charset= (char*) "utf8";
break;
case 'p':
if (argument)
@@ -367,11 +363,20 @@ static int get_options(int *argc, char ***argv)
what_to_do = DO_CHECK;
}
- /* TODO: This variable is not yet used */
- if (strcmp(default_charset, charset_info->csname) &&
- !(charset_info= get_charset_by_csname(default_charset,
- MY_CS_PRIMARY, MYF(MY_WME))))
- exit(1);
+ /*
+ If there's no --default-character-set option given with
+ --fix-table-name or --fix-db-name set the default character set to "utf8".
+ */
+ if (!default_charset && (opt_fix_db_names || opt_fix_table_names))
+ {
+ default_charset= (char*) "utf8";
+ }
+ if (default_charset && !get_charset_by_csname(default_charset, MY_CS_PRIMARY,
+ MYF(MY_WME)))
+ {
+ printf("Unsupported character set: %s\n", default_charset);
+ return 1;
+ }
if (*argc > 0 && opt_alldbs)
{
printf("You should give only options, no arguments at all, with option\n");
@@ -779,6 +784,8 @@ static int dbConnect(char *host, char *user, char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
+ if (default_charset)
+ mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
{
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index adc7a9be161..107848d6777 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1442,6 +1442,36 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
/*
+ Test if diff is present. This is needed on Windows systems
+ as the OS returns 1 whether diff is successful or if it is
+ not present.
+
+ We run diff -v and look for output in stdout.
+ We don't redirect stderr to stdout to make for a simplified check
+ Windows will output '"diff"' is not recognized... to stderr if it is
+ not present.
+*/
+
+int diff_check()
+{
+ char buf[512]= {0};
+ FILE *res_file;
+ const char *cmd = "diff -v";
+ int have_diff = 0;
+
+ if (!(res_file= popen(cmd, "r")))
+ die("popen(\"%s\", \"r\") failed", cmd);
+
+ /* if diff is not present, nothing will be in stdout to increment have_diff */
+ if (fgets(buf, sizeof(buf), res_file))
+ {
+ have_diff += 1;
+ }
+ pclose(res_file);
+ return have_diff;
+}
+
+/*
Show the diff of two files using the systems builtin diff
command. If no such diff command exist, just dump the content
of the two files and inform about how to get "diff"
@@ -1457,28 +1487,28 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
void show_diff(DYNAMIC_STRING* ds,
const char* filename1, const char* filename2)
{
-
- const char* diff_failed= 0;
DYNAMIC_STRING ds_tmp;
+ int have_diff = 0;
if (init_dynamic_string(&ds_tmp, "", 256, 256))
die("Out of memory");
- /* First try with unified diff */
- if (run_tool("diff",
- &ds_tmp, /* Get output from diff in ds_tmp */
- "-u",
- filename1,
- filename2,
- "2>&1",
- NULL) > 1) /* Most "diff" tools return >1 if error */
- {
- dynstr_set(&ds_tmp, "");
+ /* determine if we have diff on Windows
+ needs special processing due to return values
+ on that OS
+ */
+#ifdef __WIN__
+ have_diff = diff_check();
+#else
+ have_diff = 1;
+#endif
- /* Fallback to context diff with "diff -c" */
+ if (have_diff)
+ {
+ /* First try with unified diff */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
- "-c",
+ "-u",
filename1,
filename2,
"2>&1",
@@ -1486,29 +1516,38 @@ void show_diff(DYNAMIC_STRING* ds,
{
dynstr_set(&ds_tmp, "");
- /* Fallback to plain "diff" */
+ /* Fallback to context diff with "diff -c" */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
+ "-c",
filename1,
filename2,
"2>&1",
NULL) > 1) /* Most "diff" tools return >1 if error */
{
- dynstr_set(&ds_tmp, "");
-
- diff_failed= "Could not execute 'diff -u', 'diff -c' or 'diff'";
+ dynstr_set(&ds_tmp, "");
+
+ /* Fallback to simple diff with "diff" */
+ if (run_tool("diff",
+ &ds_tmp, /* Get output from diff in ds_tmp */
+ filename1,
+ filename2,
+ "2>&1",
+ NULL) > 1) /* Most "diff" tools return >1 if error */
+ {
+ have_diff= 0;
+ }
}
}
- }
+ }
- if (diff_failed)
+ if (! have_diff)
{
/*
Fallback to dump both files to result file and inform
about installing "diff"
*/
dynstr_append(&ds_tmp, "\n");
- dynstr_append(&ds_tmp, diff_failed);
dynstr_append(&ds_tmp,
"\n"
"The two files differ but it was not possible to execute 'diff' in\n"
@@ -7326,6 +7365,13 @@ static sig_handler signal_handler(int sig)
{
fprintf(stderr, "mysqltest got " SIGNAL_FMT "\n", sig);
dump_backtrace();
+
+ fprintf(stderr, "Writing a core file...\n");
+ fflush(stderr);
+ my_write_core(sig);
+#ifndef __WIN__
+ exit(1); // Shouldn't get here but just in case
+#endif
}
#ifdef __WIN__
diff --git a/configure.in b/configure.in
index 553abdb889f..16d229a84e3 100644
--- a/configure.in
+++ b/configure.in
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 5.1.31)
+AM_INIT_AUTOMAKE(mysql, 5.1.32)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10
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 c111d14a17a..c8b9004eb8a 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_global.h b/include/my_global.h
index 25ba94f7d3e..ac49d48e78d 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/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test
index 2e445f98adf..326ecedb60e 100644
--- a/mysql-test/extra/binlog_tests/database.test
+++ b/mysql-test/extra/binlog_tests/database.test
@@ -28,3 +28,5 @@ enable_warnings;
insert into t1 values (1);
drop table tt1, t1;
source include/show_binlog_events.inc;
+
+FLUSH STATUS;
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
index 1fa3cf034f6..24448a38408 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -145,6 +145,23 @@ select * from t3 order by a;
connection master;
drop table t1,t2,t3;
+sync_slave_with_master;
+
+#
+# BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
+#
+connection master;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+
+sync_slave_with_master;
+show create table t1;
+
+connection master;
+drop table t1;
# End cleanup
sync_slave_with_master;
diff --git a/mysql-test/include/check_events_off.inc b/mysql-test/include/check_events_off.inc
new file mode 100644
index 00000000000..599a4b9e504
--- /dev/null
+++ b/mysql-test/include/check_events_off.inc
@@ -0,0 +1,31 @@
+########## include/check_events_off.inc ####################################
+# #
+# Purpose: #
+# Wait till we can expect that we have no event activity till the scheduler is #
+# switched on again. #
+# = There will be no modifications of user tables by existing events #
+# except they use "INSERT DELAYED" or the server system variable #
+# "concurrent_inserts" is not switched off. #
+# Only some storage engines support concurrent_inserts" or "INSERT DELAYED". #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for bug fixes in tests #
+# #
+################################################################################
+
+# 1. Check that the server system variable shows the state needed
+if (`SELECT @@global.event_scheduler <> 'OFF'`)
+{
+ --echo # Error: We expect here that the event scheduler is switched off.
+ SELECT @@global.event_scheduler;
+ --echo # Thinkable reasons:
+ --echo # 1. SET GLOBAL event_scheduler = OFF had not the expected effect.
+ --echo # 2. Use of the current routine (include/check_events_off.inc)
+ --echo # within the wrong situation
+ --die
+}
+# 2. Wait till we have no event_scheduler session within the processlist
+--source include/no_running_event_scheduler.inc
+# 3. Wait till we have no event executor sessions within the processlist
+--source include/no_running_events.inc
+
diff --git a/mysql-test/include/cleanup_fake_relay_log.inc b/mysql-test/include/cleanup_fake_relay_log.inc
new file mode 100644
index 00000000000..43aa46cb657
--- /dev/null
+++ b/mysql-test/include/cleanup_fake_relay_log.inc
@@ -0,0 +1,16 @@
+# ==== Purpose ====
+#
+# Clean up files create by setup_fake_relay_log.inc.
+#
+# ==== Usage ====
+#
+# See setup_fake_relay_log.inc
+
+--echo Cleaning up after setup_fake_relay_log.inc
+
+# Remove files.
+remove_file $_fake_relay_log;
+remove_file $_fake_relay_index;
+--disable_query_log
+eval SET @@global.relay_log_purge= $_fake_relay_log_purge;
+--enable_query_log
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index a7af3bf574f..a4e7d9ae601 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -617,10 +617,10 @@ call p_verify_status_increment(0, 0, 0, 0);
--echo
--echo # No test because of Bug#8729 "rename table fails on temporary table"
---echo # 24. DDL: TRUNCATE TEMPORARY TABLE, does not start a transaction
+--echo # 24. DDL: TRUNCATE TEMPORARY TABLE
--echo
truncate table t2;
-call p_verify_status_increment(2, 0, 2, 0);
+call p_verify_status_increment(4, 0, 4, 0);
commit;
--echo # There is nothing left to commit
call p_verify_status_increment(0, 0, 0, 0);
@@ -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);
@@ -730,7 +733,7 @@ call p_verify_status_increment(1, 0, 1, 0);
rename table t4 to t3;
call p_verify_status_increment(1, 0, 1, 0);
truncate table t3;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(4, 4, 4, 4);
create view v1 as select * from t2;
call p_verify_status_increment(1, 0, 1, 0);
check table t1;
diff --git a/mysql-test/include/have_32bit.inc b/mysql-test/include/have_32bit.inc
index b09a813967d..66684fb5325 100644
--- a/mysql-test/include/have_32bit.inc
+++ b/mysql-test/include/have_32bit.inc
@@ -11,6 +11,6 @@ eval SET @@global.sort_buffer_size = $save;
--enable_query_log
if (!$mach32)
{
- skip Need a 32 bit machine;
+ skip Need a 32 bit machine/binary;
}
diff --git a/mysql-test/include/have_64bit.inc b/mysql-test/include/have_64bit.inc
index 31529a0c9d4..cbba5e1d338 100644
--- a/mysql-test/include/have_64bit.inc
+++ b/mysql-test/include/have_64bit.inc
@@ -9,6 +9,6 @@ eval SET @@session.sort_buffer_size = $save;
--enable_query_log
if (!$mach64)
{
- skip Need a 64 bit machine;
+ skip Need a 64 binary ;
}
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/no_running_event_scheduler.inc b/mysql-test/include/no_running_event_scheduler.inc
new file mode 100644
index 00000000000..92813df9f96
--- /dev/null
+++ b/mysql-test/include/no_running_event_scheduler.inc
@@ -0,0 +1,23 @@
+########## include/no_running_event_scheduler.inc ##########################
+# #
+# Wait till the event scheduler disappeared from processlist. #
+# #
+# The characteristics of the event_scheduler entry within the processlist is #
+# user = 'event_scheduler' and command = 'Daemon'. I am not 100% sure if #
+# ther is no short phase with command <> 'Daemon'. #
+# A query with WHERE user = 'event_scheduler' only will also catch events in #
+# startup phase. This is no problem since this phase is very short. #
+# #
+# A wait_timeout of >= 3 seconds was within experiments sufficient even on a #
+# testing box with heavy parallel load. Therefore 5 seconds should be enough. #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for test bug fixes #
+# #
+################################################################################
+
+let $wait_timeout= 5;
+let $wait_condition=
+ SELECT COUNT(*) = 0 FROM information_schema.processlist
+ WHERE user = 'event_scheduler';
+--source include/wait_condition.inc
diff --git a/mysql-test/include/no_running_events.inc b/mysql-test/include/no_running_events.inc
new file mode 100644
index 00000000000..8090b2706b8
--- /dev/null
+++ b/mysql-test/include/no_running_events.inc
@@ -0,0 +1,25 @@
+########## include/no_running_events.inc ###################################
+# #
+# Wait till all event executors have finished their work. #
+# #
+# Different event executors share the characteristics that their entry within #
+# processlist contains command = 'Connect'. #
+# Of course the corresponding query will also catch other connections being #
+# within the connect phase. This is no problem since the connect phase is #
+# usually very short. #
+# #
+# A wait_timeout of >= 3 seconds was during experiments in case of "simple" #
+# SQL commands sufficient even on a testing box with heavy parallel load. #
+# "simple" = no sleeps, no long running commands, no waiting for lock ... #
+# We use here the default of 30 seconds because this wastes some time only in #
+# case of unexpected situations. #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for test bug fixes #
+# #
+################################################################################
+
+let $wait_condition=
+ SELECT COUNT(*) = 0 FROM information_schema.processlist
+ WHERE command = 'Connect';
+--source include/wait_condition.inc
diff --git a/mysql-test/include/running_event_scheduler.inc b/mysql-test/include/running_event_scheduler.inc
new file mode 100644
index 00000000000..296bf842e82
--- /dev/null
+++ b/mysql-test/include/running_event_scheduler.inc
@@ -0,0 +1,30 @@
+############# include/running_event_scheduler.inc ##########################
+# #
+# Wait till the event scheduler reached its final state within the processlist.#
+# #
+# The characteristics of the event_scheduler entry within the processlist is #
+# user = 'event_scheduler' and command = 'Daemon'. I am not 100% sure if #
+# ther is no short phase with command <> 'Daemon'. #
+# A query with WHERE user = 'event_scheduler' only will also catch events in #
+# startup phase. #
+# #
+# Creation: #
+# 2008-12-19 mleich Implement this check needed for test bug fixes #
+# #
+################################################################################
+
+# 1. Check that the server system variable shows the state needed
+if (`SELECT @@global.event_scheduler <> 'ON'`)
+{
+ --echo # Error: We expect here that the event scheduler is switched on.
+ SELECT @@global.event_scheduler;
+ --echo # Thinkable reasons:
+ --echo # 1. SET GLOBAL event_scheduler = ON had not the expected effect.
+ --echo # 2. Use of the current routine (include/running_event_scheduler.inc)
+ --echo # within the wrong situation
+ --die
+}
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE user = 'event_scheduler' AND command = 'Daemon';
+--source include/wait_condition.inc
diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
new file mode 100644
index 00000000000..8113ed6dc10
--- /dev/null
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -0,0 +1,78 @@
+# ==== Purpose ====
+#
+# Setup replication from an existing relay log in the current
+# connection.
+#
+# ==== Usage ====
+#
+# Make sure the slave is not running and issue:
+#
+# let $fake_relay_log= /path/to/fake-relay-log-file.000001
+# source include/setup_fake_relay_log.inc;
+# START SLAVE SQL_THREAD; # setup_fake_relay_log doesn't start slave
+# ...
+# source include/cleanup_fake_relay_log.inc
+#
+# You must run the server with --relay-log=FILE. You probably want to
+# run with --replicate-same-server-id too.
+#
+# ==== Implementation ====
+#
+# First makes a sanity check, ensuring that the slave threads are not
+# running. Then copies the $fake_relay_log to RELAY_BIN-fake.000001,
+# where RELAY_BIN is the basename of the relay log, and updates
+# RELAY_BIN.index. Finally issues CHANGE MASTER so that it uses the
+# given files.
+#
+# ==== Side effects ====
+#
+# Creates a binlog file and a binlog index file, and sets
+# @@global.relay_log_purge=1. All this is restored when you call
+# cleanup_fake_relay_log.inc.
+#
+# Enables the query log.
+
+
+--disable_query_log
+
+# Print message.
+let $_fake_relay_log_printable= `SELECT REPLACE('$fake_relay_log', '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`;
+--echo Setting up fake replication from $_fake_relay_log_printable
+
+# Sanity check.
+let $_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
+let $_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) {
+ --echo Error: Slave was running when test case sourced
+ --echo include/setup_fake_replication.inc
+ --echo Slave_IO_Running = $_io_running; Slave_SQL_Running = $_sql_running
+ --echo Printing some debug info:
+ SHOW SLAVE STATUS;
+ SHOW MASTER STATUS;
+ SHOW BINLOG EVENTS;
+ SHOW PROCESSLIST;
+}
+
+# Read server variables.
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let $_fake_filename= query_get_value(SHOW VARIABLES LIKE 'relay_log', Value, 1);
+if (`SELECT '$_fake_filename' = ''`) {
+ --echo Badly written test case: relay_log variable is empty. Please use the
+ --echo server option --relay-log=FILE.
+}
+let $_fake_relay_log= $MYSQLD_DATADIR/$_fake_filename-fake.000001;
+let $_fake_relay_index= $MYSQLD_DATADIR/$_fake_filename.index;
+# Need to restore relay_log_purge in cleanup_fake_relay_log.inc, since
+# CHANGE MASTER modifies it (see the manual for CHANGE MASTER).
+let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
+
+# Create relay log file.
+copy_file $fake_relay_log $_fake_relay_log;
+
+# Create relay log index.
+eval SELECT '$_fake_relay_log' INTO OUTFILE '$_fake_relay_index';
+
+# Setup replication from existing relay log.
+eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_relay_log', RELAY_LOG_POS=4;
+
+--enable_query_log
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/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.pm b/mysql-test/lib/mtr_report.pm
index 3e2ef4e09ef..5ed56a23446 100644
--- a/mysql-test/lib/mtr_report.pm
+++ b/mysql-test/lib/mtr_report.pm
@@ -260,7 +260,7 @@ sub mtr_report_stats ($) {
{
mtr_warning("Got errors/warnings while running tests, please examine",
"'$warnlog' for details.");
- }
+ }
print "\n";
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index cdb1352e7f6..9880dd19f65 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -119,7 +119,6 @@ my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
-
our $exe_mysql;
our $exe_mysqladmin;
our $exe_mysqltest;
@@ -1665,6 +1664,18 @@ sub environment_setup {
}
+ # ----------------------------------------------------
+ # Add the path where mysqld will find mypluglib.so
+ # ----------------------------------------------------
+ my $lib_simple_parser=
+ mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'),
+ "$basedir/plugin/fulltext/.libs/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) : "");
+
# --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug"
@@ -1802,7 +1813,6 @@ sub environment_setup {
"$basedir/extra/my_print_defaults");
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= native_path($exe_my_print_defaults);
-
# ----------------------------------------------------
# Setup env so childs can execute myisampack and myisamchk
# ----------------------------------------------------
@@ -1917,6 +1927,9 @@ sub remove_stale_vardir () {
mtr_verbose("Removing $opt_vardir/");
rmtree("$opt_vardir/");
}
+ # Remove the "tmp" dir
+ mtr_verbose("Removing $opt_tmpdir/");
+ 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/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index f226543c665..a31a881051f 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -683,10 +683,10 @@ SUCCESS
# 23. DDL: RENAME TEMPORARY TABLE, does not start a transaction
# No test because of Bug#8729 "rename table fails on temporary table"
-# 24. DDL: TRUNCATE TEMPORARY TABLE, does not start a transaction
+# 24. DDL: TRUNCATE TEMPORARY TABLE
truncate table t2;
-call p_verify_status_increment(2, 0, 2, 0);
+call p_verify_status_increment(4, 0, 4, 0);
SUCCESS
commit;
@@ -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;
@@ -850,7 +853,7 @@ call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
truncate table t3;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(4, 4, 4, 4);
SUCCESS
create view v1 as select * from t2;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 1842fb8b1dd..057a8600ca2 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1891,5 +1891,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 3bd5869775b..4b96f5a5ed0 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5394,4 +5394,17 @@ select * from t1;
ERROR HY000: File 'MYSQLD_DATADIR/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/date_formats.result b/mysql-test/r/date_formats.result
index dfd8244ef77..99ae6d85fee 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -590,3 +590,13 @@ select str_to_date('04/30/2004 ', '%m/%d/%Y ');
str_to_date('04/30/2004 ', '%m/%d/%Y ')
2004-04-30
"End of 4.1 tests"
+SELECT DATE_FORMAT("0000-01-01",'%W %d %M %Y') as valid_date;
+valid_date
+Sunday 01 January 0000
+SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
+valid_date
+Tuesday 28 February 0000
+SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
+valid_date
+Thursday 01 January 2009
+"End of 5.0 tests"
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index ba4645b827e..83030a00179 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -3,6 +3,8 @@ drop database if exists mysqltest_db1;
drop database if exists mysqltest_db2;
create database events_test;
use events_test;
+set @concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert = 0;
select * from information_schema.global_variables where variable_name like 'event_scheduler';
VARIABLE_NAME VARIABLE_VALUE
EVENT_SCHEDULER ON
@@ -60,7 +62,7 @@ select get_lock('test_bug16407', 60);
end|
"Now if everything is fine the event has compiled and is locked"
select /*1*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'test_bug16407\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
user host db info
root localhost events_test select get_lock('test_bug16407', 60)
select release_lock('test_bug16407');
@@ -84,7 +86,7 @@ get_lock('ee_16407_2', 60)
set global event_scheduler= 1;
"Another sql_mode test"
set sql_mode="traditional";
-create table events_smode_test(ev_name char(10), a date) engine=myisam;
+create table events_smode_test(ev_name char(10), a date);
"This should never insert something"
create event ee_16407_2 on schedule every 60 second do
begin
@@ -92,7 +94,7 @@ select get_lock('ee_16407_2', 60) /*ee_16407_2*/;
select release_lock('ee_16407_2');
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
-insert into events_smode_test values ('test','1980-19-02')|
+insert into events_test.events_smode_test values ('test','1980-19-02')|
ERROR 22007: Incorrect date value: '1980-19-02' for column 'a' at row 1
"This is ok"
create event ee_16407_3 on schedule every 60 second do
@@ -116,7 +118,7 @@ events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_4
select /*2*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60)
@@ -125,10 +127,10 @@ select release_lock('ee_16407_2');
release_lock('ee_16407_2')
1
select /*3*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
set global event_scheduler= off;
-select * from events_smode_test order by ev_name, a;
+select * from events_test.events_smode_test order by ev_name, a;
ev_name a
ee_16407_3 1980-02-19
ee_16407_3 1980-02-29
@@ -143,7 +145,7 @@ drop event ee_16407_2;
drop event ee_16407_3;
drop event ee_16407_4;
"And now one last test regarding sql_mode and call of SP from an event"
-delete from events_smode_test;
+delete from events_test.events_smode_test;
set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
get_lock('ee_16407_5', 60)
@@ -166,10 +168,8 @@ call events_test.ee_16407_6_pendant();
end|
"Should have 2 locked processes"
select /*4*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
user host db info
-event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_5', 60)
root localhost events_test select get_lock('ee_16407_5', 60)
select release_lock('ee_16407_5');
@@ -177,11 +177,9 @@ release_lock('ee_16407_5')
1
"Should have 0 processes locked"
select /*5*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
user host db info
-event_scheduler localhost NULL NULL
-select * from events_smode_test order by ev_name, a;
+select * from events_test.events_smode_test order by ev_name, a;
ev_name a
ee_16407_6 2004-02-29
"And here we check one more time before we drop the events"
@@ -740,3 +738,4 @@ name
drop event e1;
DROP DATABASE events_test;
SET GLOBAL event_scheduler= 'ON';
+SET @@global.concurrent_insert= @concurrent_insert;
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_in.result b/mysql-test/r/func_in.result
index e761fb851fb..1e967b668c5 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -575,4 +575,16 @@ id
select * from t1 where NOT id in (null, 1);
id
drop table t1;
+CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
+INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1);
+SELECT CASE AVG (c0) WHEN c1 * c2 THEN 1 END FROM t1;
+CASE AVG (c0) WHEN c1 * c2 THEN 1 END
+1
+SELECT CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END FROM t1;
+CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END
+2
+SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
+CASE c1 WHEN c1 + 1 THEN 1 END ABS(AVG(c0))
+NULL 1.0000
+DROP TABLE t1;
End of 5.1 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 559ed003fb2..0fa143d95bc 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 397f51fbd49..18f11ebcc71 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1247,6 +1247,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 bbcae78f5e3..f8deef15819 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1715,4 +1715,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 27a79a18493..2ce9587ef1a 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -3297,3 +3297,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..6fcc9415d12 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1683,3 +1683,167 @@ 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;
+DROP TABLE IF EXISTS t1,t3,t2;
+DROP FUNCTION IF EXISTS f1;
+CREATE FUNCTION f1() RETURNS VARCHAR(250)
+BEGIN
+return 'hhhhhhh' ;
+END|
+CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) ENGINE=INNODB;
+BEGIN WORK;
+CREATE TEMPORARY TABLE t2 (a VARCHAR(20), b VARCHAR(20), c varchar(20)) ENGINE=INNODB;
+CREATE TEMPORARY TABLE t3 LIKE t2;
+INSERT INTO t1 VALUES ('a','b',NULL),('c','d',NULL),('e','f',NULL);
+SET @stmt := CONCAT('INSERT INTO t2 SELECT tbl.a, tbl.b, f1()',' FROM t1 tbl');
+PREPARE stmt1 FROM @stmt;
+SET @stmt := CONCAT('INSERT INTO t3', ' SELECT * FROM t2');
+PREPARE stmt3 FROM @stmt;
+EXECUTE stmt1;
+COMMIT;
+DEALLOCATE PREPARE stmt1;
+DEALLOCATE PREPARE stmt3;
+DROP TABLE t1,t3,t2;
+DROP FUNCTION f1;
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY,
+t1_id INT, INDEX par_ind (t1_id),
+FOREIGN KEY (t1_id) REFERENCES t1(id)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (3,2);
+SET AUTOCOMMIT = 0;
+START TRANSACTION;
+TRUNCATE TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+SELECT * FROM t1;
+id
+1
+2
+COMMIT;
+SELECT * FROM t1;
+id
+1
+2
+START TRANSACTION;
+TRUNCATE TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+SELECT * FROM t1;
+id
+1
+2
+ROLLBACK;
+SELECT * FROM t1;
+id
+1
+2
+SET AUTOCOMMIT = 1;
+START TRANSACTION;
+SELECT * FROM t1;
+id
+1
+2
+COMMIT;
+TRUNCATE TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+SELECT * FROM t1;
+id
+1
+2
+DELETE FROM t2 WHERE id = 3;
+START TRANSACTION;
+SELECT * FROM t1;
+id
+1
+2
+TRUNCATE TABLE t1;
+ROLLBACK;
+SELECT * FROM t1;
+id
+TRUNCATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/innodb_mysql_rbk.result b/mysql-test/r/innodb_mysql_rbk.result
new file mode 100644
index 00000000000..21ac4295325
--- /dev/null
+++ b/mysql-test/r/innodb_mysql_rbk.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
+DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+a b
+3 3
+START TRANSACTION;
+UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ROLLBACK;
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+a b
+3 3
+START TRANSACTION;
+UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 WHERE b = 10;
+a b
+DROP TABLE t1;
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 30ba316eb31..33443df5ae4 100644
--- a/mysql-test/r/log_bin_trust_function_creators_func.result
+++ b/mysql-test/r/log_bin_trust_function_creators_func.result
@@ -11,10 +11,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
@@ -22,8 +19,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/log_state.result b/mysql-test/r/log_state.result
index 35fb59671b8..5c3e3d789a1 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -1,6 +1,7 @@
-set @start_general_log= @@global.general_log;
-set @start_slow_query_log= @@global.slow_query_log;
-set @start_general_log_file= @@global.general_log_file;
+SET @old_general_log= @@global.general_log;
+SET @old_general_log_file= @@global.general_log_file;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_slow_query_log_file= @@global.slow_query_log_file;
set global general_log= OFF;
truncate table mysql.general_log;
truncate table mysql.slow_log;
@@ -36,20 +37,26 @@ general_log ON
log ON
log_slow_queries OFF
slow_query_log OFF
-set session long_query_time=1;
-select sleep(2);
-sleep(2)
+# Establish connection con1 (user=root)
+# Switch to connection con1
+set @long_query_time = <long_query_time>;
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
+sleep(@long_query_time + 1)
0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
+# Switch to connection default
set global slow_query_log= ON;
-set session long_query_time=1;
-select sleep(2);
-sleep(2)
+# Switch to connection con1
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
+sleep(@long_query_time + 1)
0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
-TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(2)
+TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(@long_query_time + 1)
+# Switch to connection default
show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
@@ -95,8 +102,8 @@ slow_query_log_file #
show variables like 'log_output';
Variable_name Value
log_output FILE,TABLE
-set global general_log_file='/not exiting path/log.master';
-ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
+set global general_log_file='/not existing path/log.master';
+ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
set global general_log_file='MYSQLTEST_VARDIR';
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR'
set global general_log_file='';
@@ -156,8 +163,10 @@ select * from mysql.general_log;
event_time user_host thread_id server_id command_type argument
TIMESTAMP USER_HOST # 1 Query drop table t1
TIMESTAMP USER_HOST # 1 Query select * from mysql.general_log
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
FLUSH TABLES WITH READ LOCK;
@@ -176,10 +185,9 @@ SET GLOBAL READ_ONLY = ON;
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
SET GLOBAL READ_ONLY = OFF;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL general_log = ON;
SHOW VARIABLES LIKE 'general_log';
Variable_name Value
general_log ON
@@ -242,29 +250,24 @@ log_slow_queries ON
SELECT @@slow_query_log, @@log_slow_queries;
@@slow_query_log @@log_slow_queries
1 1
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
-set @old_general_log_file= @@global.general_log_file;
-set @old_slow_query_log_file= @@global.slow_query_log_file;
-set global general_log_file= concat('/not exiting path/log.maste', 'r');
-ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
-set global general_log_file= NULL;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL general_log_file= CONCAT('/not existing path/log.maste', 'r');
+ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
+SET GLOBAL general_log_file= NULL;
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL'
-set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
-ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master'
-set global slow_query_log_file= NULL;
+SET GLOBAL slow_query_log_file= CONCAT('/not existing path/log.maste', 'r');
+ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not existing path/log.master'
+SET GLOBAL slow_query_log_file= NULL;
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL'
-set global general_log_file= @old_general_log_file;
-set global slow_query_log_file= @old_slow_query_log_file;
+SET GLOBAL general_log_file= @old_general_log_file;
+SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
# --
# -- Bug#32748: Inconsistent handling of assignments to
-# -- general_log_file/slow_query_log_file.
+# -- general_log_file/slow_query_log_file.
# --
-SET @general_log_file_saved = @@global.general_log_file;
-SET @slow_query_log_file_saved = @@global.slow_query_log_file;
-
SET GLOBAL general_log_file = 'bug32748.query.log';
SET GLOBAL slow_query_log_file = 'bug32748.slow.log';
@@ -273,8 +276,8 @@ Variable_name Value
general_log_file bug32748.query.log
slow_query_log_file bug32748.slow.log
-SET GLOBAL general_log_file = @general_log_file_saved;
-SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
+SET GLOBAL general_log_file = @old_general_log_file;
+SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
# -- End of Bug#32748.
deprecated:
@@ -301,7 +304,13 @@ SET GLOBAL general_log_file = @my_glf;
SET GLOBAL slow_query_log_file = @my_sqlf;
SET GLOBAL general_log = DEFAULT;
SET GLOBAL slow_query_log = DEFAULT;
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
End of 5.1 tests
-set @@global.general_log= @start_general_log;
-set @@global.slow_query_log= @start_slow_query_log;
-set @@global.general_log_file= @start_general_log_file;
+# Close connection con1
+SET global general_log = @old_general_log;
+SET global general_log_file = @old_general_log_file;
+SET global slow_query_log = @old_slow_query_log;
+SET global slow_query_log_file = @old_slow_query_log_file;
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..25b66fe7fc6 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -180,6 +180,14 @@ 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
+@z:='1' @z=database()
+1 NULL
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/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index b98a800fb36..ac582930a6e 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -133,4 +133,58 @@ v1
v-1
drop view v1, `v-1`;
drop table t1;
+SET NAMES utf8;
+CREATE TABLE `#mysql50#@` (a INT);
+SHOW TABLES;
+Tables_in_test
+#mysql50#@
+SET NAMES DEFAULT;
+mysqlcheck --fix-table-names --databases test
+SET NAMES utf8;
+SHOW TABLES;
+Tables_in_test
+@
+DROP TABLE `@`;
+CREATE TABLE `Ñ` (a INT);
+SET NAMES DEFAULT;
+mysqlcheck --default-character-set="latin1" --databases test
+test.?
+Error : Table doesn't exist
+error : Corrupt
+mysqlcheck --default-character-set="utf8" --databases test
+test.Ñ OK
+SET NAMES utf8;
+DROP TABLE `Ñ`;
+SET NAMES DEFAULT;
+CREATE DATABASE `#mysql50#a@b`;
+USE `#mysql50#a@b`;
+CREATE TABLE `#mysql50#c@d` (a INT);
+CREATE TABLE t1 (a INT);
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
+TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+NULL #mysql50#a@b tr1 INSERT NULL #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+NULL #mysql50#a@b tr2 INSERT NULL #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+Warnings:
+Warning 1603 Triggers for table `#mysql50#a@b`.`#mysql50#c@d` have no creation context
+Warning 1603 Triggers for table `#mysql50#a@b`.`t1` have no creation context
+mysqlcheck --fix-db-names --fix-table-names --all-databases
+USE `a@b`;
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
+TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+NULL a@b tr1 INSERT NULL a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+NULL a@b tr2 INSERT NULL a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+INSERT INTO `c@d` VALUES (2), (1);
+SELECT * FROM `c@d`;
+a
+20
+10
+INSERT INTO t1 VALUES (3), (5);
+SELECT * FROM t1;
+a
+300
+500
+DROP DATABASE `a@b`;
+USE test;
End of 5.1 tests
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/partition_pruning.result b/mysql-test/r/partition_pruning.result
index b153ad9ad47..26ddc92e97b 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -1,4 +1,16 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+CREATE TABLE t1
+(a INT NOT NULL AUTO_INCREMENT,
+b DATETIME,
+PRIMARY KEY (a,b),
+KEY (b))
+PARTITION BY RANGE (to_days(b))
+(PARTITION p0 VALUES LESS THAN (733681) COMMENT = 'LESS THAN 2008-10-01',
+PARTITION p1 VALUES LESS THAN (733712) COMMENT = 'LESS THAN 2008-11-01',
+PARTITION pX VALUES LESS THAN MAXVALUE);
+SELECT a,b FROM t1 WHERE b >= '2008-12-01' AND b < '2009-12-00';
+a b
+DROP TABLE t1;
create table t1 ( a int not null) partition by hash(a) partitions 2;
insert into t1 values (1),(2),(3);
explain select * from t1 where a=5 and a=6;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 2df70624ac2..2cedeec145f 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1616,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/read_buffer_size_basic.result b/mysql-test/r/read_buffer_size_basic.result
index 799f7b56235..3c007dc1515 100644
--- a/mysql-test/r/read_buffer_size_basic.result
+++ b/mysql-test/r/read_buffer_size_basic.result
@@ -86,6 +86,8 @@ SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
1
SET @@global.read_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '2147479553'
SELECT @@global.read_buffer_size;
@@global.read_buffer_size
2147479552
@@ -114,6 +116,8 @@ SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
SET @@session.read_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.read_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_buffer_size value: '2147479553'
SELECT @@session.read_buffer_size;
@@session.read_buffer_size
2147479552
diff --git a/mysql-test/r/read_rnd_buffer_size_basic.result b/mysql-test/r/read_rnd_buffer_size_basic.result
index c51b0591054..c6440ac032e 100644
--- a/mysql-test/r/read_rnd_buffer_size_basic.result
+++ b/mysql-test/r/read_rnd_buffer_size_basic.result
@@ -88,6 +88,8 @@ SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 822
@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
1
SET @@global.read_rnd_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_rnd_buffer_size value: '2147479553'
SELECT @@global.read_rnd_buffer_size;
@@global.read_rnd_buffer_size
2147479552
@@ -116,6 +118,8 @@ SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8
SET @@session.read_rnd_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.read_rnd_buffer_size = 2147479553;
+Warnings:
+Warning 1292 Truncated incorrect read_rnd_buffer_size value: '2147479553'
SELECT @@session.read_rnd_buffer_size;
@@session.read_rnd_buffer_size
2147479552
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 b6ac5f34f00..b76109a3d0e 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -211,4 +211,29 @@ drop procedure proc37908;
drop function func37908;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
DROP USER mysqltest_1@localhost;
+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/strict.result b/mysql-test/r/strict.result
index a257d0a8648..1255284f4fe 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -1347,6 +1347,13 @@ t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
drop table t1;
+CREATE TABLE t3 (f1 INT) COMMENT 'כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן';
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן'
+DROP TABLE t3;
set sql_mode= 'traditional';
create table t1(col1 tinyint, col2 tinyint unsigned,
col3 smallint, col4 smallint unsigned,
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index 6df09463d02..ba6b9f81a2d 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -194,4 +194,20 @@ DELETE FROM t1;
SELECT * FROM t1;
a b
DROP TABLE t1;
+DROP TABLE IF EXISTS t1,t2;
+DROP FUNCTION IF EXISTS f1;
+CREATE TEMPORARY TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 LIKE t1;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+return 1;
+END|
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+CREATE TABLE t3 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+UPDATE t1,t2 SET t1.a = t2.a;
+INSERT INTO t2 SELECT f1();
+DROP TABLE t1,t2,t3;
+DROP FUNCTION f1;
End of 5.1 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_date.result b/mysql-test/r/type_date.result
index 7cb71831bce..f96e07b0c5e 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -65,12 +65,15 @@ CREATE TABLE t1(AFIELD INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
-DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1, t2 GROUP BY t1.AFIELD;
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800
INSERT INTO t1 VALUES(1);
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
-DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)),
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1,t2 GROUP BY t1.AFIELD;
+DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800
drop table t1,t2;
CREATE TABLE t1 (f1 time default NULL, f2 time default NULL);
@@ -155,7 +158,7 @@ str_to_date( '', a )
0000-00-00 00:00:00
NULL
DROP TABLE t1;
-CREATE TABLE t1 (a DATE, b int, PRIMARY KEY (a,b));
+CREATE TABLE t1 (a DATE, b INT, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (DATE(NOW()), 1);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
COUNT(*)
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=
+'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title> Title - document with document declaration</title>
+ </head>
+ <body> Hi, Im a webpage with document a declaration </body>
+</html>';
+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('<xml "xxx" "yyy">CharData</xml>', '/xml');
+ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected ('>' wanted)'
+SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
+ExtractValue('<xml xxx "yyy">CharData</xml>', '/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/std_data/bug40482-bin.000001 b/mysql-test/std_data/bug40482-bin.000001
new file mode 100644
index 00000000000..d001bf664c7
--- /dev/null
+++ b/mysql-test/std_data/bug40482-bin.000001
Binary files differ
diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result
index d64d902217b..8dbe0f21852 100644
--- a/mysql-test/suite/binlog/r/binlog_database.result
+++ b/mysql-test/suite/binlog/r/binlog_database.result
@@ -33,6 +33,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # drop database if exists mysqltest1
master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # use `test`; drop table tt1, t1
+FLUSH STATUS;
set binlog_format=mixed;
reset master;
create database testing_1;
@@ -68,6 +69,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # drop database if exists mysqltest1
master-bin.000001 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Query # # use `test`; drop table tt1, t1
+FLUSH STATUS;
set binlog_format=row;
reset master;
create database testing_1;
@@ -108,6 +110,7 @@ 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`; DROP TABLE `t1` /* generated by server */
+FLUSH STATUS;
show databases;
Database
information_schema
diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index c3eabb14f59..d49ceb00501 100644
--- a/mysql-test/suite/binlog/r/binlog_index.result
+++ b/mysql-test/suite/binlog/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 master-bin.000001 was not found
+Warning 1612 Being purged 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/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
index 896d8f734fc..919ac33ef35 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
@@ -113,16 +113,17 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
DROP TABLE t1;
+flush status;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 13
+Binlog_cache_use 0
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 14
+Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
@@ -131,7 +132,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 15
+Binlog_cache_use 2
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 <binlog_start>;
+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 <binlog_start>;
+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 48b682160af..0606c223126 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 <binlog_start>;
@@ -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,11 +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 # 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 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@@ -412,7 +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`; 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.test b/mysql-test/suite/binlog/t/binlog_innodb.test
index df99e3786ee..f84fd65226a 100644
--- a/mysql-test/suite/binlog/t/binlog_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_innodb.test
@@ -101,6 +101,7 @@ DROP TABLE t1;
# Actually this test has nothing to do with innodb per se, it just requires
# transactional table.
#
+flush status;
show status like "binlog_cache_use";
show status like "binlog_cache_disk_use";
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_collation_character_set_applicability.result b/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result
index 7eba964bdf6..7eba964bdf6 100644
--- a/mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result
+++ b/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result
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_1/t/is_collation_character_set_applicability.test b/mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test
index cda7b578aae..84690b0647c 100644
--- a/mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test
+++ b/mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test
@@ -1,7 +1,7 @@
-# suite/funcs_1/t/is_collation_character_set_applicability.test
+# suite/funcs_1/t/is_coll_char_set_appl.test
#
# Check the layout of information_schema.collation_character_set_applicability
-# and some functionality realted tests.
+# and some functionality related tests.
#
# Author:
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
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 <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_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 083f3a4e901..2a4c3a09361 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -227,3 +227,20 @@ select * from t3 order by a;
a
127
drop table t1,t2,t3;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
new file mode 100644
index 00000000000..f94d2833603
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
@@ -0,0 +1,8 @@
+call mtr.add_suppression('Found invalid event in binary log');
+==== Initialize ====
+Setting up fake replication from MYSQL_TEST_DIR/std_data/bug40482-bin.000001
+==== Test ====
+START SLAVE SQL_THREAD;
+Last_SQL_Error = Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
+==== Clean up ====
+Cleaning up after setup_fake_relay_log.inc
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 816e0f3df62..4c64054e348 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -29,7 +29,7 @@ SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
include/stop_slave.inc
include/start_slave.inc
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
Slave_IO_Running = No (expect No)
==== clean up ====
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 b6dede79b9d..29f58632fde 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 ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
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 ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
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 ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
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 ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
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 ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
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 75d1c019098..747e8f235a8 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/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index 8cae44a3607..f3f329c4b5b 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -10,3 +10,4 @@
#
##############################################################################
+rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
new file mode 100644
index 00000000000..815a8f81d32
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
@@ -0,0 +1 @@
+--replicate-same-server-id --relay-log=slave-relay-bin
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
new file mode 100644
index 00000000000..39799180f8b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
@@ -0,0 +1,42 @@
+# ==== Purpose ====
+#
+# Verify that the slave stops gracefully when reading a relay log with
+# corrupted data.
+#
+# ==== Implementation ====
+#
+# Setup "fake replication" where the slave only starts the SQL thread,
+# not the IO thread, and reads from an existing relay log that has
+# been prepared so that it contains the error. This requires some
+# extra server options: see the -master.opt file.
+#
+# ==== Related bugs ====
+#
+# BUG#31793: log event corruption causes crash
+# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
+
+source include/have_log_bin.inc;
+# BUG#40482 only manifested itself in debug-compiled binaries.
+source include/have_debug.inc;
+
+call mtr.add_suppression('Found invalid event in binary log');
+
+
+#
+# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
+#
+# The relay log contains an Incident_log_event with a non-existing
+# incident number.
+
+--echo ==== Initialize ====
+let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
+source include/setup_fake_relay_log.inc;
+
+--echo ==== Test ====
+START SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_error.inc;
+let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+--echo Last_SQL_Error = $error
+
+--echo ==== Clean up ====
+source include/cleanup_fake_relay_log.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index aefae7563d4..79cb2d9d735 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -73,7 +73,11 @@ 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');
@@ -83,7 +87,6 @@ connection slave;
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;
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 e4825a4abfd..319f9546a81 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 e87fa251c80..f4cb0f69e93 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -120,6 +120,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 c16abc98c0d..f3e7841ce9f 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -469,20 +469,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;
#
-# End of tests
+# Bug#40116: Uncommited changes are replicated and stay on slave after
+# rollback on master
#
-save_master_pos;
+
+connection master;
+source include/master-slave-reset.inc;
+source include/have_innodb.inc;
connection slave;
-sync_with_master;
+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
+#
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..19d8b442c2c 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,74 @@
# Save initial value #
#############################################################
-# due to difference when running on Windows (bug filed)
+# due to differences when running on Windows (Bug#36695)
--source include/not_windows.inc
+let $kbrange32 = BETWEEN 32776 AND 32999;
+let $mbrange2 = BETWEEN 2097116 AND 2100000;
+
+--disable_warnings
+
SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-
--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;
+eval
+SELECT @@global.sort_buffer_size $mbrange2;
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
+eval
+SELECT @@session.sort_buffer_size $mbrange2;
--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;
+eval
+SELECT @@global.sort_buffer_size $mbrange2;
SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
+eval
+SELECT @@session.sort_buffer_size $mbrange2;
--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;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = 32777;
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
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;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
SET @@session.sort_buffer_size = 32777;
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 4294967294;
@@ -104,13 +116,15 @@ 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;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = -1024;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
--Error ER_PARSE_ERROR
@@ -121,19 +135,18 @@ 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;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
SET @@session.sort_buffer_size = -2;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+eval
+SELECT @@session.sort_buffer_size $kbrange32;
--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 +154,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 +172,24 @@ 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;
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
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';
-
+eval
+SELECT @@global.sort_buffer_size $kbrange32;
--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 +198,12 @@ 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;
+eval
+SELECT @@sort_buffer_size $kbrange32;
--Error ER_UNKNOWN_TABLE
SELECT local.sort_buffer_size;
--Error ER_UNKNOWN_TABLE
@@ -203,11 +217,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..9d3eadcc26f 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 BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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
-1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
+SELECT @@sort_buffer_size BETWEEN 32776 AND 32999;
+@@sort_buffer_size BETWEEN 32776 AND 32999
+1
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..c993c8a0a88 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 BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 2097116 AND 2100000;
+@@global.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 2097116 AND 2100000;
+@@session.sort_buffer_size BETWEEN 2097116 AND 2100000
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@session.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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 BETWEEN 32776 AND 32999;
+@@global.sort_buffer_size BETWEEN 32776 AND 32999
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
-1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
+SELECT @@sort_buffer_size BETWEEN 32776 AND 32999;
+@@sort_buffer_size BETWEEN 32776 AND 32999
+1
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
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
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 6dbed2e0b60..f9708002ee6 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1533,5 +1533,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 eb93288b0aa..abc161d014c 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1805,4 +1805,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/date_formats.test b/mysql-test/t/date_formats.test
index abf09942d1c..e474fac8a2a 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -340,3 +340,15 @@ select str_to_date('04/30 /2004', '%m /%d /%Y');
select str_to_date('04/30/2004 ', '%m/%d/%Y ');
--echo "End of 4.1 tests"
+
+#
+# Bug #41470: DATE_FORMAT() crashes the complete server with a valid date
+#
+
+# show that these two do not crash the server:
+SELECT DATE_FORMAT("0000-01-01",'%W %d %M %Y') as valid_date;
+SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
+# show that date within the Gregorian range render correct results: (THU)
+SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
+
+--echo "End of 5.0 tests"
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 71b7def1319..1c461ab47bb 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -18,6 +18,9 @@ rpl_max_binlog_size_func : BUG#37962 2008-07-08 sven *_func tests c
slow_query_log_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
sql_low_priority_updates_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
timestamp_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
-slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
log_bin_trust_function_creators_func : Bug#41003 Dec-12-2008 andrei todo:re-enable after merging the bug fixes from the main trees.
innodb_max_dirty_pages_pct_func : BUG#41018 BUG#39382 2008-12-02 sven test fails often. some failures fill up the disk, causing subsequent failures in many other tests
+federated_transactions : Bug#29523 Transactions do not work
+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_bugs.test b/mysql-test/t/events_bugs.test
index 2e782cdd52c..69e2f681aa2 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -1,40 +1,133 @@
#### t/events_bugs.test
#
# Last change:
-# 2008-10-16 mleich
+# 2009-01-08 mleich
# - Fix for
-# Bug#39848 events_bugs fails sporadically on pushbuild
-# (missing rows in table event_log)
-# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes
-# in I_S.PROCESSLIST)
-# Bug#39978 main.events_bugs does not clean up
-# Bug#39569 events_bugs fails sporadically on pushbuild (should have
-# failed with errno 1539)
-# - Minor improvements of formatting
-#
-#
-# Outcome of some experiments (mleich):
-# 1. SET GLOBAL event_scheduler = 'ON';
-# Immediate observation of the processlist.
-# Effects:
-# 1. There is no guarantee to find immediate the user 'event_scheduler'
-# within information_schema.processlist.
-# 2. Some states of the user 'event_scheduler' found in PROCESSLIST:
-# USER HOST DB COMMAND TIME STATE INFO
-# event_scheduler localhost NULL Daemon 0 Waiting on empty queue NULL
-# event_scheduler localhost NULL Daemon 0 Initialized NULL
+# Bug#41111 events_bugs fails sporadically on pushbuild
+# - Avoid effects of
+# Bug#41925 Warning 1366 Incorrect string value: ... for column processlist.info
+#
+# Please set $
+let $fixed_bug41925= 0;
+#
+# Dear maintainer of this test. Please do NOT remove the next big comment.
+# The tests for events were quite unstable over a significant time because the
+# effects of events in general and their representation within the processlist
+# were partially not known. Therefore I had to make excessive experiments.
+# The comment with the outcome of these experiments will be moved into a README
+# file as soon as the tests for events get their own testsuite.
+#
+# Outcome of some experiments (mleich, mysql-5.1 2008-12):
+# --------------------------------------------------------
+# 0. Most time used setup:
+# High parallel I/O load
+# set global event_scheduler= off;
+# sleep 3;
+# use events_test;
+# create event e_16407 on schedule every 2 second do
+# begin
+# select 'FIRST COMMAND', sleep(0.5);
+# select 'SECOND COMMAND';
+# end|
+# set global event_scheduler= on;
+# Start observation of the processlist
+#
+#
+# 1. SET GLOBAL event_scheduler = 'ON' and immediate observation of the processlist.
+# 1.1 Effects around event scheduler:
+# 1.1.1 First phase (very short)
+# No user 'event_scheduler' within information_schema.processlist.
+# 1.1.2 Second phase observed (independend of probably existing events and very short) was
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 Initialized NULL
+# 1.1.3 Third phase observed:
+# 1.1.3.1 Case we do not have existing events (rather long)
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 Waiting on empty queue NULL
+# 1.1.3.2 Case there exists already an event
+# 1.1.3.2.1 Event executor is not visible in processlist but comes up soon
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 NULL
+# or
+# event_scheduler localhost NULL Daemon 0 NULL NULL
+# 1.1.3.2.2 A bit later, at least one event executor is or was visible in processlist
+# The states mentioned in 3.2.1 or a bit later
+# USER HOST DB COMMAND TIME STATE INFO
+# event_scheduler localhost NULL Daemon 0 Waiting for next activation NULL
+# 1.2 Effects around event executor:
+# Typical processlist content:
+# USER evtest1 -- Definer of event
+# DB events_test -- DB during time of event creation (use DB is not allowed in events)
+# COMMAND Connect
+# STATE NULL
+# INFO SET @evname = 'ev_sched_1823' -- Part of the event code
+#
+# State before "User sleep select 'FIRST COMMAND', sleep(0.5);"
+# ID USER HOST DB COMMAND TIME STATE INFO
+# 7 event_scheduler localhost NULL Connect 0 NULL NULL
+# !! The user is not the event creator and the DB is different. !!
+# !! This means that we must get later a change of the identity. !!
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 checking permissions
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 checking permissions CREATE PROCEDURE ....
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 NULL select 'FIRST COMMAND', sleep(0.5)
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 checking permissions select 'FIRST COMMAND'...
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 Opening table select 'FIRST COMMAND', sleep(0.5)
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 Locked select 'FIRST COMMAND', sleep(0.5)
+# or
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 executing select 'FIRST COMMAND', sleep(0.5)
+#
+# State "User sleep select 'FIRST COMMAND', sleep(0.5);" reached
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 User sleep select 'FIRST COMMAND', sleep(0.5)
+#
+# State at end (! It looks like a slow CREATE PROC !) of event code execution was sometimes
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 logging slow query CREATE PROCEDURE `e_16407`...
+#
+# State after running some event code was sometimes
+# USER HOST DB COMMAND TIME STATE INFO
+# root localhost events_test Connect 0 logging slow query select 'SECOND COMMAND'
+#
+# State somewhere (I guess just before the event executor disappears)
+# USER HOST DB COMMAND TIME STATE INFO
+# Event thread fin <empty> events_test Connect 0 Clearing NULL
+#
+#
# 2. SET GLOBAL event_scheduler = 'OFF';
# Immediate observation of the processlist.
# Effects:
# 1. I never found the user 'event_scheduler' within the processlist.
# 2. Events just during execution could be found within the processlist
# = It does not look like "SET GLOBAL event_scheduler = 'OFF'" stops them.
-# 3. An event gets executed
-# USER evtest1 (Definer of event)
-# DB events_test (DB during time of event creation)
-# COMMAND Connect
-# STATE NULL
-# INFO SET @evname = 'ev_sched_1823' (Part of the event code)
+# ==> Everything mentioned in 1.2 above could be observed.
+#
+# Several subtests were weak because they showed random result set differences after issuing
+# "SET GLOBAL EVENT_SCHEDULER= off;".
+# 1. Reason one: There were already event executors
+# Fix: Wait till there is no event executor active ==> no session WHERE
+# - command IN ('Connect')
+# There must be no parallel session being just in "Connect" phase!
+# or
+# - user = <who created the maybe current running events>
+# There must be no parallel session of this person.
+# or user = 'event_scheduler' with command = 'Connect'
+# The session which will soon change its identity to event creator.
+#
+# 2. Reason two: If an event modifies a MyISAM table than a delayed visibilty of changes
+# might occur (concurrent_inserts=on or delayed inserts ...).
#
# Can't test with embedded server that doesn't support grants
@@ -47,6 +140,10 @@ drop database if exists mysqltest_db2;
--enable_warnings
create database events_test;
use events_test;
+# We use MyISAM tables and must avoid effects (visibility of changes might be
+# delayed) caused by concurrent_insert on (default).
+set @concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert = 0;
#
# START: Bug #31332 --event-scheduler option misbehaving
@@ -56,8 +153,11 @@ use events_test;
# option with no argument in events_bugs-master.opt turns the scheduler on.
select * from information_schema.global_variables where variable_name like 'event_scheduler';
+# Check that the event_scheduler is really running
+--source include/running_event_scheduler.inc
SET GLOBAL event_scheduler = 'OFF';
+--source include/check_events_off.inc
#
# END: Bug #31332
@@ -132,8 +232,10 @@ create event e_55 on schedule every 10 hour starts 10000101000000 do drop table
# Start - 16407: Events: Changes in sql_mode won't be taken into account
#
set global event_scheduler=off;
+--source include/check_events_off.inc
delete from mysql.event;
set global event_scheduler= on;
+--source include/running_event_scheduler.inc
set @old_sql_mode:=@@sql_mode;
set sql_mode=ansi;
select get_lock('test_bug16407', 60);
@@ -148,13 +250,13 @@ delimiter ;|
# We wait till one event runs and hangs when trying to get the user lock.
let $wait_condition=
select count(*) > 0 from information_schema.processlist
- where info = 'select get_lock(\'test_bug16407\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
--source include/wait_condition.inc
--echo "Now if everything is fine the event has compiled and is locked"
# Expect to see one session in events_test waiting for the user lock.
select /*1*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'test_bug16407\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
select release_lock('test_bug16407');
# Try to avoid
# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes in I_S.PROCESSLIST)
@@ -162,23 +264,27 @@ select release_lock('test_bug16407');
# Bug#32782 User lock hash fails to find lock
# "various issues related to missing or incorrect return results
# from release_lock()."
-# Therefore we check here if the event executing session disappeared or
+# Therefore we check here if the event executor is no more locked or
# we waited >= 5 seconds for this to happen.
let $wait_timeout= 5;
let $wait_condition=
select count(*) = 0 from information_schema.processlist
- where info = 'select get_lock(\'test_bug16407\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)';
--source include/wait_condition.inc
if (!`$wait_condition`)
{
- --echo ERROR: There must be no session with info = 'select get_lock('test_bug16407', 60) within the processlist.
+ --echo ERROR: There must be no session with
+ --echo state = 'User lock' and info = 'select get_lock('test_bug16407', 60)
+ --echo within the processlist.
--echo We probably hit Bug#32782 User lock hash fails to find lock
- eval select * from information_schema.processlist;
+ SELECT * FROM information_schema.processlist;
--echo Abort
exit;
}
set global event_scheduler= off;
+# Wait till the event scheduler and all event executors have finished their work.
+--source include/check_events_off.inc
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
--echo "Let's check whether we change the sql_mode on ALTER EVENT"
@@ -191,9 +297,10 @@ set sql_mode="ansi";
select get_lock('ee_16407_2', 60);
set global event_scheduler= 1;
+--source include/running_event_scheduler.inc
--echo "Another sql_mode test"
set sql_mode="traditional";
-create table events_smode_test(ev_name char(10), a date) engine=myisam;
+create table events_smode_test(ev_name char(10), a date);
--echo "This should never insert something"
delimiter |;
create event ee_16407_2 on schedule every 60 second do
@@ -203,7 +310,7 @@ begin
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
--error ER_TRUNCATED_WRONG_VALUE
-insert into events_smode_test values ('test','1980-19-02')|
+insert into events_test.events_smode_test values ('test','1980-19-02')|
--echo "This is ok"
create event ee_16407_3 on schedule every 60 second do
begin
@@ -223,13 +330,20 @@ end|
delimiter ;|
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
+# We wait till we have three event executors waiting for the removal of the lock.
let $wait_condition=
select count(*) = 3 from information_schema.processlist
- where info = 'select get_lock(\'ee_16407_2\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
--source include/wait_condition.inc
+# There is an extreme low risk that an additional event execution is just coming
+# up because
+# - the events have to be started every 60 seconds.
+# - we are just after event creation + waiting for seeing 3 locked
+# We expect to see three event executors in state 'User lock'.
select /*2*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
+
select release_lock('ee_16407_2');
# Try to avoid
@@ -244,13 +358,37 @@ let $wait_timeout= 5;
let $wait_condition=
select count(*) = 0
from information_schema.processlist
- where info = 'select get_lock(\'ee_16407_2\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
--source include/wait_condition.inc
+if (!`$wait_condition`)
+{
+ --echo ERROR: There must be no session with
+ --echo state = 'User lock' and info = 'select get_lock('test_bug16407_2', 60)
+ --echo within the processlist.
+ --echo We probably hit Bug#32782 User lock hash fails to find lock
+ SELECT * FROM information_schema.processlist;
+ --echo Abort
+ exit;
+}
+# We expect to see no event executors in state 'User lock'.
+if(!$fixed_bug41925)
+{
+ --disable_warnings
+}
select /*3*/ user, host, db, info from information_schema.processlist
-where info = 'select get_lock(\'ee_16407_2\', 60)';
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
+if(!$fixed_bug41925)
+{
+ --enable_warnings
+}
+
set global event_scheduler= off;
-select * from events_smode_test order by ev_name, a;
+# Wait till the event scheduler and all event executors have finished their work.
+# Without this the next queries will give unstable results.
+--source include/check_events_off.inc
+
+select * from events_test.events_smode_test order by ev_name, a;
--echo "OK, last check before we drop them"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
drop event ee_16407_2;
@@ -259,11 +397,12 @@ drop event ee_16407_4;
--echo "And now one last test regarding sql_mode and call of SP from an event"
-delete from events_smode_test;
+delete from events_test.events_smode_test;
set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
set global event_scheduler= on;
+--source include/running_event_scheduler.inc
set sql_mode='traditional';
delimiter |;
@@ -286,34 +425,46 @@ delimiter ;|
let $wait_condition=
select count(*) = 2 from information_schema.processlist
- where info = 'select get_lock(\'ee_16407_5\', 60)';
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
--source include/wait_condition.inc
--echo "Should have 2 locked processes"
select /*4*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
+
select release_lock('ee_16407_5');
let $wait_condition=
- select count(*) = 1 and user = 'event_scheduler' and info is null
- from information_schema.processlist
- where (command!='Daemon' || user='event_scheduler')
- and (info is null or info not like '%processlist%');
+ select count(*) = 0 from information_schema.processlist
+ where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
--source include/wait_condition.inc
--echo "Should have 0 processes locked"
+if(!$fixed_bug41925)
+{
+ --disable_warnings
+}
select /*5*/ user, host, db, info from information_schema.processlist
-where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
-order by info;
-select * from events_smode_test order by ev_name, a;
+where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)';
+if(!$fixed_bug41925)
+{
+ --enable_warnings
+}
+
+# Wait till all event executors have finished their work, so that we can be sure
+# that their changes to events_smode_test are done.
+--source include/no_running_events.inc
+
+select * from events_test.events_smode_test order by ev_name, a;
--echo "And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
+
drop event ee_16407_5;
drop event ee_16407_6;
drop procedure ee_16407_5_pendant;
drop procedure ee_16407_6_pendant;
set global event_scheduler= off;
+--source include/check_events_off.inc
drop table events_smode_test;
set sql_mode=@old_sql_mode;
#
@@ -324,6 +475,7 @@ set sql_mode=@old_sql_mode;
# START - 18897: Events: unauthorized action possible with alter event rename
#
set global event_scheduler=off;
+--source include/check_events_off.inc
--disable_warnings
delete from mysql.user where User like 'mysqltest_%';
delete from mysql.db where User like 'mysqltest_%';
@@ -409,6 +561,7 @@ create function f22830 () returns int return 5;
select get_lock('ee_22830', 60);
set global event_scheduler=on;
+--source include/running_event_scheduler.inc
delimiter |;
create procedure p22830_wait()
@@ -456,6 +609,7 @@ let $wait_condition=
--source include/wait_condition.inc
set global event_scheduler=off;
+--source include/check_events_off.inc
select event_name, event_definition, interval_value, interval_field from information_schema.events order by event_name;
drop procedure p22830_wait;
drop function f22830;
@@ -537,6 +691,7 @@ DROP USER mysqltest_u1@localhost;
# For the actual tests of time zones please see events_time_zone.test
#
SET GLOBAL EVENT_SCHEDULER= OFF;
+--source include/check_events_off.inc
SET @save_time_zone= @@TIME_ZONE;
#----------------------------------------------------------------------
@@ -749,6 +904,7 @@ let $engine=MyISAM;
USE test;
SHOW GRANTS FOR CURRENT_USER;
SET GLOBAL event_scheduler = ON;
+--source include/running_event_scheduler.inc
eval
CREATE TABLE events_test.event_log
(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
@@ -817,12 +973,14 @@ disconnect e1;
DROP EVENT events_test.ev_sched_1823;
DROP TABLE events_test.event_log;
SET GLOBAL event_scheduler = OFF;
+--source include/check_events_off.inc
#
# Bug#28641 CREATE EVENT with '2038.01.18 03:00:00' let server crash.
#
SET GLOBAL event_scheduler= ON;
+--source include/running_event_scheduler.inc
DELIMITER |;
CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
DO BEGIN
@@ -831,6 +989,7 @@ END;|
DELIMITER ;|
SET GLOBAL event_scheduler= OFF;
+--source include/check_events_off.inc
DROP EVENT bug28641;
###########################################################################
@@ -955,6 +1114,7 @@ SET GLOBAL READ_ONLY = 1;
--echo
SET GLOBAL EVENT_SCHEDULER = ON;
+--source include/running_event_scheduler.inc
--echo
@@ -980,6 +1140,7 @@ let $wait_condition =
--echo
SET GLOBAL EVENT_SCHEDULER = OFF;
+--source include/check_events_off.inc
--echo
@@ -1056,15 +1217,15 @@ drop event e1;
#
###########################################################################
-let $wait_condition=
- select count(*) = 0 from information_schema.processlist
- where db='events_test' and command = 'Connect' and user=current_user();
---source include/wait_condition.inc
+# Ensure that all event executors have finished their work and cannot harm
+# the next test.
+--source include/no_running_events.inc
DROP DATABASE events_test;
# Restore the original state i.e to how it was when test started
# (option with no argument in events_bugs-master.opt turns the scheduler on).
-
SET GLOBAL event_scheduler= 'ON';
+--source include/running_event_scheduler.inc
+SET @@global.concurrent_insert= @concurrent_insert;
# THIS MUST BE THE LAST LINE in this file.
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_in.test b/mysql-test/t/func_in.test
index d0d4dea0713..3fc1697f146 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -426,4 +426,17 @@ select * from t1 where NOT id in (select null union all select 1);
select * from t1 where NOT id in (null, 1);
drop table t1;
+#
+# Bug #41363: crash of mysqld on windows with aggregate in case
+#
+
+CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
+INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1);
+
+SELECT CASE AVG (c0) WHEN c1 * c2 THEN 1 END FROM t1;
+SELECT CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END FROM t1;
+SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
+
+DROP TABLE t1;
+
--echo End of 5.1 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 3e5923157fe..b9da946a55f 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 853fd43028e..a9491dc2736 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1295,6 +1295,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 d475fb2adb9..7105d7e04f0 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1387,4 +1387,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 b51e8422fff..e6b804c4fff 100644
--- a/mysql-test/t/innodb-autoinc.test
+++ b/mysql-test/t/innodb-autoinc.test
@@ -131,3 +131,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 53a210e9972..b0353ed5268 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -2477,6 +2477,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;
@@ -2493,6 +2494,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..b3fcd89f371
--- /dev/null
+++ b/mysql-test/t/innodb_bug38231.test
@@ -0,0 +1,75 @@
+#
+# 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,,)
+
+-- connection con1
+SET autocommit=0;
+LOCK TABLE bug38231 WRITE;
+
+-- connection con2
+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
+# TODO: Replace with wait_condition once possible under embedded server.
+-- sleep 0.2
+# this crashes the server if the bug is present
+UNLOCK TABLES;
+
+# clean up
+
+-- connection con2
+-- reap
+UNLOCK TABLES;
+
+-- connection default
+-- reap
+-- disconnect con1
+-- disconnect con2
+
+# 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..21ee440f10b 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -53,3 +53,135 @@ 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;
+
+#
+# Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites locking type of temp table
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t3,t2;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+DELIMITER |;
+CREATE FUNCTION f1() RETURNS VARCHAR(250)
+ BEGIN
+ return 'hhhhhhh' ;
+ END|
+DELIMITER ;|
+
+CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) ENGINE=INNODB;
+
+BEGIN WORK;
+
+CREATE TEMPORARY TABLE t2 (a VARCHAR(20), b VARCHAR(20), c varchar(20)) ENGINE=INNODB;
+CREATE TEMPORARY TABLE t3 LIKE t2;
+
+INSERT INTO t1 VALUES ('a','b',NULL),('c','d',NULL),('e','f',NULL);
+
+SET @stmt := CONCAT('INSERT INTO t2 SELECT tbl.a, tbl.b, f1()',' FROM t1 tbl');
+PREPARE stmt1 FROM @stmt;
+
+SET @stmt := CONCAT('INSERT INTO t3', ' SELECT * FROM t2');
+PREPARE stmt3 FROM @stmt;
+
+EXECUTE stmt1;
+
+COMMIT;
+
+DEALLOCATE PREPARE stmt1;
+DEALLOCATE PREPARE stmt3;
+
+DROP TABLE t1,t3,t2;
+DROP FUNCTION f1;
+
+#
+# Bug#37016: TRUNCATE TABLE removes some rows but not all
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY,
+ t1_id INT, INDEX par_ind (t1_id),
+ FOREIGN KEY (t1_id) REFERENCES t1(id)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (3,2);
+
+SET AUTOCOMMIT = 0;
+
+START TRANSACTION;
+--error ER_ROW_IS_REFERENCED_2
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+COMMIT;
+SELECT * FROM t1;
+
+START TRANSACTION;
+--error ER_ROW_IS_REFERENCED_2
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+ROLLBACK;
+SELECT * FROM t1;
+
+SET AUTOCOMMIT = 1;
+
+START TRANSACTION;
+SELECT * FROM t1;
+COMMIT;
+
+--error ER_ROW_IS_REFERENCED_2
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+DELETE FROM t2 WHERE id = 3;
+
+START TRANSACTION;
+SELECT * FROM t1;
+TRUNCATE TABLE t1;
+ROLLBACK;
+SELECT * FROM t1;
+TRUNCATE TABLE t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/innodb_mysql_rbk-master.opt b/mysql-test/t/innodb_mysql_rbk-master.opt
new file mode 100644
index 00000000000..0e400f9c36b
--- /dev/null
+++ b/mysql-test/t/innodb_mysql_rbk-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=1 --innodb_rollback_on_timeout=1
diff --git a/mysql-test/t/innodb_mysql_rbk.test b/mysql-test/t/innodb_mysql_rbk.test
new file mode 100644
index 00000000000..d2368c81f95
--- /dev/null
+++ b/mysql-test/t/innodb_mysql_rbk.test
@@ -0,0 +1,35 @@
+-- source include/have_innodb.inc
+
+#
+# Bug #41453: Assertion `m_status == DA_ERROR' failed in
+# Diagnostics_area::sql_errno
+#
+
+CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
+DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+CONNECT (con1,localhost,root,,);
+CONNECT (con2,localhost,root,,);
+
+CONNECTION con1;
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+CONNECTION con2;
+START TRANSACTION;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
+ROLLBACK;
+
+CONNECTION con1;
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
+CONNECTION con2;
+START TRANSACTION;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
+SELECT * FROM t1 WHERE b = 10;
+
+CONNECTION default;
+DISCONNECT con1;
+DISCONNECT con2;
+DROP TABLE t1;
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 265911a0207..0168114b11b 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
@@ -46,10 +48,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
@@ -59,8 +61,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/log_state.test b/mysql-test/t/log_state.test
index c1249985eba..e40dd1e3491 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -1,14 +1,29 @@
-# hhunger 08.22.2008: with check-testcases differences due to bug#38889 using
-# slow_query_log_file or general_log_file
-
--- source include/not_embedded.inc
+### t/log_state.test ###
+#
+# This test suffers from server
+# Bug#38124 "general_log_file" variable silently unset when using expression
+# In short:
+# SET GLOBAL general_log_file = @<whatever>
+# SET GLOBAL slow_query_log = @<whatever>
+# cause that the value of these server system variables is set to default
+# instead of the assigned values. There comes no error message or warning.
+# If this bug is fixed please
+# 1. try this test with "let $fixed_bug38124 = 0;"
+# 2. remove all workarounds if 1. was successful.
+let $fixed_bug38124 = 0;
+
+--source include/not_embedded.inc
--source include/have_csv.inc
+# Several subtests modify global variables. Save the initial values only here,
+# but reset to the initial values per subtest.
+SET @old_general_log= @@global.general_log;
+SET @old_general_log_file= @@global.general_log_file;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_slow_query_log_file= @@global.slow_query_log_file;
+
+
--disable_ps_protocol
-# save default value to set them back at the end of the test
-set @start_general_log= @@global.general_log;
-set @start_slow_query_log= @@global.slow_query_log;
-set @start_general_log_file= @@global.general_log_file;
set global general_log= OFF;
truncate table mysql.general_log;
@@ -31,20 +46,32 @@ show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
+--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
+--echo # Switch to connection con1
connection con1;
-set session long_query_time=1;
-select sleep(2);
+# Please increase @long_query_time if the corresponding selects show an
+# additional unexpected entry like
+# start_time ... sql_text
+# TIMESTAMP ... set session long_query_time=...
+# (Bug#40377 sporadic pushbuild failure in log_state: result mismatch)
+--replace_result 2 <long_query_time>
+set @long_query_time = 2;
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+--echo # Switch to connection default
connection default;
set global slow_query_log= ON;
+--echo # Switch to connection con1
connection con1;
-set session long_query_time=1;
-select sleep(2);
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+--echo # Switch to connection default
connection default;
show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
@@ -80,7 +107,7 @@ show variables like 'log_output';
# Can't set general_log_file to a non existing file
--error ER_WRONG_VALUE_FOR_VAR
-set global general_log_file='/not exiting path/log.master';
+set global general_log_file='/not existing path/log.master';
# Can't set general_log_file to a directory
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -134,17 +161,30 @@ drop table t1;
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
select * from mysql.general_log;
-#
-# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
-# a deadlock)
+# Reset to initial values
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
-# save state
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+###########################################################################
-# Test ON->OFF transition under a GLOBAL READ LOCK
+#
+# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
+# a deadlock)
+#
+# Test ON->OFF transition under a GLOBAL READ LOCK
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
@@ -156,7 +196,6 @@ SET GLOBAL slow_query_log = OFF;
UNLOCK TABLES;
# Test OFF->ON transition under a GLOBAL READ LOCK
-
FLUSH TABLES WITH READ LOCK;
SET GLOBAL general_log = ON;
@@ -165,7 +204,6 @@ SET GLOBAL slow_query_log = ON;
UNLOCK TABLES;
# Test ON->OFF transition under a GLOBAL READ_ONLY
-
SET GLOBAL READ_ONLY = ON;
SET GLOBAL general_log = OFF;
@@ -174,7 +212,6 @@ SET GLOBAL slow_query_log = OFF;
SET GLOBAL READ_ONLY = OFF;
# Test OFF->ON transition under a GLOBAL READ_ONLY
-
SET GLOBAL READ_ONLY = ON;
SET GLOBAL general_log = ON;
@@ -182,17 +219,18 @@ SET GLOBAL slow_query_log = ON;
SET GLOBAL READ_ONLY = OFF;
-# Restore state
+# Reset to initial values
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
+
+###########################################################################
#
-# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
+# Bug#29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
#
-SET @old_general_log_state = @@global.general_log;
-SET @old_slow_log_state = @@global.slow_query_log;
+SET GLOBAL general_log = ON;
SHOW VARIABLES LIKE 'general_log';
SHOW VARIABLES LIKE 'log';
@@ -218,67 +256,84 @@ SHOW VARIABLES LIKE 'slow_query_log';
SHOW VARIABLES LIKE 'log_slow_queries';
SELECT @@slow_query_log, @@log_slow_queries;
-SET GLOBAL general_log = @old_general_log_state;
-SET GLOBAL slow_query_log = @old_slow_log_state;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+
+
+###########################################################################
#
-# Bug #31604: server crash when setting slow_query_log_file/general_log_file
+# Bug#31604: server crash when setting slow_query_log_file/general_log_file
#
-set @old_general_log_file= @@global.general_log_file;
-set @old_slow_query_log_file= @@global.slow_query_log_file;
--error ER_WRONG_VALUE_FOR_VAR
-set global general_log_file= concat('/not exiting path/log.maste', 'r');
+SET GLOBAL general_log_file= CONCAT('/not existing path/log.maste', 'r');
--error ER_WRONG_VALUE_FOR_VAR
-set global general_log_file= NULL;
+SET GLOBAL general_log_file= NULL;
--error ER_WRONG_VALUE_FOR_VAR
-set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
+SET GLOBAL slow_query_log_file= CONCAT('/not existing path/log.maste', 'r');
--error ER_WRONG_VALUE_FOR_VAR
-set global slow_query_log_file= NULL;
-
-set global general_log_file= @old_general_log_file;
-set global slow_query_log_file= @old_slow_query_log_file;
+SET GLOBAL slow_query_log_file= NULL;
+
+# Reset to initial values in case a setting above was successful.
+SET GLOBAL general_log_file= @old_general_log_file;
+SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
###########################################################################
--echo
--echo # --
--echo # -- Bug#32748: Inconsistent handling of assignments to
---echo # -- general_log_file/slow_query_log_file.
+--echo # -- general_log_file/slow_query_log_file.
--echo # --
--echo
-SET @general_log_file_saved = @@global.general_log_file;
-SET @slow_query_log_file_saved = @@global.slow_query_log_file;
-
---echo
SET GLOBAL general_log_file = 'bug32748.query.log';
SET GLOBAL slow_query_log_file = 'bug32748.slow.log';
--echo
SHOW VARIABLES LIKE '%log_file';
+# Reset to initial values
--echo
-SET GLOBAL general_log_file = @general_log_file_saved;
-SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
+SET GLOBAL general_log_file = @old_general_log_file;
+SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
--echo
--echo # -- End of Bug#32748.
-###########################################################################
-
+###########################################################################
-## WL#4403 - deprecate @log and @slow_log_queries variables
+# WL#4403 - deprecate @log and @slow_log_queries variables
-## these are all deprecated -- show for command-line as well!
+# These server system variables are all deprecated
+# -- show for command-line as well!
--echo deprecated:
SET GLOBAL log = 0;
SET GLOBAL log_slow_queries = 0;
SET GLOBAL log = DEFAULT;
SET GLOBAL log_slow_queries = DEFAULT;
-## these are NOT deprecated
+# These server system variables are NOT deprecated.
--echo not deprecated:
SELECT @@global.general_log_file INTO @my_glf;
SELECT @@global.slow_query_log_file INTO @my_sqlf;
@@ -291,6 +346,20 @@ SET GLOBAL slow_query_log_file = @my_sqlf;
SET GLOBAL general_log = DEFAULT;
SET GLOBAL slow_query_log = DEFAULT;
+## Reset to initial values
+SET @@global.general_log = @old_general_log;
+SET @@global.general_log_file = @old_general_log_file;
+SET @@global.slow_query_log = @old_slow_query_log;
+SET @@global.slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
--echo End of 5.1 tests
@@ -298,17 +367,30 @@ SET GLOBAL slow_query_log = DEFAULT;
--enable_ps_protocol
#
-# Cleanup (must be done last to avoid delayed 'Quit' message in general log)
+# Cleanup
#
+# Disconnect must be done last to avoid delayed 'Quit' message in general log
+--echo # Close connection con1
disconnect con1;
# set back the saved default values
connection default;
-set @@global.general_log= @start_general_log;
-set @@global.slow_query_log= @start_slow_query_log;
-set @@global.general_log_file= @start_general_log_file;
+
+# Reset global system variables to initial values if forgotten somewhere above.
+SET global general_log = @old_general_log;
+SET global general_log_file = @old_general_log_file;
+SET global slow_query_log = @old_slow_query_log;
+SET global slow_query_log_file = @old_slow_query_log_file;
+if(!$fixed_bug38124)
+{
+ --disable_query_log
+ let $my_var = `SELECT @old_general_log_file`;
+ eval SET @@global.general_log_file = '$my_var';
+ let $my_var = `SELECT @old_slow_query_log_file`;
+ eval SET @@global.slow_query_log_file = '$my_var';
+ --enable_query_log
+}
# Remove the log files that was created in the "default location"
# i.e var/run
--remove_file $MYSQLTEST_VARDIR/run/mysqld.log
---remove_file $MYSQLTEST_VARDIR/run/mysqld-slow.log
-
+--remove_file $MYSQLTEST_VARDIR/tmp/log.master
diff --git a/mysql-test/t/myisam_data_pointer_size_func.test b/mysql-test/t/myisam_data_pointer_size_func.test
index 854209834d9..37dd3a5a297 100644
--- a/mysql-test/t/myisam_data_pointer_size_func.test
+++ b/mysql-test/t/myisam_data_pointer_size_func.test
@@ -103,7 +103,6 @@ DROP TABLE t1;
connection default;
SET @@global.myisam_data_pointer_size= @start_value;
-
################################################################
# End of functionality Testing for myisam_data_pointer_size #
################################################################
diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test
index 89bd8b02bd1..2650c0d2cc3 100644
--- a/mysql-test/t/myisampack.test
+++ b/mysql-test/t/myisampack.test
@@ -32,3 +32,29 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MYISAMCHK -s --unpack $MYSQLD_DATADIR/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;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYISAMPACK $MYSQLD_DATADIR/test/t1
+optimize table t1;
+drop table t1;
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 528337da77b..a182da5fbea 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -291,6 +291,30 @@ 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;
+
+#
+# Bug #41437: Value stored in 'case' lacks charset, causees segfault
+#
+--exec $MYSQL -e "select @z:='1',@z=database()"
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index 4d196cb86ad..e834c60dcb5 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -119,4 +119,79 @@ drop view v1, `v-1`;
drop table t1;
+#
+# Bug #33094: Error in upgrading from 5.0 to 5.1 when table contains triggers
+# Bug #41385: Crash when attempting to repair a #mysql50# upgraded table with
+# triggers
+#
+SET NAMES utf8;
+CREATE TABLE `#mysql50#@` (a INT);
+SHOW TABLES;
+SET NAMES DEFAULT;
+--echo mysqlcheck --fix-table-names --databases test
+--exec $MYSQL_CHECK --fix-table-names --databases test
+SET NAMES utf8;
+SHOW TABLES;
+DROP TABLE `@`;
+
+CREATE TABLE `Ñ` (a INT);
+SET NAMES DEFAULT;
+--echo mysqlcheck --default-character-set="latin1" --databases test
+# Error returned depends on platform, replace it with "Table doesn't exist"
+--replace_result "Can't find file: './test/@003f.frm' (errno: 22)" "Table doesn't exist" "Table 'test.?' doesn't exist" "Table doesn't exist"
+--exec $MYSQL_CHECK --default-character-set="latin1" --databases test
+--echo mysqlcheck --default-character-set="utf8" --databases test
+--exec $MYSQL_CHECK --default-character-set="utf8" --databases test
+SET NAMES utf8;
+DROP TABLE `Ñ`;
+SET NAMES DEFAULT;
+
+CREATE DATABASE `#mysql50#a@b`;
+USE `#mysql50#a@b`;
+CREATE TABLE `#mysql50#c@d` (a INT);
+CREATE TABLE t1 (a INT);
+
+# Create 5.0 like triggers
+let $MYSQLTEST_VARDIR= `select @@datadir`;
+--write_file $MYSQLTEST_VARDIR/a@b/c@d.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON `c@d` FOR EACH ROW SET NEW.a = 10 * NEW.a'
+sql_modes=0
+definers='root@localhost'
+EOF
+--write_file $MYSQLTEST_VARDIR/a@b/tr1.TRN
+TYPE=TRIGGERNAME
+trigger_table=c@d
+EOF
+--write_file $MYSQLTEST_VARDIR/a@b/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 BEFORE INSERT ON `a@b`.t1 FOR EACH ROW SET NEW.a = 100 * NEW.a'
+sql_modes=0
+definers='root@localhost'
+EOF
+--write_file $MYSQLTEST_VARDIR/a@b/tr2.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+ WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
+
+--echo mysqlcheck --fix-db-names --fix-table-names --all-databases
+--exec $MYSQL_CHECK --fix-db-names --fix-table-names --all-databases
+
+USE `a@b`;
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+ WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
+
+INSERT INTO `c@d` VALUES (2), (1);
+SELECT * FROM `c@d`;
+INSERT INTO t1 VALUES (3), (5);
+SELECT * FROM t1;
+
+DROP DATABASE `a@b`;
+
+USE test;
+
+
--echo End of 5.1 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 ffb0ad0970e..e17edf0a4e5 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -4,6 +4,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/partition_pruning.test b/mysql-test/t/partition_pruning.test
index 31008d2b011..ad102062ef8 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -8,6 +8,22 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
+#
+# Bug#40972: some sql execution lead the whole database crashing
+#
+# Setup so the start is at partition pX and end is at p1
+# Pruning does handle 'bad' dates differently.
+CREATE TABLE t1
+(a INT NOT NULL AUTO_INCREMENT,
+ b DATETIME,
+ PRIMARY KEY (a,b),
+ KEY (b))
+PARTITION BY RANGE (to_days(b))
+(PARTITION p0 VALUES LESS THAN (733681) COMMENT = 'LESS THAN 2008-10-01',
+ PARTITION p1 VALUES LESS THAN (733712) COMMENT = 'LESS THAN 2008-11-01',
+ PARTITION pX VALUES LESS THAN MAXVALUE);
+SELECT a,b FROM t1 WHERE b >= '2008-12-01' AND b < '2009-12-00';
+DROP TABLE t1;
# Check if we can infer from condition on partition fields that
# no records will match.
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 52e872c2b38..d4669abe0e4 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
@@ -1017,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;
@@ -1026,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
@@ -1047,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
@@ -1183,75 +1186,6 @@ 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
--echo #
@@ -1261,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
@@ -1279,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 f080a2b6814..f17cc1289b1 100644
--- a/mysql-test/t/rpl_init_slave_func.test
+++ b/mysql-test/t/rpl_init_slave_func.test
@@ -10,85 +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'
-connection slave;
-sleep 1;
-show variables like 'init_slave';
-show variables like 'max_connections';
-sync_with_master;
-reset master;
-
-#===============================================================
---echo 'check if value in slave opt file doesnt apply to master'
-#===============================================================
-
---echo 'connection master'
-connection master;
-show variables like 'init_slave';
-show variables like 'max_connections';
-save_master_pos;
---echo 'connection slave'
+--echo connection slave
connection slave;
-sync_with_master;
+#
+# save the current values
-#=======================================================
---echo 'try creating a temporary variable in init_slave'
-#=======================================================
+SET @start_max_connections= @@global.max_connections;
+SET @start_init_slave= @@global.init_slave;
-SET @@global.init_slave = "SET @a=5";
+# 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;
-source include/stop_slave.inc;
-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 1d1531f8076..f487f0695a3 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.
@@ -288,7 +290,6 @@ show procedure status where name ='proc37908' and 1 in (select f1 from db37908.t
show function status where name ='func37908' and 1 in (select func37908());
connection default;
-disconnect con1;
disconnect user1;
disconnect root;
drop database db37908;
@@ -296,6 +297,43 @@ drop procedure proc37908;
drop function func37908;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
DROP USER mysqltest_1@localhost;
+
+#
+# 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_query_log
+let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`;
+--enable_query_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/strict.test b/mysql-test/t/strict.test
index 486f7ce7897..f2ce045840c 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -1199,6 +1199,15 @@ show create table t1;
drop table t1;
#
+# Bug #39591: Crash if table comment is longer than 62 characters
+#
+
+#60 chars, 120 (+1) bytes (UTF-8 with 2-byte chars)
+CREATE TABLE t3 (f1 INT) COMMENT 'כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן';
+SHOW CREATE TABLE t3;
+DROP TABLE t3;
+
+#
# Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode
#
set sql_mode= 'traditional';
diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test
index 4ab8a982e63..2bfa4936c91 100644
--- a/mysql-test/t/temp_table.test
+++ b/mysql-test/t/temp_table.test
@@ -204,4 +204,35 @@ DELETE FROM t1;
SELECT * FROM t1;
DROP TABLE t1;
+#
+# Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites locking type of temp table
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+CREATE TEMPORARY TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+DELIMITER |;
+CREATE FUNCTION f1() RETURNS INT
+ BEGIN
+ return 1;
+ END|
+DELIMITER ;|
+
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+
+CREATE TABLE t3 SELECT * FROM t1;
+INSERT INTO t1 SELECT f1();
+
+UPDATE t1,t2 SET t1.a = t2.a;
+INSERT INTO t2 SELECT f1();
+
+DROP TABLE t1,t2,t3;
+DROP FUNCTION f1;
+
--echo End of 5.1 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_date.test b/mysql-test/t/type_date.test
index 9bc428c3715..aec60bc2dee 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -62,7 +62,7 @@ drop table t1;
# Test of date and not null
#
-create table t1 (date date);
+create table t1 (date date);
insert into t1 values ("2000-08-10"),("2000-08-11");
select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
drop table t1;
@@ -75,9 +75,12 @@ CREATE TABLE t1(AFIELD INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1, t2 GROUP BY t1.AFIELD;
INSERT INTO t1 VALUES(1);
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
+SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)),
+ DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
+FROM t1,t2 GROUP BY t1.AFIELD;
drop table t1,t2;
#
@@ -90,7 +93,7 @@ SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1;
DROP TABLE t1;
#
-# Bug 4937: different date -> string conversion when using SELECT ... UNION
+# Bug#4937: different date -> string conversion when using SELECT ... UNION
# and INSERT ... SELECT ... UNION
#
@@ -141,7 +144,7 @@ select * from t1;
drop table t1;
#
-# Bug #30942: select str_to_date from derived table returns varying results
+# Bug#30942: select str_to_date from derived table returns varying results
#
CREATE TABLE t1 (
a INT
@@ -155,10 +158,22 @@ DROP TABLE t1;
#
-# Bug #31221: Optimizer incorrectly identifies impossible WHERE clause
+# Bug#31221: Optimizer incorrectly identifies impossible WHERE clause
#
-CREATE TABLE t1 (a DATE, b int, PRIMARY KEY (a,b));
+CREATE TABLE t1 (a DATE, b INT, PRIMARY KEY (a,b));
+## The current sub test could fail (difference to expected result) if we
+## have just reached midnight.
+## (Bug#41776 type_date.test may fail if run around midnight)
+## Therefore we sleep a bit if we are too close to midnight.
+## The complete test itself needs in average less than 1 second.
+## Therefore a time_distance to midnight of 5 seconds should be sufficient.
+if (`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`)
+{
+ # We are here when CURTIME() is between '23:59:56' and '23:59:59'.
+ # So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'.
+ --real_sleep 5
+}
INSERT INTO t1 VALUES (DATE(NOW()), 1);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
@@ -174,7 +189,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
DROP TABLE t1;
#
-# Bug #28687: Search fails on '0000-00-00' date after sql_mode change
+# Bug#28687: Search fails on '0000-00-00' date after sql_mode change
#
CREATE TABLE t1 (a DATE);
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=
+'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title> Title - document with document declaration</title>
+ </head>
+ <body> Hi, Im a webpage with document a declaration </body>
+</html>';
+
+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('<xml "xxx" "yyy">CharData</xml>', '/xml');
+SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
+
+
--echo End of 5.1 tests
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 0f8055860d4..f97550d4429 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -976,24 +976,26 @@ static void init_one_value(const struct my_option *option, uchar* *variable,
*((my_bool*) variable)= (my_bool) value;
break;
case GET_INT:
- *((int*) variable)= (int) value;
+ *((int*) variable)= (int) getopt_ll_limit_value((int) value, option, NULL);
break;
- case GET_UINT:
case GET_ENUM:
*((uint*) variable)= (uint) value;
break;
+ case GET_UINT:
+ *((uint*) variable)= (uint) getopt_ull_limit_value((uint) value, option, NULL);
+ break;
case GET_LONG:
- *((long*) variable)= (long) value;
+ *((long*) variable)= (long) getopt_ll_limit_value((long) value, option, NULL);
break;
case GET_ULONG:
- *((ulong*) variable)= (ulong) value;
+ *((ulong*) variable)= (ulong) getopt_ull_limit_value((ulong) value, option, NULL);
break;
case GET_LL:
- *((longlong*) variable)= (longlong) value;
+ *((longlong*) variable)= (longlong) getopt_ll_limit_value((longlong) value, option, NULL);
break;
case GET_ULL:
case GET_SET:
- *((ulonglong*) variable)= (ulonglong) value;
+ *((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value((ulonglong) value, option, NULL);
break;
case GET_DOUBLE:
*((double*) variable)= (double) value;
diff --git a/mysys/my_init.c b/mysys/my_init.c
index d9f857da955..edc37a3c96f 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -77,8 +77,12 @@ my_bool my_init(void)
my_umask= 0660; /* Default umask for new files */
my_umask_dir= 0700; /* Default umask for new directories */
init_glob_errs();
-#if defined(THREAD) && defined(SAFE_MUTEX)
+#if defined(THREAD)
+ if (my_thread_global_init())
+ return 1;
+# if defined(SAFE_MUTEX)
safe_mutex_global_init(); /* Must be called early */
+# endif
#endif
#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
fastmutex_global_init(); /* Must be called early */
@@ -88,8 +92,6 @@ my_bool my_init(void)
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
- if (my_thread_global_init())
- return 1;
#if !defined( __WIN__) && !defined(__NETWARE__)
sigfillset(&my_signals); /* signals blocked by mf_brkhant */
#endif
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 5a2409eeb6f..20b7973cb4e 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -21,6 +21,7 @@
basedir=""
builddir=""
ldata="@localstatedir@"
+langdir=""
srcdir=""
args=""
@@ -106,7 +107,7 @@ parse_arguments()
# Note that the user will be passed to mysqld so that it runs
# as 'user' (crucial e.g. if log-bin=/some_other_path/
# where a chown of datadir won't help)
- user=`parse_arg "$arg"` ;;
+ user=`parse_arg "$arg"` ;;
--skip-name-resolve) ip_only=1 ;;
--verbose) verbose=1 ;; # Obsolete
--rpm) in_rpm=1 ;;
@@ -171,7 +172,20 @@ find_in_basedir()
cannot_find_file()
{
echo
- echo "FATAL ERROR: Could not find $*"
+ echo "FATAL ERROR: Could not find $1"
+
+ shift
+ if test $# -ne 0
+ then
+ echo
+ echo "The following directories were searched:"
+ echo
+ for dir in "$@"
+ do
+ echo " $dir"
+ done
+ fi
+
echo
echo "If you compiled from source, you need to run 'make install' to"
echo "copy the software into the correct location ready for operation."
@@ -210,6 +224,11 @@ then
elif test -n "$basedir"
then
print_defaults=`find_in_basedir my_print_defaults bin extra`
+ if test -z "$print_defaults"
+ then
+ cannot_find_file my_print_defaults $basedir/bin $basedir/extra
+ exit 1
+ fi
else
print_defaults="@bindir@/my_print_defaults"
fi
@@ -232,7 +251,7 @@ then
bindir="$basedir/client"
extra_bindir="$basedir/extra"
mysqld="$basedir/sql/mysqld"
- mysqld_opt="--language=$srcdir/sql/share/english"
+ langdir="$srcdir/sql/share/english"
pkgdatadir="$srcdir/scripts"
scriptdir="$srcdir/scripts"
elif test -n "$basedir"
@@ -240,7 +259,23 @@ then
bindir="$basedir/bin"
extra_bindir="$bindir"
mysqld=`find_in_basedir mysqld libexec sbin bin`
+ if test -z "$mysqld"
+ then
+ cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin
+ exit 1
+ fi
+ langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`
+ if test -z "$langdir"
+ then
+ cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english
+ exit 1
+ fi
pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
+ if test -z "$pkgdatadir"
+ then
+ cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql
+ exit 1
+ fi
scriptdir="$basedir/scripts"
else
basedir="@prefix@"
@@ -271,6 +306,16 @@ then
exit 1
fi
+if test -n "$langdir"
+then
+ if test ! -f "$langdir/errmsg.sys"
+ then
+ cannot_find_file "$langdir/errmsg.sys"
+ exit 1
+ fi
+ mysqld_opt="--language=$langdir"
+fi
+
# Try to determine the hostname
hostname=`@HOSTNAME@`
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 23532027883..155e0237e3c 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -762,19 +762,20 @@ long calc_daynr(uint year,uint month,uint day)
{
long delsum;
int temp;
+ int y= year; /* may be < 0 temporarily */
DBUG_ENTER("calc_daynr");
- if (year == 0 && month == 0 && day == 0)
+ if (y == 0 && month == 0 && day == 0)
DBUG_RETURN(0); /* Skip errors */
- delsum= (long) (365L * year+ 31*(month-1) +day);
+ delsum= (long) (365L * y+ 31*(month-1) +day);
if (month <= 2)
- year--;
+ y--;
else
delsum-= (long) (month*4+23)/10;
- temp=(int) ((year/100+1)*3)/4;
+ temp=(int) ((y/100+1)*3)/4;
DBUG_PRINT("exit",("year: %d month: %d day: %d -> daynr: %ld",
- year+(month <= 2),month,day,delsum+year/4-temp));
- DBUG_RETURN(delsum+(int) year/4-temp);
+ y+(month <= 2),month,day,delsum+y/4-temp));
+ DBUG_RETURN(delsum+(int) y/4-temp);
} /* calc_daynr */
diff --git a/sql/field.cc b/sql/field.cc
index b32cbe66d89..973170223e4 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 d24dd9355b0..5136f760fc1 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/filesort.cc b/sql/filesort.cc
index 2850ada1ffb..5d8b4e869c8 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -562,10 +562,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if (quick_select)
{
if ((error= select->quick->get_next()))
- {
- error= HA_ERR_END_OF_FILE;
break;
- }
file->position(sort_form->record[0]);
DBUG_EXECUTE_IF("debug_filesort", dbug_print_record(sort_form, TRUE););
}
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 8752cd9a34c..0e36a868b3e 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;
@@ -4785,7 +4815,7 @@ int ha_partition::info(uint flag)
/*
Calculates statistical variables
records: Estimate of number records in table
- We report sum (always at least 2)
+ We report sum (always at least 2 if not empty)
deleted: Estimate of number holes in the table due to
deletes
We report sum
@@ -4824,13 +4854,13 @@ int ha_partition::info(uint flag)
stats.check_time= file->stats.check_time;
}
} while (*(++file_array));
- if (stats.records < 2 &&
+ if (stats.records && stats.records < 2 &&
!(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
stats.records= 2;
if (stats.records > 0)
stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records);
else
- stats.mean_rec_length= 1; //? What should we set here
+ stats.mean_rec_length= 0;
}
if (flag & HA_STATUS_CONST)
{
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index b2adf35d623..8a81a759e2a 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
@@ -326,6 +326,10 @@ public:
*/
virtual void unlock_row();
/*
+ Check if semi consistent read
+ */
+ virtual bool was_semi_consistent_read();
+ /*
Call to hint about semi consistent read
*/
virtual void try_semi_consistent_read(bool);
diff --git a/sql/item.cc b/sql/item.cc
index 7999ce2ca46..d3f933dc13f 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..813e50e0693 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;
}
@@ -2719,6 +2713,16 @@ void Item_func_case::fix_length_and_dec()
nagg++;
if (!(found_types= collect_cmp_types(agg, nagg)))
return;
+ if (with_sum_func || current_thd->lex->current_select->group_list.elements)
+ {
+ /*
+ See TODO commentary in the setup_copy_fields function:
+ item in a group may be wrapped with an Item_copy_string item.
+ That item has a STRING_RESULT result type, so we need
+ to take this type into account.
+ */
+ found_types |= (1 << item_cmp_type(left_result_type, STRING_RESULT));
+ }
for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
{
diff --git a/sql/item_func.h b/sql/item_func.h
index 298f701f1ee..512da28589a 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..fc9375e68a5 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1782,6 +1782,12 @@ Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs)
Item_string *conv;
uint conv_errors;
String tmp, cstr, *ostr= val_str(&tmp);
+ if (null_value)
+ {
+ Item *null_item= new Item_null((char *) fully_qualified_func_name());
+ null_item->collation.set (tocs);
+ return null_item;
+ }
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors);
if (conv_errors ||
!(conv= new Item_static_string_func(fully_qualified_func_name(),
@@ -2033,10 +2039,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 37cbf50bfeb..74dc75702ae 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);
}
@@ -1464,6 +1465,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);
@@ -1476,60 +1478,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.
-
- Real transaction 'all' was true
-
- 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
- ============================= = = = = = = = = = = = = = = = =
+ We commit the transaction if:
+ - We are not in a transaction and committing a statement, or
- ============================= = = = = = = = = = = = = = = = =
- 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
*/
@@ -1542,18 +1495,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);
}
/**
@@ -1613,6 +1566,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);
}
@@ -2358,6 +2313,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 */
@@ -2952,6 +2908,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());
@@ -2959,36 +2916,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;
}
@@ -3016,7 +2957,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);
}
@@ -3067,7 +3043,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;
@@ -3076,8 +3051,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
@@ -3088,6 +3091,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)))
{
@@ -3188,23 +3246,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);
@@ -3215,7 +3260,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,
@@ -3232,6 +3277,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;
@@ -3239,12 +3285,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;
@@ -3294,55 +3336,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 fe66dd1a1e9..d54df8add3b 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 54fbbc78cfb..e4835ee462d 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2679,7 +2679,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);
@@ -3424,7 +3424,8 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
number_of_event_types= LOG_EVENT_TYPES;
/* we'll catch my_malloc() error in is_valid() */
post_header_len=(uint8*) my_malloc(number_of_event_types*sizeof(uint8),
- MYF(MY_ZEROFILL));
+ MYF(0));
+
/*
This long list of assignments is not beautiful, but I see no way to
make it nicer, as the right members are #defines, not array members, so
@@ -3432,16 +3433,40 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
*/
if (post_header_len)
{
+ // Allows us to sanity-check that all events initialized their
+ // events (see the end of this 'if' block).
+ IF_DBUG(memset(post_header_len, 255,
+ number_of_event_types*sizeof(uint8)););
+
+ /* Note: all event types must explicitly fill in their lengths here. */
post_header_len[START_EVENT_V3-1]= START_V3_HEADER_LEN;
post_header_len[QUERY_EVENT-1]= QUERY_HEADER_LEN;
+ post_header_len[STOP_EVENT-1]= STOP_HEADER_LEN;
post_header_len[ROTATE_EVENT-1]= ROTATE_HEADER_LEN;
+ post_header_len[INTVAR_EVENT-1]= INTVAR_HEADER_LEN;
post_header_len[LOAD_EVENT-1]= LOAD_HEADER_LEN;
+ post_header_len[SLAVE_EVENT-1]= SLAVE_HEADER_LEN;
post_header_len[CREATE_FILE_EVENT-1]= CREATE_FILE_HEADER_LEN;
post_header_len[APPEND_BLOCK_EVENT-1]= APPEND_BLOCK_HEADER_LEN;
post_header_len[EXEC_LOAD_EVENT-1]= EXEC_LOAD_HEADER_LEN;
post_header_len[DELETE_FILE_EVENT-1]= DELETE_FILE_HEADER_LEN;
- post_header_len[NEW_LOAD_EVENT-1]= post_header_len[LOAD_EVENT-1];
+ post_header_len[NEW_LOAD_EVENT-1]= NEW_LOAD_HEADER_LEN;
+ post_header_len[RAND_EVENT-1]= RAND_HEADER_LEN;
+ post_header_len[USER_VAR_EVENT-1]= USER_VAR_HEADER_LEN;
post_header_len[FORMAT_DESCRIPTION_EVENT-1]= FORMAT_DESCRIPTION_HEADER_LEN;
+ post_header_len[XID_EVENT-1]= XID_HEADER_LEN;
+ post_header_len[BEGIN_LOAD_QUERY_EVENT-1]= BEGIN_LOAD_QUERY_HEADER_LEN;
+ post_header_len[EXECUTE_LOAD_QUERY_EVENT-1]= EXECUTE_LOAD_QUERY_HEADER_LEN;
+ /*
+ The PRE_GA events are never be written to any binlog, but
+ their lengths are included in Format_description_log_event.
+ Hence, we need to be assign some value here, to avoid reading
+ uninitialized memory when the array is written to disk.
+ */
+ post_header_len[PRE_GA_WRITE_ROWS_EVENT-1] = 0;
+ post_header_len[PRE_GA_UPDATE_ROWS_EVENT-1] = 0;
+ post_header_len[PRE_GA_DELETE_ROWS_EVENT-1] = 0;
+
post_header_len[TABLE_MAP_EVENT-1]= TABLE_MAP_HEADER_LEN;
post_header_len[WRITE_ROWS_EVENT-1]= ROWS_HEADER_LEN;
post_header_len[UPDATE_ROWS_EVENT-1]= ROWS_HEADER_LEN;
@@ -3461,9 +3486,14 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
post_header_len[WRITE_ROWS_EVENT-1]=
post_header_len[UPDATE_ROWS_EVENT-1]=
post_header_len[DELETE_ROWS_EVENT-1]= 6;);
- post_header_len[BEGIN_LOAD_QUERY_EVENT-1]= post_header_len[APPEND_BLOCK_EVENT-1];
- post_header_len[EXECUTE_LOAD_QUERY_EVENT-1]= EXECUTE_LOAD_QUERY_HEADER_LEN;
post_header_len[INCIDENT_EVENT-1]= INCIDENT_HEADER_LEN;
+
+ // Sanity-check that all post header lengths are initialized.
+ IF_DBUG({
+ int i;
+ for (i=0; i<number_of_event_types; i++)
+ assert(post_header_len[i] != 255);
+ });
}
break;
@@ -4813,7 +4843,9 @@ Intvar_log_event::Intvar_log_event(const char* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Varible Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[INTVAR_EVENT-1];
type= buf[I_TYPE_OFFSET];
val= uint8korr(buf+I_VAL_OFFSET);
}
@@ -4957,7 +4989,9 @@ Rand_log_event::Rand_log_event(const char* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Variable Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[RAND_EVENT-1];
seed1= uint8korr(buf+RAND_SEED1_OFFSET);
seed2= uint8korr(buf+RAND_SEED2_OFFSET);
}
@@ -5061,7 +5095,9 @@ Xid_log_event(const char* buf,
const Format_description_log_event *description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Variable Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[XID_EVENT-1];
memcpy((char*) &xid, buf, sizeof(xid));
}
@@ -5207,7 +5243,9 @@ User_var_log_event(const char* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
- buf+= description_event->common_header_len;
+ /* The Post-Header is empty. The Variable Data part begins immediately. */
+ buf+= description_event->common_header_len +
+ description_event->post_header_len[USER_VAR_EVENT-1];
name_len= uint4korr(buf);
name= (char *) buf + UV_NAME_LEN_SIZE;
buf+= UV_NAME_LEN_SIZE + name_len;
@@ -8091,6 +8129,9 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability
analyze if explicit data is provided for slave's TIMESTAMP columns).
*/
m_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+
+ /* Honor next number column if present */
+ m_table->next_number_field= m_table->found_next_number_field;
return error;
}
@@ -8099,6 +8140,7 @@ Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability *
int error)
{
int local_error= 0;
+ m_table->next_number_field=0;
if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 ||
m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER)
{
@@ -9057,7 +9099,17 @@ Incident_log_event::Incident_log_event(const char *buf, uint event_len,
DBUG_PRINT("info",("event_len: %u; common_header_len: %d; post_header_len: %d",
event_len, common_header_len, post_header_len));
- m_incident= static_cast<Incident>(uint2korr(buf + common_header_len));
+ int incident_number= uint2korr(buf + common_header_len);
+ if (incident_number >= INCIDENT_COUNT ||
+ incident_number <= INCIDENT_NONE)
+ {
+ // If the incident is not recognized, this binlog event is
+ // invalid. If we set incident_number to INCIDENT_NONE, the
+ // invalidity will be detected by is_valid().
+ incident_number= INCIDENT_NONE;
+ DBUG_VOID_RETURN;
+ }
+ m_incident= static_cast<Incident>(incident_number);
char const *ptr= buf + common_header_len + post_header_len;
char const *const str_end= buf + event_len;
uint8 len= 0; // Assignment to keep compiler happy
@@ -9085,9 +9137,6 @@ Incident_log_event::description() const
DBUG_PRINT("info", ("m_incident: %d", m_incident));
- DBUG_ASSERT(0 <= m_incident);
- DBUG_ASSERT((size_t) m_incident <= sizeof(description)/sizeof(*description));
-
return description[m_incident];
}
diff --git a/sql/log_event.h b/sql/log_event.h
index f131aba515a..1d11d7e2d5f 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -227,14 +227,22 @@ struct sql_ex_info
#define QUERY_HEADER_MINIMAL_LEN (4 + 4 + 1 + 2)
// where 5.0 differs: 2 for len of N-bytes vars.
#define QUERY_HEADER_LEN (QUERY_HEADER_MINIMAL_LEN + 2)
+#define STOP_HEADER_LEN 0
#define LOAD_HEADER_LEN (4 + 4 + 4 + 1 +1 + 4)
+#define SLAVE_HEADER_LEN 0
#define START_V3_HEADER_LEN (2 + ST_SERVER_VER_LEN + 4)
#define ROTATE_HEADER_LEN 8 // this is FROZEN (the Rotate post-header is frozen)
+#define INTVAR_HEADER_LEN 0
#define CREATE_FILE_HEADER_LEN 4
#define APPEND_BLOCK_HEADER_LEN 4
#define EXEC_LOAD_HEADER_LEN 4
#define DELETE_FILE_HEADER_LEN 4
+#define NEW_LOAD_HEADER_LEN LOAD_HEADER_LEN
+#define RAND_HEADER_LEN 0
+#define USER_VAR_HEADER_LEN 0
#define FORMAT_DESCRIPTION_HEADER_LEN (START_V3_HEADER_LEN+1+LOG_EVENT_TYPES)
+#define XID_HEADER_LEN 0
+#define BEGIN_LOAD_QUERY_HEADER_LEN APPEND_BLOCK_HEADER_LEN
#define ROWS_HEADER_LEN 8
#define TABLE_MAP_HEADER_LEN 8
#define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1)
@@ -319,18 +327,16 @@ struct sql_ex_info
#define Q_CHARSET_DATABASE_CODE 8
#define Q_TABLE_MAP_FOR_UPDATE_CODE 9
-/* Intvar event post-header */
+/* Intvar event data */
#define I_TYPE_OFFSET 0
#define I_VAL_OFFSET 1
-/* Rand event post-header */
-
+/* Rand event data */
#define RAND_SEED1_OFFSET 0
#define RAND_SEED2_OFFSET 8
-/* User_var event post-header */
-
+/* User_var event data */
#define UV_VAL_LEN_SIZE 4
#define UV_VAL_IS_NULL 1
#define UV_VAL_TYPE_SIZE 1
@@ -338,7 +344,6 @@ struct sql_ex_info
#define UV_CHARSET_NUMBER_SIZE 4
/* Load event post-header */
-
#define L_THREAD_ID_OFFSET 0
#define L_EXEC_TIME_OFFSET 4
#define L_SKIP_LINES_OFFSET 8
@@ -349,7 +354,6 @@ struct sql_ex_info
#define L_DATA_OFFSET LOAD_HEADER_LEN
/* Rotate event post-header */
-
#define R_POS_OFFSET 0
#define R_IDENT_OFFSET 8
@@ -2221,10 +2225,11 @@ protected:
@section Intvar_log_event_binary_format Binary Format
- The Post-Header has two components:
+ The Post-Header for this event type is empty. The Body has two
+ components:
<table>
- <caption>Post-Header for Intvar_log_event</caption>
+ <caption>Body for Intvar_log_event</caption>
<tr>
<th>Name</th>
@@ -2298,11 +2303,12 @@ private:
which are stored internally as two 64-bit numbers.
@section Rand_log_event_binary_format Binary Format
- This event type has no Post-Header. The Body of this event type has
- two components:
+
+ The Post-Header for this event type is empty. The Body has two
+ components:
<table>
- <caption>Post-Header for Intvar_log_event</caption>
+ <caption>Body for Rand_log_event</caption>
<tr>
<th>Name</th>
@@ -3886,7 +3892,10 @@ public:
virtual Log_event_type get_type_code() { return INCIDENT_EVENT; }
- virtual bool is_valid() const { return 1; }
+ virtual bool is_valid() const
+ {
+ return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
+ }
virtual int get_data_size() {
return INCIDENT_HEADER_LEN + 1 + m_message.length;
}
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 6703a9de1e1..c32ebc6d39d 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;
@@ -2225,6 +2230,7 @@ uint strconvert(CHARSET_INFO *from_cs, const char *from,
CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
uint filename_to_tablename(const char *from, char *to, uint to_length);
uint tablename_to_filename(const char *from, char *to, uint to_length);
+uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length);
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
uint build_table_filename(char *buff, size_t bufflen, const char *db,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e995cc7e6ce..a2ccbc42e77 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_POOL 0
+#endif
+
/* Constants */
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
@@ -3398,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;
@@ -4118,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
@@ -4218,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
*/
@@ -6297,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,
@@ -6553,7 +6611,7 @@ The minimum value for this variable is 4096.",
{"max_user_connections", OPT_MAX_USER_CONNECTIONS,
"The maximum number of active connections for a single user (0 = no limit).",
(uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT,
- REQUIRED_ARG, 0, 1, UINT_MAX, 0, 1, 0},
+ REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0},
{"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
"After this many write locks, allow some read locks to run in between.",
(uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
@@ -6851,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;
@@ -7273,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 ae481c3e3db..9f8f17eb4ba 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/repl_failsafe.cc b/sql/repl_failsafe.cc
index d7e783f534f..582348608de 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -644,6 +644,16 @@ err:
}
#endif
+
+/**
+ Execute a SHOW SLAVE HOSTS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool show_slave_hosts(THD* thd)
{
List<Item> field_list;
diff --git a/sql/rpl_constants.h b/sql/rpl_constants.h
index 426e80a328d..32fb4b8a7f2 100644
--- a/sql/rpl_constants.h
+++ b/sql/rpl_constants.h
@@ -6,10 +6,10 @@
*/
enum Incident {
/** No incident */
- INCIDENT_NONE,
+ INCIDENT_NONE = 0,
/** There are possibly lost events in the replication stream */
- INCIDENT_LOST_EVENTS,
+ INCIDENT_LOST_EVENTS = 1,
/** Shall be last event of the enumeration */
INCIDENT_COUNT
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 46ccb2fab48..07e1528d483 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1527,14 +1527,14 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
ulonglong tmp= var->save_result.ulonglong_value;
/* Don't use bigger value than given with --maximum-variable-name=.. */
- if ((ulong) tmp > max_system_variables.*offset)
+ if (tmp > max_system_variables.*offset)
{
throw_bounds_warning(thd, TRUE, TRUE, name, (longlong) tmp);
tmp= max_system_variables.*offset;
}
if (option_limits)
- tmp= (ulong) fix_unsigned(thd, tmp, option_limits);
+ tmp= fix_unsigned(thd, tmp, option_limits);
#if SIZEOF_LONG < SIZEOF_LONG_LONG
else if (tmp > ULONG_MAX)
{
@@ -1543,6 +1543,7 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
}
#endif
+ DBUG_ASSERT(tmp <= ULONG_MAX);
if (var->type == OPT_GLOBAL)
global_system_variables.*offset= (ulong) tmp;
else
@@ -3548,6 +3549,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 +3561,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/slave.cc b/sql/slave.cc
index 43b70f29a68..22c61b3ec6c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1357,6 +1357,17 @@ int register_slave_on_master(MYSQL* mysql, Master_info *mi,
}
+/**
+ Execute a SHOW SLAVE STATUS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object for the IO thread.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool show_master_info(THD* thd, Master_info* mi)
{
// TODO: fix this for multi-master
@@ -2062,7 +2073,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli,
fewer times, 0 is returned.
- init_master_info or init_relay_log_pos failed. (These are called
- if a failure occurs when applying the event.)</li>
+ if a failure occurs when applying the event.)
- An error occurred when updating the binlog position.
@@ -2307,8 +2318,14 @@ static int try_to_reconnect(THD *thd, MYSQL *mysql, Master_info *mi,
}
-/* Slave I/O Thread entry point */
+/**
+ Slave IO thread entry point.
+
+ @param arg Pointer to Master_info struct that holds information for
+ the IO thread.
+ @return Always 0.
+*/
pthread_handler_t handle_slave_io(void *arg)
{
THD *thd; // needs to be first for thread_stack
@@ -2616,8 +2633,14 @@ err:
}
-/* Slave SQL Thread entry point */
+/**
+ Slave SQL thread entry point.
+
+ @param arg Pointer to Relay_log_info object that holds information
+ for the SQL thread.
+ @return Always 0.
+*/
pthread_handler_t handle_slave_sql(void *arg)
{
THD *thd; /* needs to be first for thread_stack */
@@ -3710,6 +3733,16 @@ static IO_CACHE *reopen_relay_log(Relay_log_info *rli, const char **errmsg)
}
+/**
+ Reads next event from the relay log. Should be called from the
+ slave IO thread.
+
+ @param rli Relay_log_info structure for the slave IO thread.
+
+ @return The event read, or NULL on error. If an error occurs, the
+ error is reported through the sql_print_information() or
+ sql_print_error() functions.
+*/
static Log_event* next_event(Relay_log_info* rli)
{
Log_event* ev;
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_base.cc b/sql/sql_base.cc
index ea664cd5091..6db9f1df0f2 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1111,6 +1111,27 @@ static void mark_temp_tables_as_free_for_reuse(THD *thd)
*/
if (table->child_l || table->parent)
detach_merge_children(table, TRUE);
+ /*
+ Reset temporary table lock type to it's default value (TL_WRITE).
+
+ Statements such as INSERT INTO .. SELECT FROM tmp, CREATE TABLE
+ .. SELECT FROM tmp and UPDATE may under some circumstances modify
+ the lock type of the tables participating in the statement. This
+ isn't a problem for non-temporary tables since their lock type is
+ reset at every open, but the same does not occur for temporary
+ tables for historical reasons.
+
+ Furthermore, the lock type of temporary tables is not really that
+ important because they can only be used by one query at a time and
+ not even twice in a query -- a temporary table is represented by
+ only one TABLE object. Nonetheless, it's safer from a maintenance
+ point of view to reset the lock type of this singleton TABLE object
+ as to not cause problems when the table is reused.
+
+ Even under LOCK TABLES mode its okay to reset the lock type as
+ LOCK TABLES is allowed (but ignored) for a temporary table.
+ */
+ table->reginfo.lock_type= TL_WRITE;
}
}
}
@@ -4681,7 +4702,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
else if (tables->lock_type == TL_READ_DEFAULT)
tables->table->reginfo.lock_type=
read_lock_type_for_table(thd, tables->table);
- else if (tables->table->s->tmp_table == NO_TMP_TABLE)
+ else
tables->table->reginfo.lock_type= tables->lock_type;
}
tables->table->grant= tables->grant;
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 7ca7bef3a56..96e99b57e3c 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -18,7 +18,7 @@
#include "base64.h"
/**
- Execute a BINLOG statement
+ Execute a BINLOG statement.
To execute the BINLOG command properly the server needs to know
which format the BINLOG command's event is in. Therefore, the first
@@ -26,6 +26,9 @@
Format_description_log_event, as outputted by mysqlbinlog. This
Format_description_log_event is cached in
rli->description_event_for_exec.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
*/
void mysql_client_binlog_statement(THD* thd)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 78b06936e56..3439e5b4f74 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> 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_delete.cc b/sql/sql_delete.cc
index f7c44152571..b56e042e3d5 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -951,6 +951,26 @@ bool multi_delete::send_eof()
****************************************************************************/
/*
+ Row-by-row truncation if the engine does not support table recreation.
+ Probably a InnoDB table.
+*/
+
+static bool mysql_truncate_by_delete(THD *thd, TABLE_LIST *table_list)
+{
+ bool error, save_binlog_row_based= thd->current_stmt_binlog_row_based;
+ DBUG_ENTER("mysql_truncate_by_delete");
+ table_list->lock_type= TL_WRITE;
+ mysql_init_select(thd->lex);
+ thd->clear_current_stmt_binlog_row_based();
+ error= mysql_delete(thd, table_list, NULL, NULL, HA_POS_ERROR, LL(0), TRUE);
+ ha_autocommit_or_rollback(thd, error);
+ end_trans(thd, error ? ROLLBACK : COMMIT);
+ thd->current_stmt_binlog_row_based= save_binlog_row_based;
+ DBUG_RETURN(error);
+}
+
+
+/*
Optimize delete of all rows by doing a full generate of the table
This will work even if the .ISM and .ISD tables are destroyed
@@ -1055,24 +1075,6 @@ end:
DBUG_RETURN(error);
trunc_by_del:
- /* Probably InnoDB table */
- ulonglong save_options= thd->options;
- table_list->lock_type= TL_WRITE;
- thd->options&= ~(OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT);
- ha_enable_transaction(thd, FALSE);
- mysql_init_select(thd->lex);
- bool save_binlog_row_based= thd->current_stmt_binlog_row_based;
- thd->clear_current_stmt_binlog_row_based();
- error= mysql_delete(thd, table_list, (COND*) 0, (SQL_LIST*) 0,
- HA_POS_ERROR, LL(0), TRUE);
- ha_enable_transaction(thd, TRUE);
- /*
- Safety, in case the engine ignored ha_enable_transaction(FALSE)
- above. Also clears thd->transaction.*.
- */
- error= ha_autocommit_or_rollback(thd, error);
- ha_commit(thd);
- thd->options= save_options;
- thd->current_stmt_binlog_row_based= save_binlog_row_based;
+ error= mysql_truncate_by_delete(thd, table_list);
DBUG_RETURN(error);
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index c99af17f0fc..9619d26893c 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_lex.h b/sql/sql_lex.h
index 26bd8d18750..ed6b9e7d8df 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -190,6 +190,15 @@ typedef struct st_lex_server_options
char *server_name, *host, *db, *username, *password, *scheme, *socket, *owner;
} LEX_SERVER_OPTIONS;
+
+/**
+ Structure to hold parameters for CHANGE MASTER or START/STOP SLAVE
+ or SHOW NEW MASTER.
+
+ Remark: this should not be confused with Master_info (and perhaps
+ would better be renamed to st_lex_replication_info). Some fields,
+ e.g., delay, are saved in Relay_log_info, not in Master_info.
+*/
typedef struct st_lex_master_info
{
char *host, *user, *password, *log_file_name;
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_parse.cc b/sql/sql_parse.cc
index 846f0b50046..99b131c3aef 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 cddb2808839..ae55c194c3c 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<partition_element> 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");
@@ -6679,6 +6678,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
uint32 max_endpoint_val;
get_endpoint_func get_endpoint;
uint field_len= field->pack_length_in_rec();
+ part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
if (part_info->part_type == RANGE_PARTITION)
{
@@ -6699,7 +6699,6 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
max_endpoint_val= part_info->no_list_values;
part_iter->get_next= get_next_partition_id_list;
part_iter->part_info= part_info;
- part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
if (max_endpoint_val == 0)
{
/*
@@ -6761,7 +6760,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
store_key_image_to_rec(field, max_value, field_len);
bool include_endp= !test(flags & NEAR_MAX);
part_iter->part_nums.end= get_endpoint(part_info, 0, include_endp);
- if (part_iter->part_nums.start == part_iter->part_nums.end &&
+ if (part_iter->part_nums.start >= part_iter->part_nums.end &&
!part_iter->ret_null_part)
return 0; /* No partitions */
}
@@ -6939,7 +6938,7 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter)
{
- if (part_iter->part_nums.cur == part_iter->part_nums.end)
+ if (part_iter->part_nums.cur >= part_iter->part_nums.end)
{
part_iter->part_nums.cur= part_iter->part_nums.start;
return NOT_A_PARTITION_ID;
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_profile.cc b/sql/sql_profile.cc
index c62cf6401ba..cb5b3722559 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -552,8 +552,8 @@ int PROFILING::fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond)
The order of these fields is set by the query_profile_statistics_info
array.
*/
- table->field[0]->store((ulonglong) query->profiling_query_id);
- table->field[1]->store((ulonglong) seq); /* the step in the sequence */
+ table->field[0]->store((ulonglong) query->profiling_query_id, TRUE);
+ table->field[1]->store((ulonglong) seq, TRUE); /* the step in the sequence */
/*
This entry, n, has a point in time, T(n), and a status phrase, S(n).
The status phrase S(n) describes the period of time that begins at
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 3ab211f5db6..81db5469891 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -257,6 +257,17 @@ bool purge_error_message(THD* thd, int res)
}
+/**
+ Execute a PURGE BINARY LOGS TO <log> command.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param to_log Name of the last log to purge.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool purge_master_logs(THD* thd, const char* to_log)
{
char search_file_name[FN_REFLEN];
@@ -273,6 +284,17 @@ bool purge_master_logs(THD* thd, const char* to_log)
}
+/**
+ Execute a PURGE BINARY LOGS BEFORE <date> command.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param purge_time Date before which logs should be purged.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool purge_master_logs_before_date(THD* thd, time_t purge_time)
{
if (!mysql_bin_log.is_open())
@@ -765,6 +787,20 @@ err:
DBUG_VOID_RETURN;
}
+
+/**
+ Execute a START SLAVE statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object for the slave's IO thread.
+
+ @param net_report If true, saves the exit status into thd->main_da.
+
+ @retval 0 success
+ @retval 1 error
+*/
int start_slave(THD* thd , Master_info* mi, bool net_report)
{
int slave_errno= 0;
@@ -890,6 +926,19 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
}
+/**
+ Execute a STOP SLAVE statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object for the slave's IO thread.
+
+ @param net_report If true, saves the exit status into thd->main_da.
+
+ @retval 0 success
+ @retval 1 error
+*/
int stop_slave(THD* thd, Master_info* mi, bool net_report )
{
DBUG_ENTER("stop_slave");
@@ -942,20 +991,17 @@ int stop_slave(THD* thd, Master_info* mi, bool net_report )
}
-/*
- Remove all relay logs and start replication from the start
-
- SYNOPSIS
- reset_slave()
- thd Thread handler
- mi Master info for the slave
+/**
+ Execute a RESET SLAVE statement.
- RETURN
- 0 ok
- 1 error
-*/
+ @param thd Pointer to THD object of the client thread executing the
+ statement.
+ @param mi Pointer to Master_info object for the slave.
+ @retval 0 success
+ @retval 1 error
+*/
int reset_slave(THD *thd, Master_info* mi)
{
MY_STAT stat_area;
@@ -1070,6 +1116,18 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
}
+/**
+ Execute a CHANGE MASTER statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @param mi Pointer to Master_info object belonging to the slave's IO
+ thread.
+
+ @retval FALSE success
+ @retval TRUE error
+*/
bool change_master(THD* thd, Master_info* mi)
{
int thread_mask;
@@ -1283,6 +1341,16 @@ bool change_master(THD* thd, Master_info* mi)
DBUG_RETURN(FALSE);
}
+
+/**
+ Execute a RESET MASTER statement.
+
+ @param thd Pointer to THD object of the client thread executing the
+ statement.
+
+ @retval 0 success
+ @retval 1 error
+*/
int reset_master(THD* thd)
{
if (!mysql_bin_log.is_open())
@@ -1312,6 +1380,15 @@ int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
}
+/**
+ Execute a SHOW BINLOG EVENTS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool mysql_show_binlog_events(THD* thd)
{
Protocol *protocol= thd->protocol;
@@ -1462,6 +1539,15 @@ err:
}
+/**
+ Execute a SHOW MASTER STATUS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
bool show_binlog_info(THD* thd)
{
Protocol *protocol= thd->protocol;
@@ -1495,18 +1581,15 @@ bool show_binlog_info(THD* thd)
}
-/*
- Send a list of all binary logs to client
+/**
+ Execute a SHOW BINARY LOGS statement.
- SYNOPSIS
- show_binlogs()
- thd Thread specific variable
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
- RETURN VALUES
- FALSE OK
- TRUE error
+ @retval FALSE success
+ @retval TRUE failure
*/
-
bool show_binlogs(THD* thd)
{
IO_CACHE *index_file;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 261a5c40c3b..49c0958055e 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 aa62b98bd13..3c4dc103ddd 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);
}
@@ -471,6 +474,7 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
if (wild && !wild[0])
wild=0;
+
bzero((char*) &table_list,sizeof(table_list));
if (!(dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0))))
@@ -993,7 +997,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 +1005,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 +1020,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 +3593,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 +3934,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 +3973,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 +3990,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 +6192,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 3b2142060a3..3ec03be72a5 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -114,6 +114,30 @@ uint filename_to_tablename(const char *from, char *to, uint to_length)
}
+/**
+ Check if given string begins with "#mysql50#" prefix, cut it if so.
+
+ @param from string to check and cut
+ @param to[out] buffer for result string
+ @param to_length its size
+
+ @retval
+ 0 no prefix found
+ @retval
+ non-0 result string length
+*/
+
+uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length)
+{
+ if (from[0] == '#' &&
+ !strncmp(from, MYSQL50_TABLE_NAME_PREFIX,
+ MYSQL50_TABLE_NAME_PREFIX_LENGTH))
+ return (uint) (strmake(to, from + MYSQL50_TABLE_NAME_PREFIX_LENGTH,
+ to_length - 1) - to);
+ return 0;
+}
+
+
/*
Translate a table name to a file name (WL #1324).
@@ -133,11 +157,8 @@ uint tablename_to_filename(const char *from, char *to, uint to_length)
DBUG_ENTER("tablename_to_filename");
DBUG_PRINT("enter", ("from '%s'", from));
- if (from[0] == '#' && !strncmp(from, MYSQL50_TABLE_NAME_PREFIX,
- MYSQL50_TABLE_NAME_PREFIX_LENGTH))
- DBUG_RETURN((uint) (strmake(to, from+MYSQL50_TABLE_NAME_PREFIX_LENGTH,
- to_length-1) -
- (from + MYSQL50_TABLE_NAME_PREFIX_LENGTH)));
+ if ((length= check_n_cut_mysql50_prefix(from, to, to_length)))
+ DBUG_RETURN(length);
length= strconvert(system_charset_info, from,
&my_charset_filename, to, to_length, &errors);
if (check_if_legal_tablename(to) &&
@@ -3111,10 +3132,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 +3448,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 +4334,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 +5883,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/sql_trigger.cc b/sql/sql_trigger.cc
index 5c8b1d96646..108d5095691 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1368,15 +1368,27 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
if (triggers->on_table_names_list.push_back(on_table_name, &table->mem_root))
goto err_with_lex_cleanup;
-
+#ifndef DBUG_OFF
/*
Let us check that we correctly update trigger definitions when we
rename tables with triggers.
+
+ In special cases like "RENAME TABLE `#mysql50#somename` TO `somename`"
+ or "ALTER DATABASE `#mysql50#somename` UPGRADE DATA DIRECTORY NAME"
+ we might be given table or database name with "#mysql50#" prefix (and
+ trigger's definiton contains un-prefixed version of the same name).
+ To remove this prefix we use check_n_cut_mysql50_prefix().
*/
- DBUG_ASSERT(!my_strcasecmp(table_alias_charset, lex.query_tables->db, db) &&
- !my_strcasecmp(table_alias_charset, lex.query_tables->table_name,
- table_name));
+ char fname[NAME_LEN + 1];
+ DBUG_ASSERT((!my_strcasecmp(table_alias_charset, lex.query_tables->db, db) ||
+ (check_n_cut_mysql50_prefix(db, fname, sizeof(fname)) &&
+ !my_strcasecmp(table_alias_charset, lex.query_tables->db, fname))) &&
+ (!my_strcasecmp(table_alias_charset, lex.query_tables->table_name,
+ table_name) ||
+ (check_n_cut_mysql50_prefix(table_name, fname, sizeof(fname)) &&
+ !my_strcasecmp(table_alias_charset, lex.query_tables->table_name, fname))));
+#endif
if (names_only)
{
lex_end(&lex);
@@ -1692,7 +1704,8 @@ end:
(change name of table in triggers' definitions).
@param thd Thread context
- @param db_name Database of subject table
+ @param old_db_name Old database of subject table
+ @param new_db_name New database of subject table
@param old_table_name Old subject table's name
@param new_table_name New subject table's name
@@ -1704,7 +1717,8 @@ end:
bool
Table_triggers_list::change_table_name_in_triggers(THD *thd,
- const char *db_name,
+ const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *old_table_name,
LEX_STRING *new_table_name)
{
@@ -1757,11 +1771,11 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
if (thd->is_fatal_error)
return TRUE; /* OOM */
- if (save_trigger_file(this, db_name, new_table_name->str))
+ if (save_trigger_file(this, new_db_name, new_table_name->str))
return TRUE;
- if (rm_trigger_file(path_buff, db_name, old_table_name->str))
+ if (rm_trigger_file(path_buff, old_db_name, old_table_name->str))
{
- (void) rm_trigger_file(path_buff, db_name, new_table_name->str);
+ (void) rm_trigger_file(path_buff, new_db_name, new_table_name->str);
return TRUE;
}
return FALSE;
@@ -1772,7 +1786,8 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
Iterate though Table_triggers_list::names_list list and update
.TRN files after renaming triggers' subject table.
- @param db_name Database of subject table
+ @param old_db_name Old database of subject table
+ @param new_db_name New database of subject table
@param new_table_name New subject table's name
@param stopper Pointer to Table_triggers_list::names_list at
which we should stop updating.
@@ -1785,7 +1800,8 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
*/
LEX_STRING*
-Table_triggers_list::change_table_name_in_trignames(const char *db_name,
+Table_triggers_list::change_table_name_in_trignames(const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *new_table_name,
LEX_STRING *stopper)
{
@@ -1798,7 +1814,7 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
while ((trigger= it_name++) != stopper)
{
trigname_file.length= build_table_filename(trigname_buff, FN_REFLEN-1,
- db_name, trigger->str,
+ new_db_name, trigger->str,
TRN_EXT, 0);
trigname_file.str= trigname_buff;
@@ -1807,6 +1823,16 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
if (sql_create_definition_file(NULL, &trigname_file, &trigname_file_type,
(uchar*)&trigname, trigname_file_parameters))
return trigger;
+
+ /* Remove stale .TRN file in case of database upgrade */
+ if (old_db_name)
+ {
+ if (rm_trigname_file(trigname_buff, old_db_name, trigger->str))
+ {
+ (void) rm_trigname_file(trigname_buff, new_db_name, trigger->str);
+ return trigger;
+ }
+ }
}
return 0;
@@ -1840,6 +1866,7 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
{
TABLE table;
bool result= 0;
+ bool upgrading50to51= FALSE;
LEX_STRING *err_trigname;
DBUG_ENTER("change_table_name");
@@ -1877,14 +1904,27 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
moving table with them between two schemas raises too many questions.
(E.g. what should happen if in new schema we already have trigger
with same name ?).
+
+ In case of "ALTER DATABASE `#mysql50#db1` UPGRADE DATA DIRECTORY NAME"
+ we will be given table name with "#mysql50#" prefix
+ To remove this prefix we use check_n_cut_mysql50_prefix().
*/
if (my_strcasecmp(table_alias_charset, db, new_db))
{
- my_error(ER_TRG_IN_WRONG_SCHEMA, MYF(0));
- result= 1;
- goto end;
+ char dbname[NAME_LEN + 1];
+ if (check_n_cut_mysql50_prefix(db, dbname, sizeof(dbname)) &&
+ !my_strcasecmp(table_alias_charset, dbname, new_db))
+ {
+ upgrading50to51= TRUE;
+ }
+ else
+ {
+ my_error(ER_TRG_IN_WRONG_SCHEMA, MYF(0));
+ result= 1;
+ goto end;
+ }
}
- if (table.triggers->change_table_name_in_triggers(thd, db,
+ if (table.triggers->change_table_name_in_triggers(thd, db, new_db,
&old_table_name,
&new_table_name))
{
@@ -1892,7 +1932,8 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
goto end;
}
if ((err_trigname= table.triggers->change_table_name_in_trignames(
- db, &new_table_name, 0)))
+ upgrading50to51 ? db : NULL,
+ new_db, &new_table_name, 0)))
{
/*
If we were unable to update one of .TRN files properly we will
@@ -1900,16 +1941,17 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
We assume that we will be able to undo our changes without errors
(we can't do much if there will be an error anyway).
*/
- (void) table.triggers->change_table_name_in_trignames(db,
- &old_table_name,
- err_trigname);
- (void) table.triggers->change_table_name_in_triggers(thd, db,
- &new_table_name,
- &old_table_name);
+ (void) table.triggers->change_table_name_in_trignames(
+ upgrading50to51 ? new_db : NULL, db,
+ &old_table_name, err_trigname);
+ (void) table.triggers->change_table_name_in_triggers(
+ thd, db, new_db,
+ &new_table_name, &old_table_name);
result= 1;
goto end;
}
}
+
end:
delete table.triggers;
free_root(&table.mem_root, MYF(0));
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index 1b0edf6bea8..f6754a75284 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -146,11 +146,13 @@ public:
private:
bool prepare_record1_accessors(TABLE *table);
- LEX_STRING* change_table_name_in_trignames(const char *db_name,
+ LEX_STRING* change_table_name_in_trignames(const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *new_table_name,
LEX_STRING *stopper);
bool change_table_name_in_triggers(THD *thd,
- const char *db_name,
+ const char *old_db_name,
+ const char *new_db_name,
LEX_STRING *old_table_name,
LEX_STRING *new_table_name);
};
diff --git a/sql/table.cc b/sql/table.cc
index 9d06992a3a9..17454ffb012 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 91747fd23e8..cb53013cd59 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/sql/unireg.cc b/sql/unireg.cc
index 9e42aabfef7..7b770ab733e 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -205,6 +205,24 @@ bool mysql_create_frm(THD *thd, const char *file_name,
(create_info->min_rows == 1) && (keys == 0));
int2store(fileinfo+28,key_info_length);
+ /*
+ This gives us the byte-position of the character at
+ (character-position, not byte-position) TABLE_COMMENT_MAXLEN.
+ The trick here is that character-positions start at 0, so the last
+ character in a maximum-allowed length string would be at char-pos
+ MAXLEN-1; charpos MAXLEN will be the position of the terminator.
+ Consequently, bytepos(charpos(MAXLEN)) should be equal to
+ comment[length] (which should also be the terminator, or at least
+ the first byte after the payload in the strict sense). If this is
+ not so (bytepos(charpos(MAXLEN)) comes /before/ the end of the
+ string), the string is too long.
+
+ For additional credit, realise that UTF-8 has 1-3 bytes before 6.0,
+ and 1-4 bytes in 6.0 (6.0 also has UTF-32). This means that the
+ inlined COMMENT supposedly does not exceed 60 character plus
+ terminator, vulgo, 181 bytes.
+ */
+
tmp_len= system_charset_info->cset->charpos(system_charset_info,
create_info->comment.str,
create_info->comment.str +
@@ -227,14 +245,6 @@ bool mysql_create_frm(THD *thd, const char *file_name,
strmake((char*) forminfo+47, create_info->comment.str ?
create_info->comment.str : "", create_info->comment.length);
forminfo[46]=(uchar) create_info->comment.length;
-#ifdef EXTRA_DEBUG
- /*
- EXTRA_DEBUG causes strmake() to initialize its buffer behind the
- payload with a magic value to detect wrong buffer-sizes. We
- explicitly zero that segment again.
- */
- memset((char*) forminfo+47 + forminfo[46], 0, 61 - forminfo[46]);
-#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (part_info)
{
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;
@@ -66,6 +71,120 @@ buf_LRU_block_free_hashed_page(
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..6358f7ce055 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
@@ -910,6 +922,81 @@ innobase_convert_string(
}
/*************************************************************************
+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
lacks one. */
@@ -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);
}
@@ -3252,6 +3405,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
INSERT ... SELECT type of statements, since MySQL binlog only stores the
@@ -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. <database_name>/<table_name>: 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;
-
- /* 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();
-
- if (error == DB_SUCCESS) {
- ulonglong autoinc;
+ *value = 0;
+
+ prebuilt->autoinc_error = innobase_lock_autoinc();
- /* Determine the first value of the interval */
- autoinc = dict_table_autoinc_read(prebuilt->table);
+ if (prebuilt->autoinc_error == DB_SUCCESS) {
- /* We need to initialize the AUTO-INC value, for
- that we release all locks.*/
- if (autoinc == 0) {
- trx_t* trx;
+ /* Determine the first value of the interval */
+ *value = dict_table_autoinc_read(prebuilt->table);
- trx = prebuilt->trx;
- dict_table_autoinc_unlock(prebuilt->table);
+ /* It should have been initialized during open. */
+ ut_a(*value != 0);
+ }
+
+ return(ulong(prebuilt->autoinc_error));
+}
- /* If we had reserved the AUTO-INC
- lock in this SQL statement we release
- it before retrying.*/
- row_unlock_table_autoinc_for_mysql(trx);
+/***********************************************************************
+This function reads the global auto-inc counter. It doesn't use the
+AUTOINC lock even if the lock mode is set to TRADITIONAL. */
- /* Just to make sure */
- ut_a(!trx->auto_inc_lock);
+ulonglong
+ha_innobase::innobase_peek_autoinc()
+/*================================*/
+ /* out: the autoinc value */
+{
+ ulonglong auto_inc;
+ dict_table_t* innodb_table;
- int mysql_error;
+ ut_a(prebuilt != NULL);
+ ut_a(prebuilt->table != NULL);
- mysql_error = innobase_read_and_init_auto_inc(
- &autoinc);
+ innodb_table = prebuilt->table;
- 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) {
+ dict_table_autoinc_lock(innodb_table);
- sql_print_error("InnoDB: Error: %lu in "
- "::innobase_get_auto_increment()",
- error);
- }
+ auto_inc = dict_table_autoinc_read(innodb_table);
- } while (*value == 0 && error == DB_SUCCESS);
+ ut_a(auto_inc > 0);
- 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;
- /* Check for overflow conditions. */
- need = *nb_reserved_values * increment;
- have = ~0x0ULL - *first_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);
- if (have < need) {
- need = have;
- }
+ need = *nb_reserved_values * increment;
/* 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);
@@ -8091,7 +8249,7 @@ static MYSQL_SYSVAR_BOOL(adaptive_hash_index, innobase_adaptive_hash_index,
static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
- NULL, NULL, 1*1024*1024L, 512*1024L, ~0L, 1024);
+ NULL, NULL, 1*1024*1024L, 512*1024L, LONG_MAX, 1024);
static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
PLUGIN_VAR_RQCMDARG,
@@ -8131,7 +8289,7 @@ static MYSQL_SYSVAR_LONG(lock_wait_timeout, innobase_lock_wait_timeout,
static MYSQL_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The size of the buffer which InnoDB uses to write log to the log files on disk.",
- NULL, NULL, 1024*1024L, 256*1024L, ~0L, 1024);
+ NULL, NULL, 1024*1024L, 256*1024L, LONG_MAX, 1024);
static MYSQL_SYSVAR_LONGLONG(log_file_size, innobase_log_file_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
@@ -8151,7 +8309,7 @@ static MYSQL_SYSVAR_LONG(mirrored_log_groups, innobase_mirrored_log_groups,
static MYSQL_SYSVAR_LONG(open_files, innobase_open_files,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"How many files at the maximum InnoDB keeps open at the same time.",
- NULL, NULL, 300L, 10L, ~0L, 0);
+ NULL, NULL, 300L, 10L, LONG_MAX, 0);
static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
PLUGIN_VAR_RQCMDARG,
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;
+
+ 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;
+ }
- ut_gettimeofday(&tv, NULL);
- *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
@@ -339,6 +339,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.
Returns TRUE for:
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 <!DOCTYPE>, e.g.
+ <!DOCTYPE name SYSTEM "SystemLiteral">
+ <!DOCTYPE name PUBLIC "PublidLiteral" "SystemLiteral">
+ 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;