diff options
96 files changed, 3790 insertions, 1664 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index a95f3d3b836..8242a481c5b 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -66,6 +66,7 @@ static bool opt_hexdump= 0; static bool opt_base64_output= 0; static const char* database= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0, info_flag; +static my_bool force_if_open_opt= 1; static ulonglong offset = 0; static const char* host = 0; static int port= 0; @@ -85,6 +86,7 @@ static short binlog_flags = 0; static MYSQL* mysql = NULL; static const char* dirname_for_local_load= 0; static bool stop_passed= 0; +static my_bool file_not_closed_error= 0; /* check_header() will set the pointer below. @@ -94,8 +96,10 @@ static bool stop_passed= 0; */ Format_description_log_event* description_event; -static int dump_local_log_entries(const char* logname); -static int dump_remote_log_entries(const char* logname); +static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname); +static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname); static int dump_log_entries(const char* logname); static int dump_remote_file(NET* net, const char* fname); static void die(const char* fmt, ...); @@ -645,6 +649,12 @@ Create_file event for file_id: %u\n",exv->file_id); later. */ ev= 0; + if (!force_if_open_opt && + (description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)) + { + file_not_closed_error= 1; + DBUG_RETURN(1); + } break; case BEGIN_LOAD_QUERY_EVENT: ev->print(result_file, print_event_info); @@ -724,6 +734,9 @@ static struct my_option my_long_options[] = "already have. NOTE: you will need a SUPER privilege to use this option.", (gptr*) &disable_log_bin, (gptr*) &disable_log_bin, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"force-if-open", 'F', "Force if binlog was not closed properly.", + (gptr*) &force_if_open_opt, (gptr*) &force_if_open_opt, 0, GET_BOOL, NO_ARG, + 1, 0, 0, 0, 0, 0}, {"force-read", 'f', "Force reading unknown binlog events.", (gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -1001,8 +1014,22 @@ static MYSQL* safe_connect() static int dump_log_entries(const char* logname) { - return (remote_opt ? dump_remote_log_entries(logname) : - dump_local_log_entries(logname)); + int rc; + PRINT_EVENT_INFO print_event_info; + /* + Set safe delimiter, to dump things + like CREATE PROCEDURE safely + */ + fprintf(result_file, "DELIMITER /*!*/;\n"); + strcpy(print_event_info.delimiter, "/*!*/;"); + + rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) : + dump_local_log_entries(&print_event_info, logname)); + + /* Set delimiter back to semicolon */ + fprintf(result_file, "DELIMITER ;\n"); + strcpy(print_event_info.delimiter, ";"); + return rc; } @@ -1067,11 +1094,11 @@ static int check_master_version(MYSQL* mysql, } -static int dump_remote_log_entries(const char* logname) +static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname) { char buf[128]; - PRINT_EVENT_INFO print_event_info; ulong len; uint logname_len; NET* net; @@ -1194,7 +1221,7 @@ could be out of memory"); len= 1; // fake Rotate, so don't increment old_off } } - if ((error= process_event(&print_event_info, ev, old_off))) + if ((error= process_event(print_event_info, ev, old_off))) { error= ((error < 0) ? 0 : 1); goto err; @@ -1213,7 +1240,7 @@ could be out of memory"); goto err; } - if ((error= process_event(&print_event_info, ev, old_off))) + if ((error= process_event(print_event_info, ev, old_off))) { my_close(file,MYF(MY_WME)); error= ((error < 0) ? 0 : 1); @@ -1339,11 +1366,11 @@ at offset %lu ; this could be a log format error or read error", } -static int dump_local_log_entries(const char* logname) +static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname) { File fd = -1; IO_CACHE cache,*file= &cache; - PRINT_EVENT_INFO print_event_info; byte tmp_buff[BIN_LOG_HEADER_SIZE]; int error= 0; @@ -1430,7 +1457,7 @@ static int dump_local_log_entries(const char* logname) // file->error == 0 means EOF, that's OK, we break in this case break; } - if ((error= process_event(&print_event_info, ev, old_off))) + if ((error= process_event(print_event_info, ev, old_off))) { if (error < 0) error= 0; @@ -1547,6 +1574,16 @@ int main(int argc, char** argv) my_free_open_file_info(); /* We cannot free DBUG, it is used in global destructors after exit(). */ my_end((info_flag ? MY_CHECK_ERROR : 0) | MY_DONT_FREE_DBUG); + + if (file_not_closed_error) + { + fprintf(stderr, +"\nError: attempting to dump binlog '%s' which was not closed properly.\n" +"Most probably mysqld is still writting it, or crashed.\n" +"Your current options specify --disable-force-if-open\n" +"which means to abort on this problem.\n" +"You can rerun using --force-if-open to ignore this problem.\n\n", argv[-1]); + } exit(exit_value); DBUG_RETURN(exit_value); // Keep compilers happy } diff --git a/config/ac-macros/ha_ndbcluster.m4 b/config/ac-macros/ha_ndbcluster.m4 index 26cb0394583..86bd16487eb 100644 --- a/config/ac-macros/ha_ndbcluster.m4 +++ b/config/ac-macros/ha_ndbcluster.m4 @@ -229,10 +229,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [ if test X"$ndb_binlog" = Xdefault || test X"$ndb_binlog" = Xyes then - if test X"$have_row_based" = Xyes - then - have_ndb_binlog="yes" - fi + have_ndb_binlog="yes" fi if test X"$have_ndb_binlog" = Xyes diff --git a/config/ac-macros/replication.m4 b/config/ac-macros/replication.m4 deleted file mode 100644 index babfa000a82..00000000000 --- a/config/ac-macros/replication.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl This file contains configuration parameters for replication. - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_REPLICATION -dnl Sets HAVE_ROW_BASED_REPLICATION if --with-row-based-replication is used -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_CHECK_REPLICATION], [ - AC_ARG_WITH([row-based-replication], - AC_HELP_STRING([--without-row-based-replication], - [Don't include row-based replication]), - [row_based="$withval"], - [row_based=yes]) - AC_MSG_CHECKING([for row-based replication]) - - case "$row_based" in - yes ) - AC_DEFINE([WITH_ROW_BASED_REPLICATION], [1], [Define to have row-based replication]) - AC_MSG_RESULT([-- including row-based replication]) - [have_row_based=yes] - ;; - * ) - AC_MSG_RESULT([-- not including row-based replication]) - [have_row_based=no] - ;; - esac -]) -dnl --------------------------------------------------------------------------- -dnl END OF MYSQL_CHECK_REPLICATION -dnl --------------------------------------------------------------------------- diff --git a/configure.in b/configure.in index 2a238a1f221..818e8a555f2 100644 --- a/configure.in +++ b/configure.in @@ -35,7 +35,6 @@ sinclude(config/ac-macros/ha_ndbcluster.m4) sinclude(config/ac-macros/large_file.m4) sinclude(config/ac-macros/misc.m4) sinclude(config/ac-macros/readline.m4) -sinclude(config/ac-macros/replication.m4) sinclude(config/ac-macros/ssl.m4) sinclude(config/ac-macros/zlib.m4) @@ -2172,7 +2171,6 @@ AC_MSG_RESULT("$netinet_inc") MYSQL_CHECK_BIG_TABLES MYSQL_CHECK_MAX_INDEXES -MYSQL_CHECK_REPLICATION MYSQL_CHECK_VIO MYSQL_CHECK_SSL diff --git a/include/config-win.h b/include/config-win.h index edecf8d2fc8..5e021602325 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -435,7 +435,6 @@ inline double ulonglong2double(ulonglong value) #define HAVE_SPATIAL 1 #define HAVE_RTREE_KEYS 1 -#define HAVE_ROW_BASED_REPLICATION 1 #define HAVE_OPENSSL 1 #define HAVE_YASSL 1 diff --git a/include/my_global.h b/include/my_global.h index dad6ea46604..1c238f0392f 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -78,9 +78,6 @@ #endif /* _WIN32... */ #ifndef EMBEDDED_LIBRARY -#ifdef WITH_ROW_BASED_REPLICATION -#define HAVE_ROW_BASED_REPLICATION 1 -#endif #ifdef WITH_NDB_BINLOG #define HAVE_NDB_BINLOG 1 #endif diff --git a/include/my_pthread.h b/include/my_pthread.h index 17b7b98da02..65c759aaab7 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -30,8 +30,26 @@ extern "C" { #define EXTERNC #endif /* __cplusplus */ -#if defined(__WIN__) +/* + BUG#24507: Race conditions inside current NPTL pthread_exit() implementation. + + If macro NPTL_PTHREAD_EXIT_HACK is defined then a hack described in the bug + report will be implemented inside my_thread_global_init() in my_thr_init.c. + + This amounts to spawning a dummy thread which does nothing but executes + pthread_exit(0). + + This bug is fixed in version 2.5 of glibc library. + + TODO: Remove this code when fixed versions of glibc6 are in common use. + */ + +#if defined(TARGET_OS_LINUX) && defined(HAVE_NPTL) && \ + defined(__GLIBC__) && ( __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 5 ) +#define NPTL_PTHREAD_EXIT_BUG 1 +#endif +#if defined(__WIN__) typedef CRITICAL_SECTION pthread_mutex_t; typedef HANDLE pthread_t; typedef struct thread_attr { diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 87b1b4d37a3..b0b32fab76b 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -18,8 +18,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") # Need to set USE_TLS, since __declspec(thread) approach to thread local # storage does not work properly in DLLs. -ADD_DEFINITIONS(-DUSE_TLS -DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER - -DEMBEDDED_LIBRARY) +ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER -DEMBEDDED_LIBRARY) # The old Windows build method used renamed (.cc -> .cpp) source files, fails # in #include in lib_sql.cc. So disable that using the USING_CMAKE define. diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test index afe594b8d36..fcf39e38163 100644 --- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test +++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test @@ -14,6 +14,7 @@ show binlog events from 102; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). +flush logs; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 drop table t2; diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index ea2c4c1688c..c2001091b45 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -1,4 +1,3 @@ ---source include/have_row_based.inc --source include/have_binlog_format_row.inc --source include/master-slave.inc diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test index 54c14594cf4..c50a5613386 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test +++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test @@ -80,28 +80,28 @@ INSERT INTO t1_bit VALUES (1,2); INSERT INTO t1_bit VALUES (2,5); INSERT INTO t1_char VALUES (1,2); INSERT INTO t1_char VALUES (2,5); -SELECT * FROM t1_int; -SELECT * FROM t1_bit; -SELECT * FROM t1_char; +SELECT * FROM t1_int ORDER BY a; +SELECT * FROM t1_bit ORDER BY a; +SELECT * FROM t1_char ORDER BY a; --echo **** On Slave **** sync_slave_with_master; -SELECT a,b,x FROM t1_int; -SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit; -SELECT a,b,x FROM t1_char; +SELECT a,b,x FROM t1_int ORDER BY a; +SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a; +SELECT a,b,x FROM t1_char ORDER BY a; --echo **** On Master **** connection master; UPDATE t1_int SET b=2*b WHERE a=2; UPDATE t1_char SET b=2*b WHERE a=2; UPDATE t1_bit SET b=2*b WHERE a=2; -SELECT * FROM t1_int; -SELECT * FROM t1_bit; -SELECT * FROM t1_char; +SELECT * FROM t1_int ORDER BY a; +SELECT * FROM t1_bit ORDER BY a; +SELECT * FROM t1_char ORDER BY a; --echo **** On Slave **** sync_slave_with_master; -SELECT a,b,x FROM t1_int; -SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit; -SELECT a,b,x FROM t1_char; +SELECT a,b,x FROM t1_int ORDER BY a; +SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a; +SELECT a,b,x FROM t1_char ORDER BY a; # Each of these inserts should generate an error and stop the slave @@ -188,11 +188,11 @@ sync_slave_with_master; connection master; INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); -SELECT * FROM t7; -SELECT * FROM t8; +SELECT * FROM t7 ORDER BY a; +SELECT * FROM t8 ORDER BY a; sync_slave_with_master; -SELECT * FROM t7; -SELECT * FROM t8; +SELECT * FROM t7 ORDER BY a; +SELECT * FROM t8 ORDER BY a; # We will now try to update and then delete a row on the master where # the extra field on the slave does not have a default value. This @@ -216,20 +216,20 @@ INSERT INTO t1_nodef VALUES (2,4,6); --echo **** On Master **** connection master; UPDATE t1_nodef SET b=2*b WHERE a=1; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; --echo **** On Slave **** sync_slave_with_master; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; --echo **** On Master **** connection master; DELETE FROM t1_nodef WHERE a=2; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; --echo **** On Slave **** sync_slave_with_master; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; --echo **** Cleanup **** connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_stm_charset.test b/mysql-test/extra/rpl_tests/rpl_stm_charset.test index 10b4310127f..5657b06e88f 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_charset.test @@ -156,6 +156,7 @@ select hex(c1), hex(c2) from t1; connection master; # Let's have a look at generated SETs. +flush logs; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 drop table t1; diff --git a/mysql-test/extra/rpl_tests/rpl_truncate.test b/mysql-test/extra/rpl_tests/rpl_truncate.test index 37fd9fbc064..bca53336514 100644 --- a/mysql-test/extra/rpl_tests/rpl_truncate.test +++ b/mysql-test/extra/rpl_tests/rpl_truncate.test @@ -7,7 +7,6 @@ # # Author(s): Mats Kindahl ---source include/have_row_based.inc --source include/master-slave.inc let $format = STATEMENT; diff --git a/mysql-test/include/have_row_based.inc b/mysql-test/include/have_row_based.inc deleted file mode 100644 index 23771fde5cc..00000000000 --- a/mysql-test/include/have_row_based.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/have_row_based.require -disable_query_log; -show variables like "have_row_based_replication"; -enable_query_log; diff --git a/mysql-test/include/not_row_based.inc b/mysql-test/include/not_row_based.inc deleted file mode 100644 index 22f40bdceb0..00000000000 --- a/mysql-test/include/not_row_based.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/not_row_based.require -disable_query_log; -show variables like "have_row_based_replication"; -enable_query_log; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b26c1eb6ca0..c1f9281b5f1 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1855,7 +1855,7 @@ sub environment_setup () { # ---------------------------------------------------- my $cmdline_mysqlbinlog= "$exe_mysqlbinlog" . - " --no-defaults --debug-info --local-load=$opt_tmpdir"; + " --no-defaults --disable-force-if-open --debug-info --local-load=$opt_tmpdir"; if ( $mysql_version_id >= 50000 ) { $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir"; diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/r/binlog_row_ctype_ucs.result index 5feb17cde13..4eeff79e13a 100644 --- a/mysql-test/r/binlog_row_ctype_ucs.result +++ b/mysql-test/r/binlog_row_ctype_ucs.result @@ -7,9 +7,12 @@ show binlog events from 102; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 102 Table_map 1 141 table_id: # (test.t2) master-bin.000001 141 Write_rows 1 231 table_id: # flags: STMT_END_F +flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; +DELIMITER /*!*/; +ROLLBACK/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/r/binlog_row_mix_innodb_myisam.result index e063d7371a9..185ca33d4db 100644 --- a/mysql-test/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_row_mix_innodb_myisam.result @@ -400,6 +400,7 @@ insert into t2 select * from t1; select get_lock("a",10); get_lock("a",10) 1 +flush logs; select (@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) is not null; @@ -407,8 +408,8 @@ is not null; is not null 1 select -@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", +@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", @a not like "%#%error_code=%error_code=%"; -@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" +@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" 1 1 drop table t1, t2; diff --git a/mysql-test/r/binlog_stm_ctype_ucs.result b/mysql-test/r/binlog_stm_ctype_ucs.result index 61ca21d4058..76f3a3b06b9 100644 --- a/mysql-test/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/r/binlog_stm_ctype_ucs.result @@ -7,17 +7,20 @@ show binlog events from 102; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 102 User var 1 142 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci master-bin.000001 142 Query 1 231 use `test`; insert into t2 values (@v) +flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`; -use test; -SET TIMESTAMP=10000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t2 values (@v); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; +use test/*!*/; +SET TIMESTAMP=10000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t2 values (@v)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/r/binlog_stm_mix_innodb_myisam.result index 8ab6840d441..23f4e50826a 100644 --- a/mysql-test/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_stm_mix_innodb_myisam.result @@ -367,6 +367,7 @@ insert into t2 select * from t1; select get_lock("a",10); get_lock("a",10) 1 +flush logs; select (@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) is not null; @@ -374,8 +375,8 @@ is not null; is not null 1 select -@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", +@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", @a not like "%#%error_code=%error_code=%"; -@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" +@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" 1 1 drop table t1, t2; diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index d354a8b99f7..ef1067e7c5d 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -41,6 +41,6 @@ IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 805 Query 1 1010 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1'Foo\'s a Bar'), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) -master-bin.000001 1010 Query 1 1096 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1096 Query 1 1172 use `test`; DROP TABLE t4 +master-bin.000001 805 Query 1 1021 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) +master-bin.000001 1021 Query 1 1107 use `test`; DROP PROCEDURE bug18293 +master-bin.000001 1107 Query 1 1183 use `test`; DROP TABLE t4 diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 4aa22944b9b..37ef5e2756f 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -124,12 +124,34 @@ create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d"); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varbinary(10) DEFAULT NULL + `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t1; date_format("2004-01-19 10:10:10", "%Y-%m-%d") 2004-01-19 drop table t1; +set names utf8; +set LC_TIME_NAMES='fr_FR'; +create table t1 (s1 char(20) character set latin1); +insert into t1 values (date_format('2004-02-02','%M')); +select hex(s1) from t1; +hex(s1) +66E97672696572 +drop table t1; +create table t1 (s1 char(20) character set koi8r); +set LC_TIME_NAMES='ru_RU'; +insert into t1 values (date_format('2004-02-02','%M')); +insert into t1 values (date_format('2004-02-02','%b')); +insert into t1 values (date_format('2004-02-02','%W')); +insert into t1 values (date_format('2004-02-02','%a')); +select hex(s1), s1 from t1; +hex(s1) s1 +E6C5D7D2C1CCD1 Ð¤ÐµÐ²Ñ€Ð°Ð»Ñ +E6C5D7 Фев +F0CFCEC5C4C5CCD8CEC9CB Понедельник +F0CEC4 Пнд +drop table t1; +set LC_TIME_NAMES='en_US'; set names koi8r; create table t1 (s1 char(1) character set utf8); insert into t1 values (_koi8r'ÁÂ'); diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result index 335ca848387..1efd3fa602e 100644 --- a/mysql-test/r/events_logs_tests.result +++ b/mysql-test/r/events_logs_tests.result @@ -59,6 +59,7 @@ SELECT * FROM slow_event_test; slo_val val SET SESSION long_query_time=1; SET GLOBAL event_scheduler=on; +SET GLOBAL long_query_time=20; CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5); "Sleep some more time than the actual event run will take" SHOW VARIABLES LIKE 'event_scheduler'; @@ -67,20 +68,22 @@ event_scheduler ON "Check our table. Should see 1 row" SELECT * FROM slow_event_test; slo_val val -4 0 -"Check slow log. Should not see anything because 1.5 is under the threshold of 300 for GLOBAL, though over SESSION which is 2" +20 0 +"Check slow log. Should not see anything because 1.5 is under the threshold of 20 for GLOBAL, though over SESSION which is 1" +"This should show that the GLOBAL value is regarded and not the SESSION one of the current connection" SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; user_host query_time db sql_text +"Another test to show that GLOBAL is regarded and not SESSION." "This should go to the slow log" -DROP EVENT long_event; SET SESSION long_query_time=10; +DROP EVENT long_event; SET GLOBAL long_query_time=1; CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2); "Sleep some more time than the actual event run will take" "Check our table. Should see 2 rows" SELECT * FROM slow_event_test; slo_val val -4 0 +20 0 1 0 "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; diff --git a/mysql-test/r/have_row_based.require b/mysql-test/r/have_row_based.require deleted file mode 100644 index c71451a95c3..00000000000 --- a/mysql-test/r/have_row_based.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_row_based_replication YES diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index c3be791b523..4163ad1b4f7 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -15,31 +15,33 @@ flush logs; --- Local -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -drop table if exists t1,t2; -SET TIMESTAMP=1000000000; -create table t1 (word varchar(20)); -SET TIMESTAMP=1000000000; -create table t2 (id int auto_increment not null primary key); -SET TIMESTAMP=1000000000; -insert into t1 values ("abirvalg"); -SET INSERT_ID=1; -SET TIMESTAMP=1000000000; -insert into t2 values (); -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-0' INTO table t1; -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-0' INTO table t1; -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-0' INTO table t1; -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-0' INTO table t1; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +drop table if exists t1,t2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +create table t1 (word varchar(20))/*!*/; +SET TIMESTAMP=1000000000/*!*/; +create table t2 (id int auto_increment not null primary key)/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 values ("abirvalg")/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t2 values ()/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-0' INTO table t1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-0' INTO table t1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-0' INTO table t1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-0' INTO table t1/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -47,13 +49,15 @@ ROLLBACK /* added by mysqlbinlog */; --- Broken LOAD DATA -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values ("Alas"); +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values ("Alas")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -61,8 +65,10 @@ ROLLBACK /* added by mysqlbinlog */; --- --database -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=1; +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=1/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -70,13 +76,15 @@ ROLLBACK /* added by mysqlbinlog */; --- --position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values ("Alas"); +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values ("Alas")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -84,31 +92,33 @@ ROLLBACK /* added by mysqlbinlog */; --- Remote -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -drop table if exists t1,t2; -SET TIMESTAMP=1000000000; -create table t1 (word varchar(20)); -SET TIMESTAMP=1000000000; -create table t2 (id int auto_increment not null primary key); -SET TIMESTAMP=1000000000; -insert into t1 values ("abirvalg"); -SET INSERT_ID=1; -SET TIMESTAMP=1000000000; -insert into t2 values (); -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-2' INTO table t1; -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-2' INTO table t1; -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-2' INTO table t1; -SET TIMESTAMP=1000000000; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-2' INTO table t1; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +drop table if exists t1,t2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +create table t1 (word varchar(20))/*!*/; +SET TIMESTAMP=1000000000/*!*/; +create table t2 (id int auto_increment not null primary key)/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 values ("abirvalg")/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t2 values ()/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-2' INTO table t1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-2' INTO table t1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-2' INTO table t1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-2' INTO table t1/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -116,13 +126,15 @@ ROLLBACK /* added by mysqlbinlog */; --- Broken LOAD DATA -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values ("Alas"); +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values ("Alas")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -130,8 +142,10 @@ ROLLBACK /* added by mysqlbinlog */; --- --database -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=1; +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=1/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -139,13 +153,15 @@ ROLLBACK /* added by mysqlbinlog */; --- --position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values ("Alas"); +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values ("Alas")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -153,22 +169,26 @@ ROLLBACK /* added by mysqlbinlog */; --- reading stdin -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1108844556; -BEGIN; -SET TIMESTAMP=1108844555; -insert t1 values (1); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1108844556/*!*/; +BEGIN/*!*/; +SET TIMESTAMP=1108844555/*!*/; +insert t1 values (1)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -use test; -SET TIMESTAMP=1108844556; -BEGIN; -SET TIMESTAMP=1108844555; -insert t1 values (1); +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1108844556/*!*/; +BEGIN/*!*/; +SET TIMESTAMP=1108844555/*!*/; +insert t1 values (1)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -190,8 +210,65 @@ select HEX(f) from t4; HEX(f) 835C flush logs; +flush logs; select * from t5 /* must be (1),(1) */; a 1 1 +flush logs; +drop table if exists t5; +create table t5 (c1 int, c2 varchar(128) character set latin1 not null); +insert into t5 values (1, date_format('2001-01-01','%W')); +set lc_time_names=de_DE; +insert into t5 values (2, date_format('2001-01-01','%W')); +set lc_time_names=en_US; +insert into t5 values (3, date_format('2001-01-01','%W')); +select * from t5 order by c1; +c1 c2 +1 Monday +2 Montag +3 Monday +flush logs; +drop table t5; +select * from t5 order by c1; +c1 c2 +1 Monday +2 Montag +3 Monday +drop procedure if exists p1; +flush logs; +create procedure p1() +begin +select 1; +end; +// +flush logs; +call p1(); +1 +1 +drop procedure p1; +call p1(); +ERROR 42000: PROCEDURE test.p1 does not exist +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +CREATE DEFINER=`root`@`localhost` procedure p1() +begin +select 1; +end/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +call p1(); +1 +1 +drop procedure p1; drop table t1, t2, t03, t04, t3, t4, t5; +flush logs; diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index 4d6be811037..e76ab71fd54 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -17,29 +17,31 @@ insert into t1 values(null, "f"); --- Local -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -47,27 +49,29 @@ ROLLBACK /* added by mysqlbinlog */; --- offset -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=1; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -75,17 +79,19 @@ ROLLBACK /* added by mysqlbinlog */; --- start-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -SET INSERT_ID=4; -use test; -SET TIMESTAMP=1579609946; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +SET INSERT_ID=4/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609946/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -93,23 +99,25 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -117,21 +125,23 @@ ROLLBACK /* added by mysqlbinlog */; --- start-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=3; -use test; -SET TIMESTAMP=1579609944; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -139,58 +149,65 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- Local with 2 binlogs on command line -- +flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -198,35 +215,39 @@ ROLLBACK /* added by mysqlbinlog */; --- offset -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=1; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -234,25 +255,29 @@ ROLLBACK /* added by mysqlbinlog */; --- start-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -SET INSERT_ID=4; -use test; -SET TIMESTAMP=1579609946; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +SET INSERT_ID=4/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609946/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -260,30 +285,34 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -291,29 +320,33 @@ ROLLBACK /* added by mysqlbinlog */; --- start-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=3; -use test; -SET TIMESTAMP=1579609944; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -321,20 +354,22 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -342,29 +377,31 @@ ROLLBACK /* added by mysqlbinlog */; --- Remote -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -372,27 +409,29 @@ ROLLBACK /* added by mysqlbinlog */; --- offset -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=1; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -400,17 +439,19 @@ ROLLBACK /* added by mysqlbinlog */; --- start-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -SET INSERT_ID=4; -use test; -SET TIMESTAMP=1579609946; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +SET INSERT_ID=4/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609946/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -418,23 +459,25 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -442,21 +485,23 @@ ROLLBACK /* added by mysqlbinlog */; --- start-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=3; -use test; -SET TIMESTAMP=1579609944; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -464,20 +509,22 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -485,37 +532,41 @@ ROLLBACK /* added by mysqlbinlog */; --- Remote with 2 binlogs on command line -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -523,35 +574,39 @@ ROLLBACK /* added by mysqlbinlog */; --- offset -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=1; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -559,25 +614,29 @@ ROLLBACK /* added by mysqlbinlog */; --- start-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -SET INSERT_ID=4; -use test; -SET TIMESTAMP=1579609946; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +SET INSERT_ID=4/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609946/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -585,30 +644,34 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -616,29 +679,33 @@ ROLLBACK /* added by mysqlbinlog */; --- start-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET INSERT_ID=3; -use test; -SET TIMESTAMP=1579609944; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -use test; -SET TIMESTAMP=1579609943; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +DELIMITER ; +DELIMITER /*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -646,20 +713,22 @@ ROLLBACK /* added by mysqlbinlog */; --- stop-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -667,32 +736,34 @@ ROLLBACK /* added by mysqlbinlog */; --- to-last-log -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1579609942; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -create table t1 (a int auto_increment not null primary key, b char(3)); -SET INSERT_ID=1; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "a"); -SET INSERT_ID=2; -SET TIMESTAMP=1579609942; -insert into t1 values(null, "b"); -SET INSERT_ID=3; -SET TIMESTAMP=1579609944; -insert into t1 values(null, "c"); -SET INSERT_ID=4; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "d"); -SET INSERT_ID=5; -SET TIMESTAMP=1579609946; -insert into t1 values(null, "e"); -SET INSERT_ID=6; -SET TIMESTAMP=1579609943; -insert into t1 values(null, "f"); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "a")/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1579609942/*!*/; +insert into t1 values(null, "b")/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c")/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1579609946/*!*/; +insert into t1 values(null, "e")/*!*/; +SET INSERT_ID=6/*!*/; +SET TIMESTAMP=1579609943/*!*/; +insert into t1 values(null, "f")/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; diff --git a/mysql-test/r/mysqlbinlog_base64.result b/mysql-test/r/mysqlbinlog_base64.result index c31dbee56c6..33047a8774d 100644 --- a/mysql-test/r/mysqlbinlog_base64.result +++ b/mysql-test/r/mysqlbinlog_base64.result @@ -6,6 +6,7 @@ update t1 set a=a+2 where a=2; update t1 set a=a+2 where a=3; create table t2 (word varchar(20)); load data infile '../std_data_ln/words.dat' into table t2; +flush logs; drop table t1; drop table t2; select * from t1; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 4ac1dfc938f..0190094f0ba 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1787,6 +1787,78 @@ CREATE TABLE `t1` ( /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; drop table t1; +# +# BUG#13926: --order-by-primary fails if PKEY contains quote character +# +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( +`a b` INT, +`c"d` INT, +`e``f` INT, +PRIMARY KEY (`a b`, `c"d`, `e``f`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t1 values (0815, 4711, 2006); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS "t1"; +CREATE TABLE "t1" ( + "a b" int(11) NOT NULL DEFAULT '0', + "c""d" int(11) NOT NULL DEFAULT '0', + "e`f" int(11) NOT NULL DEFAULT '0', + PRIMARY KEY ("a b","c""d","e`f") +); + +LOCK TABLES "t1" WRITE; +/*!40000 ALTER TABLE "t1" DISABLE KEYS */; +INSERT INTO "t1" VALUES (815,4711,2006); +/*!40000 ALTER TABLE "t1" ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a b` int(11) NOT NULL DEFAULT '0', + `c"d` int(11) NOT NULL DEFAULT '0', + `e``f` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`a b`,`c"d`,`e``f`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT INTO `t1` VALUES (815,4711,2006); +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE `t1`; End of 4.1 tests # # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X) @@ -3123,78 +3195,6 @@ drop user myDB_User@localhost; drop database mysqldump_myDB; use test; # -# BUG#13926: --order-by-primary fails if PKEY contains quote character -# -DROP TABLE IF EXISTS `t1`; -CREATE TABLE `t1` ( -`a b` INT, -`c"d` INT, -`e``f` INT, -PRIMARY KEY (`a b`, `c"d`, `e``f`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -insert into t1 values (0815, 4711, 2006); -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS "t1"; -CREATE TABLE "t1" ( - "a b" int(11) NOT NULL DEFAULT '0', - "c""d" int(11) NOT NULL DEFAULT '0', - "e`f" int(11) NOT NULL DEFAULT '0', - PRIMARY KEY ("a b","c""d","e`f") -); - -LOCK TABLES "t1" WRITE; -/*!40000 ALTER TABLE "t1" DISABLE KEYS */; -INSERT INTO "t1" VALUES (815,4711,2006); -/*!40000 ALTER TABLE "t1" ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS `t1`; -CREATE TABLE `t1` ( - `a b` int(11) NOT NULL DEFAULT '0', - `c"d` int(11) NOT NULL DEFAULT '0', - `e``f` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`a b`,`c"d`,`e``f`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -LOCK TABLES `t1` WRITE; -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (815,4711,2006); -/*!40000 ALTER TABLE `t1` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - -DROP TABLE `t1`; -# # Bug #19745: mysqldump --xml produces invalid xml # DROP TABLE IF EXISTS t1; diff --git a/mysql-test/r/not_row_based.require b/mysql-test/r/not_row_based.require deleted file mode 100644 index e30e73320fb..00000000000 --- a/mysql-test/r/not_row_based.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_row_based_replication NO diff --git a/mysql-test/r/rpl_charset_sjis.result b/mysql-test/r/rpl_charset_sjis.result new file mode 100644 index 00000000000..770ad0588d1 --- /dev/null +++ b/mysql-test/r/rpl_charset_sjis.result @@ -0,0 +1,26 @@ +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; +drop table if exists t1; +drop procedure if exists p1; +create table t1 (a varchar(255) character set sjis); +create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a); +SET NAMES binary; +CALL p1 ('–\\'); +select "--- on master ---"; +--- on master --- +--- on master --- +select hex(a) from t1 ; +hex(a) +965C +select "--- on slave ---"; +--- on slave --- +--- on slave --- +select hex(a) from t1; +hex(a) +965C +drop table t1; +drop procedure p1; diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/r/rpl_do_grant.result index 50d181be0ca..f7f1ce66656 100644 --- a/mysql-test/r/rpl_do_grant.result +++ b/mysql-test/r/rpl_do_grant.result @@ -20,6 +20,17 @@ set password for rpl_do_grant@localhost=password("does it work?"); select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; password<>_binary'' 1 +update mysql.user set password='' where user='rpl_do_grant'; +flush privileges; +select password<>'' from mysql.user where user='rpl_do_grant'; +password<>'' +0 +set sql_mode='ANSI_QUOTES'; +set password for rpl_do_grant@localhost=password('does it work?'); +set sql_mode=''; +select password<>'' from mysql.user where user='rpl_do_grant'; +password<>'' +1 delete from mysql.user where user=_binary'rpl_do_grant'; delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; diff --git a/mysql-test/r/rpl_locale.result b/mysql-test/r/rpl_locale.result new file mode 100644 index 00000000000..b7396084663 --- /dev/null +++ b/mysql-test/r/rpl_locale.result @@ -0,0 +1,20 @@ +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 (s1 char(10)); +set lc_time_names= 'de_DE'; +insert into t1 values (date_format('2001-01-01','%W')); +set lc_time_names= 'en_US'; +insert into t1 values (date_format('2001-01-01','%W')); +select * from t1; +s1 +Montag +Monday +select * from t1; +s1 +Montag +Monday +drop table t1; diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result index 03388f59b8c..8f587fb5796 100644 --- a/mysql-test/r/rpl_row_create_table.result +++ b/mysql-test/r/rpl_row_create_table.result @@ -127,7 +127,7 @@ NULL 5 10 NULL 6 12 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; ERROR 23000: Duplicate entry '2' for key 'b' -SHOW BINLOG EVENTS FROM 1256; +SHOW BINLOG EVENTS FROM 1118; 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; @@ -212,3 +212,192 @@ Create Table CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1 +DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; +STOP SLAVE; +SET GLOBAL storage_engine=@storage_engine; +START SLAVE; +================ BUG#22864 ================ +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +SET AUTOCOMMIT=0; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 ENGINE=INNODB SELECT * FROM t1; +ROLLBACK; +CREATE TABLE t3 ENGINE=INNODB SELECT * FROM t1; +INSERT INTO t3 VALUES (4),(5),(6); +ROLLBACK; +CREATE TABLE t4 ENGINE=INNODB SELECT * FROM t1; +INSERT INTO t1 VALUES (4),(5),(6); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SHOW TABLES; +Tables_in_test +t1 +t2 +t3 +t4 +SELECT TABLE_NAME,ENGINE +FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME LIKE 't_' +ORDER BY TABLE_NAME; +TABLE_NAME ENGINE +t1 MyISAM +t2 InnoDB +t3 InnoDB +t4 InnoDB +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +SELECT * FROM t2 ORDER BY a; +a +1 +2 +3 +SELECT * FROM t3 ORDER BY a; +a +1 +2 +3 +SELECT * FROM t4 ORDER BY a; +a +1 +2 +3 +SHOW BINLOG EVENTS; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # +master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) +master-bin.000001 227 Write_rows 1 271 table_id: # flags: STMT_END_F +master-bin.000001 271 Query 1 339 use `test`; BEGIN +master-bin.000001 339 Query 1 125 use `test`; CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 464 Table_map 1 164 table_id: # (test.t2) +master-bin.000001 503 Write_rows 1 208 table_id: # flags: STMT_END_F +master-bin.000001 547 Xid 1 574 COMMIT /* XID */ +master-bin.000001 574 Query 1 642 use `test`; BEGIN +master-bin.000001 642 Query 1 125 use `test`; CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 767 Table_map 1 164 table_id: # (test.t3) +master-bin.000001 806 Write_rows 1 208 table_id: # flags: STMT_END_F +master-bin.000001 850 Xid 1 877 COMMIT /* XID */ +master-bin.000001 877 Query 1 945 use `test`; BEGIN +master-bin.000001 945 Query 1 125 use `test`; CREATE TABLE `t4` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 1070 Table_map 1 164 table_id: # (test.t4) +master-bin.000001 1109 Write_rows 1 208 table_id: # flags: STMT_END_F +master-bin.000001 1153 Xid 1 1180 COMMIT /* XID */ +master-bin.000001 1180 Table_map 1 1219 table_id: # (test.t1) +master-bin.000001 1219 Write_rows 1 1263 table_id: # flags: STMT_END_F +SHOW TABLES; +Tables_in_test +t1 +t2 +t3 +t4 +SELECT TABLE_NAME,ENGINE +FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME LIKE 't_' +ORDER BY TABLE_NAME; +TABLE_NAME ENGINE +t1 MyISAM +t2 InnoDB +t3 InnoDB +t4 InnoDB +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +SELECT * FROM t2 ORDER BY a; +a +1 +2 +3 +SELECT * FROM t3 ORDER BY a; +a +1 +2 +3 +SELECT * FROM t4 ORDER BY a; +a +1 +2 +3 +DROP TABLE IF EXISTS t1,t2,t3,t4; +SET AUTOCOMMIT=1; +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (a INT) ENGINE=INNODB; +BEGIN; +INSERT INTO t2 SELECT a*a FROM t1; +CREATE TEMPORARY TABLE tt1 +SELECT a+1 AS a +FROM t1 +WHERE a MOD 2 = 1; +INSERT INTO t2 SELECT a+2 FROM tt1; +COMMIT; +SELECT * FROM t2 ORDER BY a; +a +1 +4 +4 +6 +9 +SHOW BINLOG EVENTS; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # +master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) +master-bin.000001 227 Write_rows 1 271 table_id: # flags: STMT_END_F +master-bin.000001 271 Query 1 371 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB +master-bin.000001 371 Query 1 439 use `test`; BEGIN +master-bin.000001 439 Table_map 1 39 table_id: # (test.t2) +master-bin.000001 478 Write_rows 1 83 table_id: # flags: STMT_END_F +master-bin.000001 522 Table_map 1 122 table_id: # (test.t2) +master-bin.000001 561 Write_rows 1 161 table_id: # flags: STMT_END_F +master-bin.000001 600 Xid 1 627 COMMIT /* XID */ +SELECT * FROM t2 ORDER BY a; +a +1 +4 +4 +6 +9 +TRUNCATE TABLE t2; +BEGIN; +INSERT INTO t2 SELECT a*a FROM t1; +CREATE TEMPORARY TABLE tt2 +SELECT a+1 AS a +FROM t1 +WHERE a MOD 2 = 1; +INSERT INTO t2 SELECT a+2 FROM tt2; +ROLLBACK; +SELECT * FROM t2 ORDER BY a; +a +SHOW BINLOG EVENTS FROM 627; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 627 Query 1 80 use `test`; TRUNCATE TABLE t2 +master-bin.000001 707 Xid 1 734 COMMIT /* XID */ +SELECT * FROM t2 ORDER BY a; +a +DROP TABLE t1,t2; diff --git a/mysql-test/r/rpl_row_mysqlbinlog.result b/mysql-test/r/rpl_row_mysqlbinlog.result index 374f2d3ee82..c9f46e73cfd 100644 --- a/mysql-test/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/r/rpl_row_mysqlbinlog.result @@ -154,13 +154,15 @@ c1 c3 c4 c5 --- Test 2 position test -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT); +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -168,20 +170,22 @@ ROLLBACK /* added by mysqlbinlog */; --- Test 3 First Remote test -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -DROP TABLE IF EXISTS t1,t2,t3; -SET TIMESTAMP=1000000000; -CREATE TABLE t1(word VARCHAR(20)); -SET TIMESTAMP=1000000000; -CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY); -SET TIMESTAMP=1000000000; -CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +DROP TABLE IF EXISTS t1,t2,t3/*!*/; +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t1(word VARCHAR(20))/*!*/; +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/; +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -189,6 +193,8 @@ ROLLBACK /* added by mysqlbinlog */; --- Test 5 LOAD DATA -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -196,20 +202,22 @@ ROLLBACK /* added by mysqlbinlog */; --- Test 6 reading stdin -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -DROP TABLE IF EXISTS t1,t2,t3; -SET TIMESTAMP=1000000000; -CREATE TABLE t1(word VARCHAR(20)); -SET TIMESTAMP=1000000000; -CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY); -SET TIMESTAMP=1000000000; -CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT); +DELIMITER /*!*/; +ROLLBACK/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +DROP TABLE IF EXISTS t1,t2,t3/*!*/; +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t1(word VARCHAR(20))/*!*/; +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/; +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -217,13 +225,15 @@ ROLLBACK /* added by mysqlbinlog */; --- Test 7 reading stdin w/position -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -use test; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT); +DELIMITER /*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/r/rpl_row_tabledefs_2myisam.result index 527274bf81d..700163fa3d1 100644 --- a/mysql-test/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/r/rpl_row_tabledefs_2myisam.result @@ -46,60 +46,60 @@ INSERT INTO t1_bit VALUES (1,2); INSERT INTO t1_bit VALUES (2,5); INSERT INTO t1_char VALUES (1,2); INSERT INTO t1_char VALUES (2,5); -SELECT * FROM t1_int; +SELECT * FROM t1_int ORDER BY a; a b 1 2 2 5 -SELECT * FROM t1_bit; +SELECT * FROM t1_bit ORDER BY a; a b 1 2 2 5 -SELECT * FROM t1_char; +SELECT * FROM t1_char ORDER BY a; a b 1 2 2 5 **** On Slave **** -SELECT a,b,x FROM t1_int; +SELECT a,b,x FROM t1_int ORDER BY a; a b x -2 5 4711 1 2 42 -SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit; +2 5 4711 +SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a; a b HEX(x) HEX(y) HEX(z) -2 5 5 1C 1 1 2 3 15 2 -SELECT a,b,x FROM t1_char; +2 5 5 1C 1 +SELECT a,b,x FROM t1_char ORDER BY a; a b x -2 5 Foo is a bar 1 2 Just a test +2 5 Foo is a bar **** On Master **** UPDATE t1_int SET b=2*b WHERE a=2; UPDATE t1_char SET b=2*b WHERE a=2; UPDATE t1_bit SET b=2*b WHERE a=2; -SELECT * FROM t1_int; +SELECT * FROM t1_int ORDER BY a; a b 1 2 2 10 -SELECT * FROM t1_bit; +SELECT * FROM t1_bit ORDER BY a; a b 1 2 2 10 -SELECT * FROM t1_char; +SELECT * FROM t1_char ORDER BY a; a b 1 2 2 10 **** On Slave **** -SELECT a,b,x FROM t1_int; +SELECT a,b,x FROM t1_int ORDER BY a; a b x -2 10 4711 1 2 42 -SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit; +2 10 4711 +SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a; a b HEX(x) HEX(y) HEX(z) -2 10 5 1C 1 1 2 3 15 2 -SELECT a,b,x FROM t1_char; +2 10 5 1C 1 +SELECT a,b,x FROM t1_char ORDER BY a; a b x -2 10 Foo is a bar 1 2 Just a test +2 10 Foo is a bar INSERT INTO t9 VALUES (2); INSERT INTO t1_nodef VALUES (1,2); SHOW SLAVE STATUS; @@ -327,22 +327,22 @@ Master_SSL_Key Seconds_Behind_Master # INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); -SELECT * FROM t7; +SELECT * FROM t7 ORDER BY a; a 1 2 3 -SELECT * FROM t8; +SELECT * FROM t8 ORDER BY a; a 1 2 3 -SELECT * FROM t7; +SELECT * FROM t7 ORDER BY a; a e1 e2 e3 e4 e5 e6 e7 e8 1 NULL NULL NULL NULL NULL NULL NULL NULL 2 NULL NULL NULL NULL NULL NULL NULL NULL 3 NULL NULL NULL NULL NULL NULL NULL NULL -SELECT * FROM t8; +SELECT * FROM t8 ORDER BY a; a e1 e2 e3 e4 e5 e6 e7 e8 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 @@ -358,22 +358,22 @@ INSERT INTO t1_nodef VALUES (1,2,3); INSERT INTO t1_nodef VALUES (2,4,6); **** On Master **** UPDATE t1_nodef SET b=2*b WHERE a=1; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b 1 4 2 4 **** On Slave **** -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b x 1 4 3 2 4 6 **** On Master **** DELETE FROM t1_nodef WHERE a=2; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b 1 4 **** On Slave **** -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b x 1 4 3 **** Cleanup **** diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/r/rpl_row_tabledefs_3innodb.result index df9442bfbaf..29901c51124 100644 --- a/mysql-test/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/r/rpl_row_tabledefs_3innodb.result @@ -46,60 +46,60 @@ INSERT INTO t1_bit VALUES (1,2); INSERT INTO t1_bit VALUES (2,5); INSERT INTO t1_char VALUES (1,2); INSERT INTO t1_char VALUES (2,5); -SELECT * FROM t1_int; +SELECT * FROM t1_int ORDER BY a; a b 1 2 2 5 -SELECT * FROM t1_bit; +SELECT * FROM t1_bit ORDER BY a; a b 1 2 2 5 -SELECT * FROM t1_char; +SELECT * FROM t1_char ORDER BY a; a b 1 2 2 5 **** On Slave **** -SELECT a,b,x FROM t1_int; +SELECT a,b,x FROM t1_int ORDER BY a; a b x -2 5 4711 1 2 42 -SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit; +2 5 4711 +SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a; a b HEX(x) HEX(y) HEX(z) -2 5 5 1C 1 1 2 3 15 2 -SELECT a,b,x FROM t1_char; +2 5 5 1C 1 +SELECT a,b,x FROM t1_char ORDER BY a; a b x -2 5 Foo is a bar 1 2 Just a test +2 5 Foo is a bar **** On Master **** UPDATE t1_int SET b=2*b WHERE a=2; UPDATE t1_char SET b=2*b WHERE a=2; UPDATE t1_bit SET b=2*b WHERE a=2; -SELECT * FROM t1_int; +SELECT * FROM t1_int ORDER BY a; a b 1 2 2 10 -SELECT * FROM t1_bit; +SELECT * FROM t1_bit ORDER BY a; a b 1 2 2 10 -SELECT * FROM t1_char; +SELECT * FROM t1_char ORDER BY a; a b 1 2 2 10 **** On Slave **** -SELECT a,b,x FROM t1_int; +SELECT a,b,x FROM t1_int ORDER BY a; a b x -2 10 4711 1 2 42 -SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit; +2 10 4711 +SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a; a b HEX(x) HEX(y) HEX(z) -2 10 5 1C 1 1 2 3 15 2 -SELECT a,b,x FROM t1_char; +2 10 5 1C 1 +SELECT a,b,x FROM t1_char ORDER BY a; a b x -2 10 Foo is a bar 1 2 Just a test +2 10 Foo is a bar INSERT INTO t9 VALUES (2); INSERT INTO t1_nodef VALUES (1,2); SHOW SLAVE STATUS; @@ -327,22 +327,22 @@ Master_SSL_Key Seconds_Behind_Master # INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); -SELECT * FROM t7; +SELECT * FROM t7 ORDER BY a; a 1 2 3 -SELECT * FROM t8; +SELECT * FROM t8 ORDER BY a; a 1 2 3 -SELECT * FROM t7; +SELECT * FROM t7 ORDER BY a; a e1 e2 e3 e4 e5 e6 e7 e8 1 NULL NULL NULL NULL NULL NULL NULL NULL 2 NULL NULL NULL NULL NULL NULL NULL NULL 3 NULL NULL NULL NULL NULL NULL NULL NULL -SELECT * FROM t8; +SELECT * FROM t8 ORDER BY a; a e1 e2 e3 e4 e5 e6 e7 e8 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 @@ -358,22 +358,22 @@ INSERT INTO t1_nodef VALUES (1,2,3); INSERT INTO t1_nodef VALUES (2,4,6); **** On Master **** UPDATE t1_nodef SET b=2*b WHERE a=1; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b 1 4 2 4 **** On Slave **** -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b x 1 4 3 2 4 6 **** On Master **** DELETE FROM t1_nodef WHERE a=2; -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b 1 4 **** On Slave **** -SELECT * FROM t1_nodef; +SELECT * FROM t1_nodef ORDER BY a; a b x 1 4 3 **** Cleanup **** diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 175e8b6613d..34ff77996be 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -269,6 +269,118 @@ insert into t1 values (1); select * from t1; a 1 +select * from t1; +a +1 +create procedure foo() +not deterministic +reads sql data +select * from t1; +call foo(); +a +1 +drop procedure foo; +drop function fn1; +drop database mysqltest1; +drop user "zedjzlcsjhd"@127.0.0.1; +use test; +use test; +drop function if exists f1; +create function f1() returns int reads sql data +begin +declare var integer; +declare c cursor for select a from v1; +open c; +fetch c into var; +close c; +return var; +end| +create view v1 as select 1 as a; +create table t1 (a int); +insert into t1 (a) values (f1()); +select * from t1; +a +1 +drop view v1; +drop function f1; +select * from t1; +a +1 +DROP PROCEDURE IF EXISTS p1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(col VARCHAR(10)); +CREATE PROCEDURE p1(arg VARCHAR(10)) +INSERT INTO t1 VALUES(arg); +CALL p1('test'); +SELECT * FROM t1; +col +test +SELECT * FROM t1; +col +test +DROP PROCEDURE p1; + +---> Test for BUG#20438 + +---> Preparing environment... +---> connection: master +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; + +---> Synchronizing slave with master... + +---> connection: master + +---> Creating procedure... +/*!50003 CREATE PROCEDURE p1() SET @a = 1 */; +/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */; + +---> Checking on master... +SHOW CREATE PROCEDURE p1; +Procedure sql_mode Create Procedure +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 + +---> Synchronizing slave with master... +---> connection: master + +---> Checking on slave... +SHOW CREATE PROCEDURE p1; +Procedure sql_mode Create Procedure +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 + +---> connection: master + +---> Cleaning up... +DROP PROCEDURE p1; +DROP FUNCTION f1; +drop table t1; +drop database if exists mysqltest; +drop database if exists mysqltest2; +create database mysqltest; +create database mysqltest2; +use mysqltest2; +create table t ( t integer ); +create procedure mysqltest.test() begin end; +insert into t values ( 1 ); +create procedure `\\`.test() begin end; +ERROR 42000: Unknown database '\\' +create function f1 () returns int +begin +insert into t values (1); +return 0; +end| +use mysqltest; +set @a:= mysqltest2.f1(); show binlog events in 'master-bin.000001' from 102; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest1 @@ -329,7 +441,7 @@ insert into t1 values (x); return x+2; end master-bin.000001 # Query 1 # use `mysqltest1`; delete t1,t2 from t1,t2 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(20) +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(fn1(21)) master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1 master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function fn1() @@ -362,32 +474,23 @@ begin insert into t2 values(x),(x); return 10; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(100) -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(20) +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100) +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1) master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 master-bin.000001 # Query 1 # use `mysqltest1`; drop trigger trg master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1) -select * from t1; -a -1 -create procedure foo() +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() not deterministic reads sql data -select * from t1; -call foo(); -a -1 -drop procedure foo; -drop function fn1; -drop database mysqltest1; -drop user "zedjzlcsjhd"@127.0.0.1; -use test; -use test; -drop function if exists f1; -create function f1() returns int reads sql data +select * from t1 +master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo +master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1 +master-bin.000001 # Query 1 # drop database mysqltest1 +master-bin.000001 # Query 1 # drop user "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` function f1() returns int reads sql data begin declare var integer; declare c cursor for select a from v1; @@ -395,99 +498,39 @@ open c; fetch c into var; close c; return var; -end| -create view v1 as select 1 as a; -create table t1 (a int); -insert into t1 (a) values (f1()); -select * from t1; -a -1 -drop view v1; -drop function f1; -select * from t1; -a -1 -DROP PROCEDURE IF EXISTS p1; -DROP TABLE IF EXISTS t1; -CREATE TABLE t1(col VARCHAR(10)); -CREATE PROCEDURE p1(arg VARCHAR(10)) -INSERT INTO t1 VALUES(arg); -CALL p1('test'); -SELECT * FROM t1; -col -test -SELECT * FROM t1; -col -test -DROP PROCEDURE p1; - ----> Test for BUG#20438 - ----> Preparing environment... ----> connection: master -DROP PROCEDURE IF EXISTS p1; -DROP FUNCTION IF EXISTS f1; - ----> Synchronizing slave with master... - ----> connection: master - ----> Creating procedure... -/*!50003 CREATE PROCEDURE p1() SET @a = 1 */; -/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */; - ----> Checking on master... -SHOW CREATE PROCEDURE p1; -Procedure sql_mode Create Procedure -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() -SET @a = 1 -SHOW CREATE FUNCTION f1; -Function sql_mode Create Function -f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) -RETURN 0 - ----> Synchronizing slave with master... ----> connection: master - ----> Checking on slave... -SHOW CREATE PROCEDURE p1; -Procedure sql_mode Create Procedure -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() -SET @a = 1 -SHOW CREATE FUNCTION f1; -Function sql_mode Create Function -f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) -RETURN 0 - ----> connection: master - ----> Cleaning up... -DROP PROCEDURE p1; -DROP FUNCTION f1; -drop table t1; +end +master-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a +master-bin.000001 # Query 1 # use `test`; create table t1 (a int) +master-bin.000001 # Query 1 # use `test`; insert into t1 (a) values (f1()) +master-bin.000001 # Query 1 # use `test`; drop view v1 +master-bin.000001 # Query 1 # use `test`; drop function f1 +master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t1 +master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(col VARCHAR(10)) +master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE p1(arg VARCHAR(10)) +INSERT INTO t1 VALUES(arg) +master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test')) +master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1 +master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE p1() SET @a = 1 +master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION f1() RETURNS INT RETURN 0 +master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1 +master-bin.000001 # Query 1 # use `test`; DROP FUNCTION f1 +master-bin.000001 # Query 1 # use `test`; drop table t1 +master-bin.000001 # Query 1 # drop database if exists mysqltest +master-bin.000001 # Query 1 # drop database if exists mysqltest2 +master-bin.000001 # Query 1 # create database mysqltest +master-bin.000001 # Query 1 # create database mysqltest2 +master-bin.000001 # Query 1 # use `mysqltest2`; create table t ( t integer ) +master-bin.000001 # Query 1 # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` procedure mysqltest.test() begin end +master-bin.000001 # Query 1 # use `mysqltest2`; insert into t values ( 1 ) +master-bin.000001 # Query 1 # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` function f1 () returns int +begin +insert into t values (1); +return 0; +end +master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`() set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=0; -End of 5.0 tests -reset master; -drop database if exists mysqltest; -drop database if exists mysqltest2; -create database mysqltest; -create database mysqltest2; -use mysqltest2; -create table t ( t integer ); -create procedure mysqltest.test() begin end; -insert into t values ( 1 ); -show binlog events in 'master-bin.000001' from 102; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 102 Query 1 203 drop database if exists mysqltest -master-bin.000001 203 Query 1 306 drop database if exists mysqltest2 -master-bin.000001 306 Query 1 399 create database mysqltest -master-bin.000001 399 Query 1 494 create database mysqltest2 -master-bin.000001 494 Query 1 591 use `mysqltest2`; create table t ( t integer ) -master-bin.000001 591 Query 1 730 use `mysqltest2`; CREATE DEFINER=`root`@`localhost` procedure mysqltest.test() begin end -master-bin.000001 730 Query 1 825 use `mysqltest2`; insert into t values ( 1 ) -create procedure `\\`.test() begin end; -ERROR 42000: Unknown database '\\' drop database mysqltest; drop database mysqltest2; +End of 5.0 tests End of 5.1 tests diff --git a/mysql-test/r/rpl_stm_charset.result b/mysql-test/r/rpl_stm_charset.result index 12f5b636125..f1691608bc7 100644 --- a/mysql-test/r/rpl_stm_charset.result +++ b/mysql-test/r/rpl_stm_charset.result @@ -174,86 +174,89 @@ CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET TIMESTAMP=1000000000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -drop database if exists mysqltest2; -SET TIMESTAMP=1000000000; -drop database if exists mysqltest3; -SET TIMESTAMP=1000000000; -create database mysqltest2 character set latin2; -SET TIMESTAMP=1000000000; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30; -create database mysqltest3; -SET TIMESTAMP=1000000000; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=64; -drop database mysqltest3; -SET TIMESTAMP=1000000000; -create database mysqltest3; -use mysqltest2; -SET TIMESTAMP=1000000000; -create table t1 (a int auto_increment primary key, b varchar(100)); -SET INSERT_ID=1; -SET TIMESTAMP=1000000000; -/*!\C cp850 */; -SET @@session.character_set_client=4,@@session.collation_connection=27,@@session.collation_server=64; -insert into t1 (b) values(@@character_set_server); -SET INSERT_ID=2; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(@@collation_server); -SET INSERT_ID=3; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(@@character_set_client); -SET INSERT_ID=4; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(@@character_set_connection); -SET INSERT_ID=5; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(@@collation_connection); -SET TIMESTAMP=1000000000; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=5,@@session.collation_server=64; -truncate table t1; -SET INSERT_ID=1; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(@@collation_connection); -SET INSERT_ID=2; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(LEAST("Müller","Muffler")); -SET INSERT_ID=3; -SET TIMESTAMP=1000000000; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=31,@@session.collation_server=64; -insert into t1 (b) values(@@collation_connection); -SET INSERT_ID=4; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(LEAST("Müller","Muffler")); -SET TIMESTAMP=1000000000; -truncate table t1; -SET INSERT_ID=1; -SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`; -SET TIMESTAMP=1000000000; -insert into t1 (b) values(collation(@a)); -SET TIMESTAMP=1000000000; -drop database mysqltest2; -SET TIMESTAMP=1000000000; -drop database mysqltest3; -use test; -SET TIMESTAMP=1000000000; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30; -CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); -SET TIMESTAMP=1000000000; -/*!\C koi8r */; -SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30; -INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +drop database if exists mysqltest2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +drop database if exists mysqltest3/*!*/; +SET TIMESTAMP=1000000000/*!*/; +create database mysqltest2 character set latin2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30/*!*/; +create database mysqltest3/*!*/; +SET TIMESTAMP=1000000000/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=64/*!*/; +drop database mysqltest3/*!*/; +SET TIMESTAMP=1000000000/*!*/; +create database mysqltest3/*!*/; +use mysqltest2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +create table t1 (a int auto_increment primary key, b varchar(100))/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +/*!\C cp850 *//*!*/; +SET @@session.character_set_client=4,@@session.collation_connection=27,@@session.collation_server=64/*!*/; +insert into t1 (b) values(@@character_set_server)/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(@@collation_server)/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(@@character_set_client)/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(@@character_set_connection)/*!*/; +SET INSERT_ID=5/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(@@collation_connection)/*!*/; +SET TIMESTAMP=1000000000/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=5,@@session.collation_server=64/*!*/; +truncate table t1/*!*/; +SET INSERT_ID=1/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(@@collation_connection)/*!*/; +SET INSERT_ID=2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(LEAST("Müller","Muffler"))/*!*/; +SET INSERT_ID=3/*!*/; +SET TIMESTAMP=1000000000/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=31,@@session.collation_server=64/*!*/; +insert into t1 (b) values(@@collation_connection)/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(LEAST("Müller","Muffler"))/*!*/; +SET TIMESTAMP=1000000000/*!*/; +truncate table t1/*!*/; +SET INSERT_ID=1/*!*/; +SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +insert into t1 (b) values(collation(@a))/*!*/; +SET TIMESTAMP=1000000000/*!*/; +drop database mysqltest2/*!*/; +SET TIMESTAMP=1000000000/*!*/; +drop database mysqltest3/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30/*!*/; +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))/*!*/; +SET TIMESTAMP=1000000000/*!*/; +/*!\C koi8r *//*!*/; +SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30/*!*/; +INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ')/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/r/rpl_switch_stm_row_mixed.result index 047bfe53704..258adc83b04 100644 --- a/mysql-test/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/r/rpl_switch_stm_row_mixed.result @@ -559,7 +559,7 @@ begin insert into t2 select x; return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `foo6`(_latin1'foo6_1_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) @@ -620,7 +620,7 @@ master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f`(_latin1'try_45_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1 master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) @@ -660,9 +660,9 @@ set y = (select count(*) from t2); return y; end master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f1`(_latin1'try_53_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f2`(_latin1'try_54_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row begin @@ -869,7 +869,7 @@ begin insert into t2 select x; return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `foo6`(_latin1'foo6_1_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) @@ -930,7 +930,7 @@ master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f`(_latin1'try_45_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1 master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) @@ -970,9 +970,9 @@ set y = (select count(*) from t2); return y; end master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f1`(_latin1'try_53_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f2`(_latin1'try_54_') +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row begin diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 8813d2b499f..1c50289a85d 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -13,21 +13,24 @@ master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 # User var 1 # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci master-bin.000001 # User var 1 # @`var2`=_binary 0x61 COLLATE binary master-bin.000001 # Query 1 # use `test`; insert into t1 values (@var1),(@var2) +flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; -ROLLBACK; -SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`; -use test; -SET TIMESTAMP=10000; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; -SET @@session.sql_mode=0; -/*!\C latin1 */; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; -INSERT INTO t1 VALUES(@`a b`); -SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; -SET @`var2`:=_binary 0x61 COLLATE `binary`; -SET TIMESTAMP=10000; -insert into t1 values (@var1),(@var2); +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/; +use test/*!*/; +SET TIMESTAMP=10000/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +INSERT INTO t1 VALUES(@`a b`)/*!*/; +SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`/*!*/; +SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/; +SET TIMESTAMP=10000/*!*/; +insert into t1 values (@var1),(@var2)/*!*/; +DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index f759e78adbf..ec4c7c9b2aa 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -697,6 +697,63 @@ set names latin1; select @@have_innodb; @@have_innodb # +*** Various tests with LC_TIME_NAMES +*** LC_TIME_NAMES: testing case insensitivity +set @@lc_time_names='ru_ru'; +select @@lc_time_names; +@@lc_time_names +ru_RU +*** LC_TIME_NAMES: testing with a user variable +set @lc='JA_JP'; +set @@lc_time_names=@lc; +select @@lc_time_names; +@@lc_time_names +ja_JP +*** LC_TIME_NAMES: testing with string expressions +set lc_time_names=concat('de','_','DE'); +select @@lc_time_names; +@@lc_time_names +de_DE +set lc_time_names=concat('de','+','DE'); +ERROR HY000: Unknown locale: 'de+DE' +select @@lc_time_names; +@@lc_time_names +de_DE +LC_TIME_NAMES: testing with numeric expressions +set @@lc_time_names=1+2; +select @@lc_time_names; +@@lc_time_names +sv_SE +set @@lc_time_names=1/0; +ERROR 42000: Incorrect argument type to variable 'lc_time_names' +select @@lc_time_names; +@@lc_time_names +sv_SE +set lc_time_names=en_US; +LC_TIME_NAMES: testing NULL and a negative number: +set lc_time_names=NULL; +ERROR 42000: Variable 'lc_time_names' can't be set to the value of 'NULL' +set lc_time_names=-1; +ERROR HY000: Unknown locale: '-1' +select @@lc_time_names; +@@lc_time_names +en_US +LC_TIME_NAMES: testing locale with the last ID: +set lc_time_names=108; +select @@lc_time_names; +@@lc_time_names +zh_HK +LC_TIME_NAMES: testing a number beyond the valid ID range: +set lc_time_names=109; +ERROR HY000: Unknown locale: '109' +select @@lc_time_names; +@@lc_time_names +zh_HK +LC_TIME_NAMES: testing that 0 is en_US: +set lc_time_names=0; +select @@lc_time_names; +@@lc_time_names +en_US set @test = @@query_prealloc_size; set @@query_prealloc_size = @test; select @@query_prealloc_size = @test; diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/t/binlog_row_mix_innodb_myisam.test index e04d53a2209..b131e5350af 100644 --- a/mysql-test/t/binlog_row_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_row_mix_innodb_myisam.test @@ -19,6 +19,7 @@ # we check that the error code of the "ROLLBACK" event is 0 and not # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) +flush logs; --exec $MYSQL_BINLOG --start-position=516 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select @@ -26,6 +27,6 @@ eval select is not null; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval select -@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", +@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", @a not like "%#%error_code=%error_code=%"; drop table t1, t2; diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test index cb6516a3a2f..8d7399b918e 100644 --- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test @@ -11,6 +11,7 @@ # we check that the error code of the "ROLLBACK" event is 0 and not # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) +flush logs; --exec $MYSQL_BINLOG --start-position=551 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select @@ -18,6 +19,6 @@ eval select is not null; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval select -@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", +@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", @a not like "%#%error_code=%error_code=%"; drop table t1, t2; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 804b17ab6bb..3a62ed1f7cd 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -94,6 +94,26 @@ select * from t1; drop table t1; # +# Bug#22646 LC_TIME_NAMES: Assignment to non-UTF8 target fails +# +set names utf8; +set LC_TIME_NAMES='fr_FR'; +create table t1 (s1 char(20) character set latin1); +insert into t1 values (date_format('2004-02-02','%M')); +select hex(s1) from t1; +drop table t1; +create table t1 (s1 char(20) character set koi8r); +set LC_TIME_NAMES='ru_RU'; +insert into t1 values (date_format('2004-02-02','%M')); +insert into t1 values (date_format('2004-02-02','%b')); +insert into t1 values (date_format('2004-02-02','%W')); +insert into t1 values (date_format('2004-02-02','%a')); +select hex(s1), s1 from t1; +drop table t1; +set LC_TIME_NAMES='en_US'; + + +# # Bug #2366 Wrong utf8 behaviour when data is truncated # set names koi8r; diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test index aee16595ef9..e45fea1dfad 100644 --- a/mysql-test/t/events_logs_tests.test +++ b/mysql-test/t/events_logs_tests.test @@ -72,17 +72,20 @@ SET SESSION long_query_time=1; SELECT * FROM slow_event_test; SET SESSION long_query_time=1; SET GLOBAL event_scheduler=on; +SET GLOBAL long_query_time=20; CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5); --echo "Sleep some more time than the actual event run will take" --sleep 2 SHOW VARIABLES LIKE 'event_scheduler'; --echo "Check our table. Should see 1 row" SELECT * FROM slow_event_test; ---echo "Check slow log. Should not see anything because 1.5 is under the threshold of 300 for GLOBAL, though over SESSION which is 2" +--echo "Check slow log. Should not see anything because 1.5 is under the threshold of 20 for GLOBAL, though over SESSION which is 1" +--echo "This should show that the GLOBAL value is regarded and not the SESSION one of the current connection" SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; +--echo "Another test to show that GLOBAL is regarded and not SESSION." --echo "This should go to the slow log" -DROP EVENT long_event; SET SESSION long_query_time=10; +DROP EVENT long_event; SET GLOBAL long_query_time=1; CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2); --echo "Sleep some more time than the actual event run will take" diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 8e2035f45b0..ad6a16810c5 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -133,10 +133,63 @@ flush logs; # resulted binlog, parly consisting of multi-byte utf8 chars, # must be digestable for both client and server. In 4.1 the client # should use default-character-set same as the server. +flush logs; --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL select * from t5 /* must be (1),(1) */; +# +# Bug#22645 LC_TIME_NAMES: Statement not replicated +# Check that a dump created by mysqlbinlog reproduces +# lc_time_names dependent values correctly +# +flush logs; +drop table if exists t5; +create table t5 (c1 int, c2 varchar(128) character set latin1 not null); +insert into t5 values (1, date_format('2001-01-01','%W')); +set lc_time_names=de_DE; +insert into t5 values (2, date_format('2001-01-01','%W')); +set lc_time_names=en_US; +insert into t5 values (3, date_format('2001-01-01','%W')); +select * from t5 order by c1; +flush logs; +drop table t5; +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL +select * from t5 order by c1; +# +# Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails +# +--disable_warnings +drop procedure if exists p1; +--enable_warnings +flush logs; +delimiter //; +create procedure p1() +begin +select 1; +end; +// +delimiter ;// +flush logs; +call p1(); +drop procedure p1; +--error 1305 +call p1(); +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010 | $MYSQL +call p1(); +drop procedure p1; + # clean up drop table t1, t2, t03, t04, t3, t4, t5; # End of 5.0 tests + +# +# Test --disable-force-if-open and --force-if-open +# +flush logs; +--error 1 +--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null + +# End of 5.1 tests diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 69cd5d90453..85a678055d4 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -72,6 +72,7 @@ select "--- Local with 2 binlogs on command line --" as ""; # This is to verify that some options apply only to first, or last binlog +flush logs; --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log diff --git a/mysql-test/t/mysqlbinlog_base64.test b/mysql-test/t/mysqlbinlog_base64.test index 66aaff83254..1ca018218b2 100644 --- a/mysql-test/t/mysqlbinlog_base64.test +++ b/mysql-test/t/mysqlbinlog_base64.test @@ -15,6 +15,7 @@ load data infile '../std_data_ln/words.dat' into table t2; # # Save binlog # +flush logs; --exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index b7ff8bbdfdb..d841312392d 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -713,6 +713,25 @@ create table t1 (a int); --exec $MYSQL_DUMP --skip-comments --force test t1 --where='xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 2>&1 drop table t1; +--echo # +--echo # BUG#13926: --order-by-primary fails if PKEY contains quote character +--echo # + +--disable_warnings +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a b` INT, + `c"d` INT, + `e``f` INT, + PRIMARY KEY (`a b`, `c"d`, `e``f`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t1 values (0815, 4711, 2006); + +--exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1 +--exec $MYSQL_DUMP --skip-comments --order-by-primary test t1 +DROP TABLE `t1`; +--enable_warnings + --echo End of 4.1 tests --echo # @@ -1394,28 +1413,6 @@ revoke all privileges on mysqldump_myDB.* from myDB_User@localhost; drop user myDB_User@localhost; drop database mysqldump_myDB; use test; -connection default; -disconnect root; -disconnect user1; - ---echo # ---echo # BUG#13926: --order-by-primary fails if PKEY contains quote character ---echo # - ---disable_warnings -DROP TABLE IF EXISTS `t1`; -CREATE TABLE `t1` ( - `a b` INT, - `c"d` INT, - `e``f` INT, - PRIMARY KEY (`a b`, `c"d`, `e``f`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -insert into t1 values (0815, 4711, 2006); - ---exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1 ---exec $MYSQL_DUMP --skip-comments --order-by-primary test t1 -DROP TABLE `t1`; ---enable_warnings --echo # --echo # Bug #19745: mysqldump --xml produces invalid xml diff --git a/mysql-test/t/rpl_charset_sjis.test b/mysql-test/t/rpl_charset_sjis.test new file mode 100644 index 00000000000..2469b0db8a2 --- /dev/null +++ b/mysql-test/t/rpl_charset_sjis.test @@ -0,0 +1,25 @@ +source include/have_sjis.inc; +source include/master-slave.inc; + +--disable_warnings +drop table if exists t1; +drop procedure if exists p1; +--enable_warnings +create table t1 (a varchar(255) character set sjis); +create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a); + +SET NAMES binary; +CALL p1 ('–\\'); +select "--- on master ---"; +select hex(a) from t1 ; +sync_slave_with_master; +connection slave; +select "--- on slave ---"; +select hex(a) from t1; +connection master; +drop table t1; +drop procedure p1; +sync_slave_with_master; +connection master; + +# End of 5.0 tests diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/t/rpl_do_grant.test index 4e398114269..5615900c2dd 100644 --- a/mysql-test/t/rpl_do_grant.test +++ b/mysql-test/t/rpl_do_grant.test @@ -34,6 +34,22 @@ connection slave; sync_with_master; select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; +# +# Bug#24158 SET PASSWORD in binary log fails under ANSI_QUOTES +# +connection master; +update mysql.user set password='' where user='rpl_do_grant'; +flush privileges; +select password<>'' from mysql.user where user='rpl_do_grant'; +set sql_mode='ANSI_QUOTES'; +set password for rpl_do_grant@localhost=password('does it work?'); +set sql_mode=''; +save_master_pos; +connection slave; +sync_with_master; +select password<>'' from mysql.user where user='rpl_do_grant'; + + # clear what we have done, to not influence other tests. connection master; delete from mysql.user where user=_binary'rpl_do_grant'; diff --git a/mysql-test/t/rpl_locale.test b/mysql-test/t/rpl_locale.test new file mode 100644 index 00000000000..2f2d637e1b4 --- /dev/null +++ b/mysql-test/t/rpl_locale.test @@ -0,0 +1,24 @@ +# Replication of locale variables + +source include/master-slave.inc; + +# +# Bug#22645 LC_TIME_NAMES: Statement not replicated +# +connection master; +create table t1 (s1 char(10)); +set lc_time_names= 'de_DE'; +insert into t1 values (date_format('2001-01-01','%W')); +set lc_time_names= 'en_US'; +insert into t1 values (date_format('2001-01-01','%W')); +select * from t1; +sync_slave_with_master; +connection slave; +select * from t1; +connection master; +drop table t1; +sync_slave_with_master; + +# End of 4.1 tests + + diff --git a/mysql-test/t/rpl_rbr_to_sbr.test b/mysql-test/t/rpl_rbr_to_sbr.test index 0c5368197b3..379b1edec02 100644 --- a/mysql-test/t/rpl_rbr_to_sbr.test +++ b/mysql-test/t/rpl_rbr_to_sbr.test @@ -1,4 +1,3 @@ --- source include/have_row_based.inc -- source include/have_binlog_format_mixed_or_statement.inc -- source include/not_ndb_default.inc -- source include/master-slave.inc diff --git a/mysql-test/t/rpl_row_basic_11bugs.test b/mysql-test/t/rpl_row_basic_11bugs.test index 37bfd01e260..5b28af75d33 100644 --- a/mysql-test/t/rpl_row_basic_11bugs.test +++ b/mysql-test/t/rpl_row_basic_11bugs.test @@ -1,4 +1,3 @@ ---source include/have_row_based.inc --source include/have_binlog_format_row.inc diff --git a/mysql-test/t/rpl_row_basic_8partition.test b/mysql-test/t/rpl_row_basic_8partition.test index f262ef05c58..687b3bc785d 100644 --- a/mysql-test/t/rpl_row_basic_8partition.test +++ b/mysql-test/t/rpl_row_basic_8partition.test @@ -7,7 +7,6 @@ # partition tables with same engine (MyISAM) in both ends. # ############################################################ ---source include/have_row_based.inc --source include/have_binlog_format_row.inc --source include/have_partition.inc --source include/not_ndb_default.inc diff --git a/mysql-test/t/rpl_row_create_table-slave.opt b/mysql-test/t/rpl_row_create_table-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_row_create_table-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test index 3a711e5b496..6accf0c8bef 100644 --- a/mysql-test/t/rpl_row_create_table.test +++ b/mysql-test/t/rpl_row_create_table.test @@ -2,6 +2,10 @@ --source include/have_binlog_format_row.inc --source include/master-slave.inc +--source include/have_innodb.inc +connection slave; +--source include/have_innodb.inc +connection master; # Bug#18326: Do not lock table for writing during prepare of statement # The use of the ps protocol causes extra table maps in the binlog, so @@ -31,7 +35,7 @@ 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; --replace_column 1 # 4 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --query_vertical SHOW BINLOG EVENTS FROM 212 --echo **** On Master **** --query_vertical SHOW CREATE TABLE t1 @@ -66,8 +70,8 @@ connection master; --error 1062 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; # Shouldn't be written to the binary log ---replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1256; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ +SHOW BINLOG EVENTS FROM 1118; # Test that INSERT-SELECT works the same way as for SBR. CREATE TABLE t7 (a INT, b INT UNIQUE); @@ -75,7 +79,7 @@ CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log ---replace_regex /table_id: [0-9]+/table_id: #/ +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS FROM 1118; sync_slave_with_master; SELECT * FROM t7 ORDER BY a,b; @@ -86,7 +90,7 @@ INSERT INTO tt4 VALUES (4,8), (5,10), (6,12); BEGIN; INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; ---replace_regex /table_id: [0-9]+/table_id: #/ +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS FROM 1314; SELECT * FROM t7 ORDER BY a,b; sync_slave_with_master; @@ -101,7 +105,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1; --echo **** On Master **** --query_vertical SHOW CREATE TABLE t8 --query_vertical SHOW CREATE TABLE t9 ---replace_regex /table_id: [0-9]+/table_id: #/ +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS FROM 1410; sync_slave_with_master; --echo **** On Slave **** @@ -109,12 +113,117 @@ sync_slave_with_master; --query_vertical SHOW CREATE TABLE t9 connection master; ---disable_query_log DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; sync_slave_with_master; # Here we reset the value of the default storage engine STOP SLAVE; SET GLOBAL storage_engine=@storage_engine; START SLAVE; ---enable_query_log --enable_ps_protocol + +# BUG#22864 (Rollback following CREATE ... SELECT discards 'CREATE +# table' from log): +--echo ================ BUG#22864 ================ +connection slave; +STOP SLAVE; +RESET SLAVE; +connection master; +RESET MASTER; +connection slave; +START SLAVE; +connection master; +SET AUTOCOMMIT=0; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); + +CREATE TABLE t2 ENGINE=INNODB SELECT * FROM t1; +ROLLBACK; + +CREATE TABLE t3 ENGINE=INNODB SELECT * FROM t1; +INSERT INTO t3 VALUES (4),(5),(6); +ROLLBACK; + +CREATE TABLE t4 ENGINE=INNODB SELECT * FROM t1; +INSERT INTO t1 VALUES (4),(5),(6); +ROLLBACK; + +SHOW TABLES; +SELECT TABLE_NAME,ENGINE + FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_NAME LIKE 't_' +ORDER BY TABLE_NAME; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +SELECT * FROM t3 ORDER BY a; +SELECT * FROM t4 ORDER BY a; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ +SHOW BINLOG EVENTS; +sync_slave_with_master; +SHOW TABLES; +SELECT TABLE_NAME,ENGINE + FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_NAME LIKE 't_' +ORDER BY TABLE_NAME; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +SELECT * FROM t3 ORDER BY a; +SELECT * FROM t4 ORDER BY a; + +connection master; +DROP TABLE IF EXISTS t1,t2,t3,t4; +SET AUTOCOMMIT=1; +sync_slave_with_master; + +# Some tests with temporary tables +connection slave; +STOP SLAVE; +RESET SLAVE; + +connection master; +RESET MASTER; + +connection slave; +START SLAVE; + +connection master; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); + +CREATE TABLE t2 (a INT) ENGINE=INNODB; + +BEGIN; +INSERT INTO t2 SELECT a*a FROM t1; +CREATE TEMPORARY TABLE tt1 +SELECT a+1 AS a + FROM t1 + WHERE a MOD 2 = 1; +INSERT INTO t2 SELECT a+2 FROM tt1; +COMMIT; + +SELECT * FROM t2 ORDER BY a; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ +SHOW BINLOG EVENTS; +sync_slave_with_master; +SELECT * FROM t2 ORDER BY a; + +connection master; +TRUNCATE TABLE t2; + +BEGIN; +INSERT INTO t2 SELECT a*a FROM t1; +CREATE TEMPORARY TABLE tt2 +SELECT a+1 AS a + FROM t1 + WHERE a MOD 2 = 1; +INSERT INTO t2 SELECT a+2 FROM tt2; +ROLLBACK; + +SELECT * FROM t2 ORDER BY a; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ +SHOW BINLOG EVENTS FROM 627; +sync_slave_with_master; +SELECT * FROM t2 ORDER BY a; + +connection master; +DROP TABLE t1,t2; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_row_max_relay_size.test b/mysql-test/t/rpl_row_max_relay_size.test index eb3f63db8aa..a0be59e44a7 100644 --- a/mysql-test/t/rpl_row_max_relay_size.test +++ b/mysql-test/t/rpl_row_max_relay_size.test @@ -5,7 +5,6 @@ # Requires statement logging -- source include/not_ndb_default.inc --- source include/have_row_based.inc SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; -- source extra/rpl_tests/rpl_max_relay_size.test diff --git a/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt b/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index 3a93a6608cd..9a1960db647 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -343,13 +343,13 @@ delete from t1; drop trigger trg; insert into t1 values (1); select * from t1; ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events in 'master-bin.000001' from 102; sync_slave_with_master; select * from t1; +# ********************** PART 4 : RELATED FIXED BUGS *************** + + # # Test for bug #13969 "Routines which are replicated from master can't be # executed on slave". @@ -522,17 +522,11 @@ connection master; drop table t1; sync_slave_with_master; -# Restore log_bin_trust_function_creators to original value -set global log_bin_trust_function_creators=0; -connection master; -set global log_bin_trust_function_creators=0; ---echo End of 5.0 tests - # # Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS" # + connection master; -reset master; --disable_warnings drop database if exists mysqltest; drop database if exists mysqltest2; @@ -543,12 +537,49 @@ use mysqltest2; create table t ( t integer ); create procedure mysqltest.test() begin end; insert into t values ( 1 ); -show binlog events in 'master-bin.000001' from 102; --error ER_BAD_DB_ERROR create procedure `\\`.test() begin end; + +# +# BUG#19725: Calls to stored function in other database are not +# replicated correctly in some cases +# + +connection master; +delimiter |; +create function f1 () returns int +begin + insert into t values (1); + return 0; +end| +delimiter ;| +sync_slave_with_master; +# Let us test if we don't forget to binlog the function's database +connection master; +use mysqltest; +set @a:= mysqltest2.f1(); +sync_slave_with_master; +connection master; + + +# Final inspection which verifies how all statements of this test file +# were written to the binary log. +--replace_column 2 # 5 # +--replace_regex /table_id: [0-9]+/table_id: #/ +show binlog events in 'master-bin.000001' from 102; + + +# Restore log_bin_trust_function_creators to its original value. +# This is a cleanup for all parts above where we tested stored +# functions and triggers. +set global log_bin_trust_function_creators=0; +connection master; +set global log_bin_trust_function_creators=0; + # Clean up drop database mysqltest; drop database mysqltest2; +--echo End of 5.0 tests --echo End of 5.1 tests diff --git a/mysql-test/t/rpl_switch_stm_row_mixed.test b/mysql-test/t/rpl_switch_stm_row_mixed.test index d345b62b8eb..ccd505941c8 100644 --- a/mysql-test/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/t/rpl_switch_stm_row_mixed.test @@ -1,4 +1,3 @@ --- source include/have_row_based.inc -- source include/not_ndb_default.inc -- source include/master-slave.inc diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index 6615e48ca42..ce1a476eb43 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -20,6 +20,7 @@ show binlog events from 102; # absolutely need variables names to be quoted and strings to be # escaped). --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +flush logs; --exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 drop table t1; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 7cbc7ee153b..4f91b75ced1 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -497,6 +497,50 @@ set names latin1; select @@have_innodb; # +# Tests for lc_time_names +# Note, when adding new locales, please fix ID accordingly: +# - to test the last ID (currently 108) +# - and the next after the last (currently 109) +# +--echo *** Various tests with LC_TIME_NAMES +--echo *** LC_TIME_NAMES: testing case insensitivity +set @@lc_time_names='ru_ru'; +select @@lc_time_names; +--echo *** LC_TIME_NAMES: testing with a user variable +set @lc='JA_JP'; +set @@lc_time_names=@lc; +select @@lc_time_names; +--echo *** LC_TIME_NAMES: testing with string expressions +set lc_time_names=concat('de','_','DE'); +select @@lc_time_names; +--error 1105 +set lc_time_names=concat('de','+','DE'); +select @@lc_time_names; +--echo LC_TIME_NAMES: testing with numeric expressions +set @@lc_time_names=1+2; +select @@lc_time_names; +--error 1232 +set @@lc_time_names=1/0; +select @@lc_time_names; +set lc_time_names=en_US; +--echo LC_TIME_NAMES: testing NULL and a negative number: +--error 1231 +set lc_time_names=NULL; +--error 1105 +set lc_time_names=-1; +select @@lc_time_names; +--echo LC_TIME_NAMES: testing locale with the last ID: +set lc_time_names=108; +select @@lc_time_names; +--echo LC_TIME_NAMES: testing a number beyond the valid ID range: +--error 1105 +set lc_time_names=109; +select @@lc_time_names; +--echo LC_TIME_NAMES: testing that 0 is en_US: +set lc_time_names=0; +select @@lc_time_names; + +# # Bug #13334: query_prealloc_size default less than minimum # set @test = @@query_prealloc_size; diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index d83aa95b0ef..853a2761224 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -46,6 +46,23 @@ pthread_mutexattr_t my_fast_mutexattr; pthread_mutexattr_t my_errorcheck_mutexattr; #endif +#ifdef NPTL_PTHREAD_EXIT_BUG /* see my_pthread.h */ + +/* + Dummy thread spawned in my_thread_global_init() below to avoid + race conditions in NPTL pthread_exit code. +*/ + +static +pthread_handler_t nptl_pthread_exit_hack_handler(void *arg) +{ + /* Do nothing! */ + pthread_exit(0); + return 0; +} + +#endif + /* initialize thread environment @@ -64,6 +81,28 @@ my_bool my_thread_global_init(void) fprintf(stderr,"Can't initialize threads: error %d\n",errno); return 1; } + +#ifdef NPTL_PTHREAD_EXIT_BUG + +/* + BUG#24507: Race conditions inside current NPTL pthread_exit() implementation. + + To avoid a possible segmentation fault during concurrent executions of + pthread_exit(), a dummy thread is spawned which initializes internal variables + of pthread lib. See bug description for thoroughfull explanation. + + TODO: Remove this code when fixed versions of glibc6 are in common use. +*/ + + pthread_t dummy_thread; + pthread_attr_t dummy_thread_attr; + + pthread_attr_init(&dummy_thread_attr); + pthread_attr_setdetachstate(&dummy_thread_attr,PTHREAD_CREATE_DETACHED); + + pthread_create(&dummy_thread,&dummy_thread_attr,nptl_pthread_exit_hack_handler,NULL); + +#endif #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP /* diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 5593231b34a..f6efd7c2510 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -37,8 +37,7 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc ${PROJECT_SOURCE_DIR}/include/sql_state.h PROPERTIES GENERATED 1) -ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER - -D_CONSOLE -DHAVE_DLOPEN) +ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN) ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc diff --git a/sql/field.cc b/sql/field.cc index ef084367d32..3bea4e9c0fb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8524,10 +8524,12 @@ const char *Field_bit::unpack(char *to, const char *from) void Field_bit::set_default() { - my_ptrdiff_t const offset= (my_ptrdiff_t) (table->s->default_values - - table->record[0]); - uchar bits= (uchar) get_rec_bits(bit_ptr + offset, bit_ofs, bit_len); - set_rec_bits(bits, bit_ptr, bit_ofs, bit_len); + if (bit_len > 0) + { + my_ptrdiff_t const offset= table->s->default_values - table->record[0]; + uchar bits= get_rec_bits(bit_ptr + offset, bit_ofs, bit_len); + set_rec_bits(bits, bit_ptr, bit_ofs, bit_len); + } Field::set_default(); } diff --git a/sql/field.h b/sql/field.h index bf68c37aec3..ed6dd733372 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1503,6 +1503,13 @@ private: }; +/** + BIT field represented as chars for non-MyISAM tables. + + @todo The inheritance relationship is backwards since Field_bit is + an extended version of Field_bit_as_char and not the other way + around. Hence, we should refactor it to fix the hierarchy order. + */ class Field_bit_as_char: public Field_bit { public: Field_bit_as_char(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, diff --git a/sql/handler.cc b/sql/handler.cc index e0955132998..78b1828cf97 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3458,7 +3458,6 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) - table is not mysql.event */ -#ifdef HAVE_ROW_BASED_REPLICATION /* The Sun compiler cannot instantiate the template below if this is declared static, but it works by putting it into an anonymous namespace. */ @@ -3613,7 +3612,6 @@ namespace binlog_log_row<Update_rows_log_event>(TABLE *, const byte *, const byte *); } -#endif /* HAVE_ROW_BASED_REPLICATION */ int handler::ha_external_lock(THD *thd, int lock_type) { @@ -3654,10 +3652,8 @@ int handler::ha_write_row(byte *buf) int error; if (unlikely(error= write_row(buf))) return error; -#ifdef HAVE_ROW_BASED_REPLICATION if (unlikely(error= binlog_log_row<Write_rows_log_event>(table, 0, buf))) return error; -#endif return 0; } @@ -3673,10 +3669,8 @@ int handler::ha_update_row(const byte *old_data, byte *new_data) if (unlikely(error= update_row(old_data, new_data))) return error; -#ifdef HAVE_ROW_BASED_REPLICATION if (unlikely(error= binlog_log_row<Update_rows_log_event>(table, old_data, new_data))) return error; -#endif return 0; } @@ -3685,10 +3679,8 @@ int handler::ha_delete_row(const byte *buf) int error; if (unlikely(error= delete_row(buf))) return error; -#ifdef HAVE_ROW_BASED_REPLICATION if (unlikely(error= binlog_log_row<Delete_rows_log_event>(table, buf, 0))) return error; -#endif return 0; } diff --git a/sql/item_create.cc b/sql/item_create.cc index b7656fc8c4f..ff5825ef389 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -2341,9 +2341,7 @@ Create_udf_func::create(THD *thd, udf_func *udf, List<Item> *item_list) if (item_list != NULL) arg_count= item_list->elements; -#ifdef HAVE_ROW_BASED_REPLICATION thd->lex->binlog_row_based_if_mixed= TRUE; -#endif DBUG_ASSERT( (udf->type == UDFTYPE_FUNCTION) || (udf->type == UDFTYPE_AGGREGATE)); @@ -4532,9 +4530,7 @@ Create_func_uuid Create_func_uuid::s_singleton; Item* Create_func_uuid::create(THD *thd) { -#ifdef HAVE_ROW_BASED_REPLICATION thd->lex->binlog_row_based_if_mixed= TRUE; -#endif return new (thd->mem_root) Item_func_uuid(); } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 8fb0549fb94..faeef7fd5db 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -608,16 +608,10 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, uint weekday; ulong length; const char *ptr, *end; - MY_LOCALE *locale; THD *thd= current_thd; - char buf[STRING_BUFFER_USUAL_SIZE]; - String tmp(buf, sizeof(buf), thd->variables.character_set_results); - uint errors= 0; + MY_LOCALE *locale= thd->variables.lc_time_names; - tmp.length(0); str->length(0); - str->set_charset(&my_charset_bin); - locale = thd->variables.lc_time_names; if (l_time->neg) str->append('-'); @@ -631,41 +625,37 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, { switch (*++ptr) { case 'M': - if (!l_time->month) - return 1; - tmp.copy(locale->month_names->type_names[l_time->month-1], - strlen(locale->month_names->type_names[l_time->month-1]), - system_charset_info, tmp.charset(), &errors); - str->append(tmp.ptr(), tmp.length()); - break; + if (!l_time->month) + return 1; + str->append(locale->month_names->type_names[l_time->month-1], + strlen(locale->month_names->type_names[l_time->month-1]), + system_charset_info); + break; case 'b': - if (!l_time->month) - return 1; - tmp.copy(locale->ab_month_names->type_names[l_time->month-1], - strlen(locale->ab_month_names->type_names[l_time->month-1]), - system_charset_info, tmp.charset(), &errors); - str->append(tmp.ptr(), tmp.length()); - break; + if (!l_time->month) + return 1; + str->append(locale->ab_month_names->type_names[l_time->month-1], + strlen(locale->ab_month_names->type_names[l_time->month-1]), + system_charset_info); + break; case 'W': - if (type == MYSQL_TIMESTAMP_TIME) - return 1; - weekday= calc_weekday(calc_daynr(l_time->year,l_time->month, - l_time->day),0); - tmp.copy(locale->day_names->type_names[weekday], - strlen(locale->day_names->type_names[weekday]), - system_charset_info, tmp.charset(), &errors); - str->append(tmp.ptr(), tmp.length()); - break; + if (type == MYSQL_TIMESTAMP_TIME) + return 1; + weekday= calc_weekday(calc_daynr(l_time->year,l_time->month, + l_time->day),0); + str->append(locale->day_names->type_names[weekday], + strlen(locale->day_names->type_names[weekday]), + system_charset_info); + break; case 'a': - if (type == MYSQL_TIMESTAMP_TIME) - return 1; - weekday=calc_weekday(calc_daynr(l_time->year,l_time->month, - l_time->day),0); - tmp.copy(locale->ab_day_names->type_names[weekday], - strlen(locale->ab_day_names->type_names[weekday]), - system_charset_info, tmp.charset(), &errors); - str->append(tmp.ptr(), tmp.length()); - break; + if (type == MYSQL_TIMESTAMP_TIME) + return 1; + weekday=calc_weekday(calc_daynr(l_time->year,l_time->month, + l_time->day),0); + str->append(locale->ab_day_names->type_names[weekday], + strlen(locale->ab_day_names->type_names[weekday]), + system_charset_info); + break; case 'D': if (type == MYSQL_TIMESTAMP_TIME) return 1; @@ -1688,6 +1678,7 @@ longlong Item_func_sec_to_time::val_int() void Item_func_date_format::fix_length_and_dec() { + THD* thd= current_thd; /* Must use this_item() in case it's a local SP variable (for ->max_length and ->str_value) @@ -1695,22 +1686,18 @@ void Item_func_date_format::fix_length_and_dec() Item *arg1= args[1]->this_item(); decimals=0; - collation.set(&my_charset_bin); + collation.set(thd->variables.collation_connection); if (arg1->type() == STRING_ITEM) { // Optimize the normal case fixed_length=1; - - /* - The result is a binary string (no reason to use collation->mbmaxlen - This is becasue make_date_time() only returns binary strings - */ - max_length= format_length(&arg1->str_value); + max_length= format_length(&arg1->str_value) * + collation.collation->mbmaxlen; } else { fixed_length=0; - /* The result is a binary string (no reason to use collation->mbmaxlen */ - max_length=min(arg1->max_length, MAX_BLOB_WIDTH) * 10; + max_length=min(arg1->max_length, MAX_BLOB_WIDTH) * 10 * + collation.collation->mbmaxlen; set_if_smaller(max_length,MAX_BLOB_WIDTH); } maybe_null=1; // If wrong date @@ -1855,6 +1842,7 @@ String *Item_func_date_format::val_str(String *str) date_time_format.format.length= format->length(); /* Create the result string */ + str->set_charset(collation.collation); if (!make_date_time(&date_time_format, &l_time, is_time_format ? MYSQL_TIMESTAMP_TIME : MYSQL_TIMESTAMP_DATE, diff --git a/sql/log.cc b/sql/log.cc index 150c4a58c63..1b432ca15c0 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -81,23 +81,54 @@ char *make_default_log_name(char *buff,const char* log_ext) } /* + Helper class to hold a mutex for the duration of the + block. + + Eliminates the need for explicit unlocking of mutexes on, e.g., + error returns. On passing a null pointer, the sentry will not do + anything. + */ +class Mutex_sentry +{ +public: + Mutex_sentry(pthread_mutex_t *mutex) + : m_mutex(mutex) + { + if (m_mutex) + pthread_mutex_lock(mutex); + } + + ~Mutex_sentry() + { + if (m_mutex) + pthread_mutex_unlock(m_mutex); +#ifndef DBUG_OFF + m_mutex= 0; +#endif + } + +private: + pthread_mutex_t *m_mutex; + + // It's not allowed to copy this object in any way + Mutex_sentry(Mutex_sentry const&); + void operator=(Mutex_sentry const&); +}; + +/* Helper class to store binary log transaction data. */ class binlog_trx_data { public: binlog_trx_data() -#ifdef HAVE_ROW_BASED_REPLICATION : m_pending(0), before_stmt_pos(MY_OFF_T_UNDEF) -#endif { trans_log.end_of_file= max_binlog_cache_size; } ~binlog_trx_data() { -#ifdef HAVE_ROW_BASED_REPLICATION DBUG_ASSERT(pending() == NULL); -#endif close_cached_file(&trans_log); } @@ -107,11 +138,7 @@ public: bool empty() const { -#ifdef HAVE_ROW_BASED_REPLICATION return pending() == NULL && my_b_tell(&trans_log) == 0; -#else - return my_b_tell(&trans_log) == 0; -#endif } /* @@ -120,11 +147,13 @@ public: */ void truncate(my_off_t pos) { -#ifdef HAVE_ROW_BASED_REPLICATION + DBUG_PRINT("info", ("truncating to position %lu", pos)); + DBUG_PRINT("info", ("before_stmt_pos=%lu", pos)); delete pending(); set_pending(0); -#endif reinit_io_cache(&trans_log, WRITE_CACHE, pos, 0, 0); + if (pos < before_stmt_pos) + before_stmt_pos= MY_OFF_T_UNDEF; } /* @@ -134,13 +163,10 @@ public: void reset() { if (!empty()) truncate(0); -#ifdef HAVE_ROW_BASED_REPLICATION before_stmt_pos= MY_OFF_T_UNDEF; -#endif trans_log.end_of_file= max_binlog_cache_size; } -#ifdef HAVE_ROW_BASED_REPLICATION Rows_log_event *pending() const { return m_pending; @@ -150,12 +176,10 @@ public: { m_pending= pending; } -#endif IO_CACHE trans_log; // The transaction cache private: -#ifdef HAVE_ROW_BASED_REPLICATION /* Pending binrows event. This event is the event where the rows are currently written. @@ -167,7 +191,6 @@ public: Binlog position before the start of the current statement. */ my_off_t before_stmt_pos; -#endif }; handlerton *binlog_hton; @@ -1467,9 +1490,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, were, we would have to ensure that we're not ending a statement inside a stored function. */ -#ifdef HAVE_ROW_BASED_REPLICATION thd->binlog_flush_pending_rows_event(TRUE); -#endif /* We write the transaction cache to the binary log if either we're committing the entire transaction, or if we are doing an @@ -1479,13 +1500,11 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, { error= mysql_bin_log.write(thd, &trx_data->trans_log, end_ev); trx_data->reset(); -#ifdef HAVE_ROW_BASED_REPLICATION /* We need to step the table map version after writing the transaction cache to disk. */ mysql_bin_log.update_table_map_version(); -#endif statistic_increment(binlog_cache_use, &LOCK_status); if (trans_log->disk_writes != 0) { @@ -1494,7 +1513,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, } } } -#ifdef HAVE_ROW_BASED_REPLICATION else { /* @@ -1503,12 +1521,11 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, If rolling back a statement in a transaction, we truncate the transaction cache to remove the statement. - */ if (all || !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) trx_data->reset(); - else - trx_data->truncate(trx_data->before_stmt_pos); // ...statement + else // ...statement + trx_data->truncate(trx_data->before_stmt_pos); /* We need to step the table map version on a rollback to ensure @@ -1517,7 +1534,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, */ mysql_bin_log.update_table_map_version(); } -#endif DBUG_RETURN(error); } @@ -2096,7 +2112,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host, if (my_b_write(&log_file, (byte*) "\t\t" ,2) < 0) goto err; - /* command_type, thread_id */ + /* command_type, thread_id */ length= my_snprintf(buff, 32, "%5ld ", (long) thread_id); if (my_b_write(&log_file, (byte*) buff, length)) @@ -3395,7 +3411,6 @@ int THD::binlog_setup_trx_data() DBUG_RETURN(0); } -#ifdef HAVE_ROW_BASED_REPLICATION /* Function to start a statement and optionally a transaction for the binary log. @@ -3437,18 +3452,7 @@ THD::binlog_start_trans_and_stmt() if (trx_data == NULL || trx_data->before_stmt_pos == MY_OFF_T_UNDEF) { - /* - The call to binlog_trans_log_savepos() might create the trx_data - structure, if it didn't exist before, so we save the position - into an auto variable and then write it into the transaction - data for the binary log (i.e., trx_data). - */ - my_off_t pos= 0; - binlog_trans_log_savepos(this, &pos); - trx_data= (binlog_trx_data*) ha_data[binlog_hton->slot]; - - trx_data->before_stmt_pos= pos; - + this->binlog_set_stmt_begin(); if (options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) trans_register_ha(this, TRUE, binlog_hton); trans_register_ha(this, FALSE, binlog_hton); @@ -3456,6 +3460,51 @@ THD::binlog_start_trans_and_stmt() DBUG_VOID_RETURN; } +void THD::binlog_set_stmt_begin() { + binlog_trx_data *trx_data= + (binlog_trx_data*) ha_data[binlog_hton->slot]; + + /* + The call to binlog_trans_log_savepos() might create the trx_data + structure, if it didn't exist before, so we save the position + into an auto variable and then write it into the transaction + data for the binary log (i.e., trx_data). + */ + my_off_t pos= 0; + binlog_trans_log_savepos(this, &pos); + trx_data= (binlog_trx_data*) ha_data[binlog_hton->slot]; + trx_data->before_stmt_pos= pos; +} + +int THD::binlog_flush_transaction_cache() +{ + DBUG_ENTER("binlog_flush_transaction_cache"); + binlog_trx_data *trx_data= (binlog_trx_data*) ha_data[binlog_hton->slot]; + DBUG_PRINT("enter", ("trx_data=0x%lu", trx_data)); + if (trx_data) + DBUG_PRINT("enter", ("trx_data->before_stmt_pos=%u", + trx_data->before_stmt_pos)); + + /* + Write the transaction cache to the binary log. We don't flush and + sync the log file since we don't know if more will be written to + it. If the caller want the log file sync:ed, the caller has to do + it. + + The transaction data is only reset upon a successful write of the + cache to the binary log. + */ + + if (trx_data && likely(mysql_bin_log.is_open())) { + if (int error= mysql_bin_log.write_cache(&trx_data->trans_log, true, true)) + DBUG_RETURN(error); + trx_data->reset(); + } + + DBUG_RETURN(0); +} + + /* Write a table map to the binary log. */ @@ -3604,7 +3653,6 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd, DBUG_RETURN(error); } -#endif /*HAVE_ROW_BASED_REPLICATION*/ /* Write an event to the binary log @@ -3637,11 +3685,9 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) we are inside a stored function, we do not end the statement since this will close all tables on the slave. */ -#ifdef HAVE_ROW_BASED_REPLICATION bool const end_stmt= thd->prelocked_mode && thd->lex->requires_prelocking(); thd->binlog_flush_pending_rows_event(end_stmt); -#endif /*HAVE_ROW_BASED_REPLICATION*/ pthread_mutex_lock(&LOCK_log); @@ -3671,7 +3717,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) } #endif /* HAVE_REPLICATION */ -#if defined(USING_TRANSACTIONS) && defined(HAVE_ROW_BASED_REPLICATION) +#if defined(USING_TRANSACTIONS) /* Should we write to the binlog cache or to the binlog on disk? Write to the binlog cache if: @@ -3706,7 +3752,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) LOCK_log. */ } -#endif /* USING_TRANSACTIONS && HAVE_ROW_BASED_REPLICATION */ +#endif /* USING_TRANSACTIONS */ DBUG_PRINT("info",("event type: %d",event_info->get_type_code())); /* @@ -3869,12 +3915,48 @@ uint MYSQL_BIN_LOG::next_file_id() /* + Write the contents of a cache to the binary log. + + SYNOPSIS + write_cache() + cache Cache to write to the binary log + lock_log True if the LOCK_log mutex should be aquired, false otherwise + sync_log True if the log should be flushed and sync:ed + + DESCRIPTION + Write the contents of the cache to the binary log. The cache will + be reset as a READ_CACHE to be able to read the contents from it. + */ + +int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log) +{ + Mutex_sentry sentry(lock_log ? &LOCK_log : NULL); + + if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) + return ER_ERROR_ON_WRITE; + uint bytes= my_b_bytes_in_cache(cache); + do + { + if (my_b_write(&log_file, cache->read_pos, bytes)) + return ER_ERROR_ON_WRITE; + cache->read_pos= cache->read_end; + } while ((bytes= my_b_fill(cache))); + + if (sync_log) + flush_and_sync(); + + return 0; // All OK +} + +/* Write a cached log entry to the binary log SYNOPSIS write() thd cache The cache to copy to the binlog + commit_event The commit event to print after writing the + contents of the cache. NOTE - We only come here if there is something in the cache. @@ -3934,20 +4016,10 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) if (qinfo.write(&log_file)) goto err; } - /* Read from the file used to cache the queries .*/ - if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) - goto err; - length=my_b_bytes_in_cache(cache); - DBUG_EXECUTE_IF("half_binlogged_transaction", length-=100;); - do - { - /* Write data to the binary log file */ - if (my_b_write(&log_file, cache->read_pos, length)) - goto err; - cache->read_pos=cache->read_end; // Mark buffer used up - DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;); - } while ((length=my_b_fill(cache))); + if ((write_error= write_cache(cache, false, false))) + goto err; + if (commit_event && commit_event->write(&log_file)) goto err; #ifndef DBUG_OFF diff --git a/sql/log.h b/sql/log.h index 13795f30647..61db7052f75 100644 --- a/sql/log.h +++ b/sql/log.h @@ -339,6 +339,8 @@ public: bool write(Log_event* event_info); // binary log write bool write(THD *thd, IO_CACHE *cache, Log_event *commit_event); + int write_cache(IO_CACHE *cache, bool lock_log, bool flush_and_sync); + void start_union_events(THD *thd); void stop_union_events(THD *thd); bool is_query_in_union(THD *thd, query_id_t query_id_param); @@ -602,14 +604,12 @@ public: enum enum_binlog_format { BINLOG_FORMAT_STMT= 0, // statement-based -#ifdef HAVE_ROW_BASED_REPLICATION BINLOG_FORMAT_ROW= 1, // row_based /* statement-based except for cases where only row-based can work (UUID() etc): */ BINLOG_FORMAT_MIXED= 2, -#endif /* This value is last, after the end of binlog_format_typelib: it has no corresponding cell in this typelib. We use this value to be able to know if diff --git a/sql/log_event.cc b/sql/log_event.cc index d93845603fd..d65b20f4b72 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -372,7 +372,7 @@ append_query_string(CHARSET_INFO *csinfo, else { *ptr++= '\''; - ptr+= escape_string_for_mysql(from->charset(), ptr, 0, + ptr+= escape_string_for_mysql(csinfo, ptr, 0, from->ptr(), from->length()); *ptr++='\''; } @@ -993,7 +993,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, case FORMAT_DESCRIPTION_EVENT: ev = new Format_description_log_event(buf, event_len, description_event); break; -#if defined(HAVE_REPLICATION) && defined(HAVE_ROW_BASED_REPLICATION) +#if defined(HAVE_REPLICATION) case WRITE_ROWS_EVENT: ev = new Write_rows_log_event(buf, event_len, description_event); break; @@ -1182,7 +1182,7 @@ void Log_event::print_base64(IO_CACHE* file, my_b_printf(file, "%s\n", tmp_str); if (!more) - my_b_printf(file, "';\n"); + my_b_printf(file, "'%s\n", print_event_info->delimiter); my_free(tmp_str, MYF(0)); DBUG_VOID_RETURN; @@ -1288,7 +1288,8 @@ bool Query_log_event::write(IO_CACHE* file) 1+1+FN_REFLEN+ // code of catalog and catalog length and catalog 1+4+ // code of autoinc and the 2 autoinc variables 1+6+ // code of charset and charset - 1+1+MAX_TIME_ZONE_NAME_LENGTH // code of tz and tz length and tz name + 1+1+MAX_TIME_ZONE_NAME_LENGTH+ // code of tz and tz length and tz name + 1+2 // code of lc_time_names and lc_time_names_number ], *start, *start_of_status; ulong event_length; @@ -1400,6 +1401,13 @@ bool Query_log_event::write(IO_CACHE* file) memcpy(start, time_zone_str, time_zone_len); start+= time_zone_len; } + if (lc_time_names_number) + { + DBUG_ASSERT(lc_time_names_number <= 0xFFFF); + *start++= Q_LC_TIME_NAMES_CODE; + int2store(start, lc_time_names_number); + start+= 2; + } /* Here there could be code like if (command-line-option-which-says-"log_this_variable" && inited) @@ -1464,7 +1472,8 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, flags2_inited(1), sql_mode_inited(1), charset_inited(1), sql_mode(thd_arg->variables.sql_mode), auto_increment_increment(thd_arg->variables.auto_increment_increment), - auto_increment_offset(thd_arg->variables.auto_increment_offset) + auto_increment_offset(thd_arg->variables.auto_increment_offset), + lc_time_names_number(thd_arg->variables.lc_time_names->number) { time_t end_time; time(&end_time); @@ -1506,18 +1515,27 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, /* 2 utility functions for the next method */ -static void get_str_len_and_pointer(const char **dst, const char **src, uint *len) + +/* + Get the pointer for a string (src) that contains the length in + the first byte. Set the output string (dst) to the string value + and place the length of the string in the byte after the string. +*/ +static void get_str_len_and_pointer(const Log_event::Byte **src, + const char **dst, + uint *len) { if ((*len= **src)) - *dst= *src + 1; // Will be copied later - (*src)+= *len+1; + *dst= (char *)*src + 1; // Will be copied later + (*src)+= *len + 1; } - -static void copy_str_and_move(char **dst, const char **src, uint len) +static void copy_str_and_move(const char **src, + Log_event::Byte **dst, + uint len) { memcpy(*dst, *src, len); - *src= *dst; + *src= (const char *)*dst; (*dst)+= len; *(*dst)++= 0; } @@ -1535,13 +1553,13 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, db(NullS), catalog_len(0), status_vars_len(0), flags2_inited(0), sql_mode_inited(0), charset_inited(0), auto_increment_increment(1), auto_increment_offset(1), - time_zone_len(0) + time_zone_len(0), lc_time_names_number(0) { ulong data_len; uint32 tmp; uint8 common_header_len, post_header_len; - char *start; - const char *end; + Log_event::Byte *start; + const Log_event::Byte *end; bool catalog_nz= 1; DBUG_ENTER("Query_log_event::Query_log_event(char*,...)"); @@ -1587,9 +1605,9 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, /* variable-part: the status vars; only in MySQL 5.0 */ - start= (char*) (buf+post_header_len); - end= (const char*) (start+status_vars_len); - for (const uchar* pos= (const uchar*) start; pos < (const uchar*) end;) + start= (Log_event::Byte*) (buf+post_header_len); + end= (const Log_event::Byte*) (start+status_vars_len); + for (const Log_event::Byte* pos= start; pos < end;) { switch (*pos++) { case Q_FLAGS2_CODE: @@ -1611,7 +1629,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, break; } case Q_CATALOG_NZ_CODE: - get_str_len_and_pointer(&catalog, (const char **)(&pos), &catalog_len); + get_str_len_and_pointer(&pos, &catalog, &catalog_len); break; case Q_AUTO_INCREMENT: auto_increment_increment= uint2korr(pos); @@ -1627,7 +1645,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, } case Q_TIME_ZONE_CODE: { - get_str_len_and_pointer(&time_zone_str, (const char **)(&pos), &time_zone_len); + get_str_len_and_pointer(&pos, &time_zone_str, &time_zone_len); break; } case Q_CATALOG_CODE: /* for 5.0.x where 0<=x<=3 masters */ @@ -1636,6 +1654,10 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, pos+= catalog_len+2; // leap over end 0 catalog_nz= 0; // catalog has end 0 in event break; + case Q_LC_TIME_NAMES_CODE: + lc_time_names_number= uint2korr(pos); + pos+= 2; + break; default: /* That's why you must write status vars in growing order of code */ DBUG_PRINT("info",("Query_log_event has unknown status vars (first has\ @@ -1645,38 +1667,38 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, } #if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE) - if (!(start= data_buf = (char*) my_malloc(catalog_len + 1 + - time_zone_len + 1 + - data_len + 1 + - QUERY_CACHE_FLAGS_SIZE + - db_len + 1, - MYF(MY_WME)))) + if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + + time_zone_len + 1 + + data_len + 1 + + QUERY_CACHE_FLAGS_SIZE + + db_len + 1, + MYF(MY_WME)))) #else - if (!(start= data_buf = (char*) my_malloc(catalog_len + 1 + - time_zone_len + 1 + - data_len + 1, - MYF(MY_WME)))) + if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + + time_zone_len + 1 + + data_len + 1, + MYF(MY_WME)))) #endif DBUG_VOID_RETURN; if (catalog_len) // If catalog is given { if (likely(catalog_nz)) // true except if event comes from 5.0.0|1|2|3. - copy_str_and_move(&start, &catalog, catalog_len); + copy_str_and_move(&catalog, &start, catalog_len); else { memcpy(start, catalog, catalog_len+1); // copy end 0 - catalog= start; + catalog= (const char *)start; start+= catalog_len+1; } } if (time_zone_len) - copy_str_and_move(&start, &time_zone_str, time_zone_len); + copy_str_and_move(&time_zone_str, &start, time_zone_len); /* A 2nd variable part; this is common to all versions */ memcpy((char*) start, end, data_len); // Copy db and query start[data_len]= '\0'; // End query with \0 (For safetly) - db= start; - query= start + db_len + 1; + db= (char *)start; + query= (char *)(start + db_len + 1); q_len= data_len - db_len -1; DBUG_VOID_RETURN; } @@ -1708,15 +1730,16 @@ void Query_log_event::print_query_header(IO_CACHE* file, 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;\n", db); + my_b_printf(file, "use %s%s\n", db, print_event_info->delimiter); } end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10); - *end++=';'; + end= strmov(end, print_event_info->delimiter); *end++='\n'; my_b_write(file, (byte*) buff, (uint) (end-buff)); if (flags & LOG_EVENT_THREAD_SPECIFIC_F) - my_b_printf(file,"SET @@session.pseudo_thread_id=%lu;\n",(ulong)thread_id); + my_b_printf(file,"SET @@session.pseudo_thread_id=%lu%s\n", + (ulong)thread_id, print_event_info->delimiter); /* If flags2_inited==0, this is an event from 3.23 or 4.0; nothing to @@ -1745,7 +1768,7 @@ void Query_log_event::print_query_header(IO_CACHE* file, "@@session.sql_auto_is_null", &need_comma); print_set_option(file, tmp, OPTION_RELAXED_UNIQUE_CHECKS, ~flags2, "@@session.unique_checks", &need_comma); - my_b_printf(file,";\n"); + my_b_printf(file,"%s\n", print_event_info->delimiter); print_event_info->flags2= flags2; } } @@ -1773,15 +1796,17 @@ void Query_log_event::print_query_header(IO_CACHE* file, } if (unlikely(print_event_info->sql_mode != sql_mode)) { - my_b_printf(file,"SET @@session.sql_mode=%lu;\n",(ulong)sql_mode); + my_b_printf(file,"SET @@session.sql_mode=%lu%s\n", + (ulong)sql_mode, print_event_info->delimiter); print_event_info->sql_mode= sql_mode; } } if (print_event_info->auto_increment_increment != auto_increment_increment || print_event_info->auto_increment_offset != auto_increment_offset) { - my_b_printf(file,"SET @@session.auto_increment_increment=%lu, @@session.auto_increment_offset=%lu;\n", - auto_increment_increment,auto_increment_offset); + my_b_printf(file,"SET @@session.auto_increment_increment=%lu, @@session.auto_increment_offset=%lu%s\n", + auto_increment_increment,auto_increment_offset, + print_event_info->delimiter); print_event_info->auto_increment_increment= auto_increment_increment; print_event_info->auto_increment_offset= auto_increment_offset; } @@ -1801,16 +1826,18 @@ void Query_log_event::print_query_header(IO_CACHE* file, if (cs_info) { /* for mysql client */ - my_b_printf(file, "/*!\\C %s */;\n", cs_info->csname); + my_b_printf(file, "/*!\\C %s */%s\n", + cs_info->csname, print_event_info->delimiter); } my_b_printf(file,"SET " "@@session.character_set_client=%d," "@@session.collation_connection=%d," "@@session.collation_server=%d" - ";\n", + "%s\n", uint2korr(charset), uint2korr(charset+2), - uint2korr(charset+4)); + uint2korr(charset+4), + print_event_info->delimiter); memcpy(print_event_info->charset, charset, 6); } } @@ -1818,10 +1845,17 @@ void Query_log_event::print_query_header(IO_CACHE* file, { if (bcmp(print_event_info->time_zone_str, time_zone_str, time_zone_len+1)) { - my_b_printf(file,"SET @@session.time_zone='%s';\n", time_zone_str); + my_b_printf(file,"SET @@session.time_zone='%s'%s\n", + time_zone_str, print_event_info->delimiter); memcpy(print_event_info->time_zone_str, time_zone_str, time_zone_len+1); } } + if (lc_time_names_number != print_event_info->lc_time_names_number) + { + my_b_printf(file, "SET @@session.lc_time_names=%d%s\n", + lc_time_names_number, print_event_info->delimiter); + print_event_info->lc_time_names_number= lc_time_names_number; + } } @@ -1831,7 +1865,7 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) print_query_header(&cache, print_event_info); my_b_write(&cache, (byte*) query, q_len); - my_b_printf(&cache, ";\n"); + my_b_printf(&cache, "%s\n", print_event_info->delimiter); } #endif /* MYSQL_CLIENT */ @@ -1964,6 +1998,19 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli, goto compare_errors; } } + if (lc_time_names_number) + { + if (!(thd->variables.lc_time_names= + my_locale_by_number(lc_time_names_number))) + { + my_printf_error(ER_UNKNOWN_ERROR, + "Unknown locale: '%d'", MYF(0), lc_time_names_number); + thd->variables.lc_time_names= &my_locale_en_US; + goto compare_errors; + } + } + else + thd->variables.lc_time_names= &my_locale_en_US; /* Execute the query (note that we bypass dispatch_command()) */ mysql_parse(thd, thd->query, thd->query_length); @@ -2188,9 +2235,9 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info) and rollback unfinished transaction. Probably this can be done with RESET CONNECTION (syntax to be defined). */ - my_b_printf(&cache,"RESET CONNECTION;\n"); + my_b_printf(&cache,"RESET CONNECTION%s\n", print_event_info->delimiter); #else - my_b_printf(&cache,"ROLLBACK;\n"); + my_b_printf(&cache,"ROLLBACK%s\n", print_event_info->delimiter); #endif } DBUG_VOID_RETURN; @@ -2945,15 +2992,16 @@ void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info, } if (db && db[0] && different_db) - my_b_printf(&cache, "%suse %s;\n", + my_b_printf(&cache, "%suse %s%s\n", commented ? "# " : "", - db); + db, print_event_info->delimiter); if (flags & LOG_EVENT_THREAD_SPECIFIC_F) - my_b_printf(&cache,"%sSET @@session.pseudo_thread_id=%lu;\n", - commented ? "# " : "", (ulong)thread_id); + my_b_printf(&cache,"%sSET @@session.pseudo_thread_id=%lu%s\n", + commented ? "# " : "", (ulong)thread_id, + print_event_info->delimiter); my_b_printf(&cache, "%sLOAD DATA ", - commented ? "# " : ""); + commented ? "# " : ""); if (check_fname_outside_temp_buf()) my_b_printf(&cache, "LOCAL "); my_b_printf(&cache, "INFILE '%-*s' ", fname_len, fname); @@ -3003,7 +3051,7 @@ void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info, my_b_printf(&cache, ")"); } - my_b_printf(&cache, ";\n"); + my_b_printf(&cache, "%s\n", print_event_info->delimiter); DBUG_VOID_RETURN; } #endif /* MYSQL_CLIENT */ @@ -3582,7 +3630,8 @@ void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) msg="INVALID_INT"; break; } - my_b_printf(&cache, "%s=%s;\n", msg, llstr(val,llbuff)); + my_b_printf(&cache, "%s=%s%s\n", + msg, llstr(val,llbuff), print_event_info->delimiter); } #endif @@ -3660,8 +3709,9 @@ void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) print_header(&cache, print_event_info, FALSE); my_b_printf(&cache, "\tRand\n"); } - my_b_printf(&cache, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s;\n", - llstr(seed1, llbuff),llstr(seed2, llbuff2)); + my_b_printf(&cache, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s%s\n", + llstr(seed1, llbuff),llstr(seed2, llbuff2), + print_event_info->delimiter); } #endif /* MYSQL_CLIENT */ @@ -3734,7 +3784,7 @@ void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) print_header(&cache, print_event_info, FALSE); my_b_printf(&cache, "\tXid = %s\n", buf); } - my_b_printf(&cache, "COMMIT;\n"); + my_b_printf(&cache, "COMMIT%s\n", print_event_info->delimiter); } #endif /* MYSQL_CLIENT */ @@ -3939,7 +3989,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) if (is_null) { - my_b_printf(&cache, ":=NULL;\n"); + my_b_printf(&cache, ":=NULL%s\n", print_event_info->delimiter); } else { @@ -3947,12 +3997,12 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) case REAL_RESULT: double real_val; float8get(real_val, val); - my_b_printf(&cache, ":=%.14g;\n", real_val); + my_b_printf(&cache, ":=%.14g%s\n", real_val, print_event_info->delimiter); break; case INT_RESULT: char int_buf[22]; longlong10_to_str(uint8korr(val), int_buf, -10); - my_b_printf(&cache, ":=%s;\n", int_buf); + my_b_printf(&cache, ":=%s%s\n", int_buf, print_event_info->delimiter); break; case DECIMAL_RESULT: { @@ -3968,7 +4018,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) bin2decimal(val+2, &dec, precision, scale); decimal2string(&dec, str_buf, &str_len, 0, 0, 0); str_buf[str_len]= 0; - my_b_printf(&cache, ":=%s;\n",str_buf); + my_b_printf(&cache, ":=%s%s\n", str_buf, print_event_info->delimiter); break; } case STRING_RESULT: @@ -4004,9 +4054,11 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) Generate an unusable command (=> syntax error) is probably the best thing we can do here. */ - my_b_printf(&cache, ":=???;\n"); + my_b_printf(&cache, ":=???%s\n", print_event_info->delimiter); else - my_b_printf(&cache, ":=_%s %s COLLATE `%s`;\n", cs->csname, hex_str, cs->name); + my_b_printf(&cache, ":=_%s %s COLLATE `%s`%s\n", + cs->csname, hex_str, cs->name, + print_event_info->delimiter); my_afree(hex_str); } break; @@ -5108,12 +5160,12 @@ void Execute_load_query_log_event::print(FILE* file, my_b_printf(&cache, " REPLACE"); my_b_printf(&cache, " INTO"); my_b_write(&cache, (byte*) query + fn_pos_end, q_len-fn_pos_end); - my_b_printf(&cache, ";\n"); + my_b_printf(&cache, "%s\n", print_event_info->delimiter); } else { my_b_write(&cache, (byte*) query, q_len); - my_b_printf(&cache, ";\n"); + my_b_printf(&cache, "%s\n", print_event_info->delimiter); } if (!print_event_info->short_form) @@ -5287,8 +5339,6 @@ char* sql_ex_info::init(char* buf,char* buf_end,bool use_new_format) } -#ifdef HAVE_ROW_BASED_REPLICATION - /************************************************************************** Rows_log_event member functions **************************************************************************/ @@ -6582,10 +6632,13 @@ copy_extra_record_fields(TABLE *table, case MYSQL_TYPE_BIT: Field_bit *f= static_cast<Field_bit*>(*field_ptr); - my_ptrdiff_t const offset= table->record[1] - table->record[0]; - uchar const bits= - get_rec_bits(f->bit_ptr + offset, f->bit_ofs, f->bit_len); - set_rec_bits(bits, f->bit_ptr, f->bit_ofs, f->bit_len); + if (f->bit_len > 0) + { + my_ptrdiff_t const offset= table->record[1] - table->record[0]; + uchar const bits= + get_rec_bits(f->bit_ptr + offset, f->bit_ofs, f->bit_len); + set_rec_bits(bits, f->bit_ptr, f->bit_ofs, f->bit_len); + } break; } } @@ -7286,4 +7339,3 @@ void Update_rows_log_event::print(FILE *file, } #endif -#endif /* defined(HAVE_ROW_BASED_REPLICATION) */ diff --git a/sql/log_event.h b/sql/log_event.h index fd924537919..5994beb0df3 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -270,6 +270,8 @@ struct sql_ex_info */ #define Q_CATALOG_NZ_CODE 6 +#define Q_LC_TIME_NAMES_CODE 7 + /* Intvar event post-header */ #define I_TYPE_OFFSET 0 @@ -422,12 +424,18 @@ struct sql_ex_info either, as the manual says (because a too big in-memory temp table is automatically written to disk). */ -#define OPTIONS_WRITTEN_TO_BIN_LOG (OPTION_AUTO_IS_NULL | \ -OPTION_NO_FOREIGN_KEY_CHECKS | OPTION_RELAXED_UNIQUE_CHECKS) +#define OPTIONS_WRITTEN_TO_BIN_LOG \ + (OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS | \ + OPTION_RELAXED_UNIQUE_CHECKS | OPTION_NOT_AUTOCOMMIT) + +/* Shouldn't be defined before */ +#define EXPECTED_OPTIONS \ + ((ULL(1) << 14) | (ULL(1) << 26) | (ULL(1) << 27) | (ULL(1) << 19)) -#if OPTIONS_WRITTEN_TO_BIN_LOG != ((1L << 14) | (1L << 26) | (1L << 27)) +#if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS #error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values! #endif +#undef EXPECTED_OPTIONS /* You shouldn't use this one */ enum Log_event_type { @@ -524,9 +532,11 @@ typedef struct st_print_event_info bool charset_inited; char charset[6]; // 3 variables, each of them storable in 2 bytes char time_zone_str[MAX_TIME_ZONE_NAME_LENGTH]; + uint lc_time_names_number; st_print_event_info() :flags2_inited(0), sql_mode_inited(0), - auto_increment_increment(1),auto_increment_offset(1), charset_inited(0) + auto_increment_increment(1),auto_increment_offset(1), charset_inited(0), + lc_time_names_number(0) { /* Currently we only use static PRINT_EVENT_INFO objects, so zeroed at @@ -536,6 +546,7 @@ typedef struct st_print_event_info bzero(db, sizeof(db)); bzero(charset, sizeof(charset)); bzero(time_zone_str, sizeof(time_zone_str)); + strcpy(delimiter, ";"); uint const flags = MYF(MY_WME | MY_NABP); init_io_cache(&head_cache, -1, 0, WRITE_CACHE, 0L, FALSE, flags); init_io_cache(&body_cache, -1, 0, WRITE_CACHE, 0L, FALSE, flags); @@ -552,6 +563,7 @@ typedef struct st_print_event_info bool base64_output; my_off_t hexdump_from; uint8 common_header_len; + char delimiter[16]; /* These two caches are used by the row-based replication events to @@ -575,6 +587,13 @@ class Log_event { public: /* + The following type definition is to be used whenever data is placed + and manipulated in a common buffer. Use this typedef for buffers + that contain data containing binary and character data. + */ + typedef unsigned char Byte; + + /* The offset in the log where this event originally appeared (it is preserved in relay logs, making SHOW SLAVE STATUS able to print coordinates of the event in the master's binlog). Note: when a @@ -755,7 +774,7 @@ public: class Query_log_event: public Log_event { protected: - char* data_buf; + Log_event::Byte* data_buf; public: const char* query; const char* catalog; @@ -826,6 +845,7 @@ public: char charset[6]; uint time_zone_len; /* 0 means uninited */ const char *time_zone_str; + uint lc_time_names_number; /* 0 means en_US */ #ifndef MYSQL_CLIENT @@ -1690,8 +1710,6 @@ public: #endif char *str_to_hex(char *to, const char *from, uint len); -#ifdef HAVE_ROW_BASED_REPLICATION - /***************************************************************************** Table map log event class @@ -2020,7 +2038,7 @@ public: Write_rows_log_event(const char *buf, uint event_len, const Format_description_log_event *description_event); #endif -#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION) +#if !defined(MYSQL_CLIENT) static bool binlog_row_logging_function(THD *thd, TABLE *table, bool is_transactional, MY_BITMAP *cols, @@ -2085,7 +2103,7 @@ public: const Format_description_log_event *description_event); #endif -#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION) +#if !defined(MYSQL_CLIENT) static bool binlog_row_logging_function(THD *thd, TABLE *table, bool is_transactional, MY_BITMAP *cols, @@ -2155,7 +2173,7 @@ public: Delete_rows_log_event(const char *buf, uint event_len, const Format_description_log_event *description_event); #endif -#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION) +#if !defined(MYSQL_CLIENT) static bool binlog_row_logging_function(THD *thd, TABLE *table, bool is_transactional, MY_BITMAP *cols, @@ -2189,6 +2207,4 @@ private: #endif }; -#endif /* HAVE_ROW_BASED_REPLICATION */ - #endif /* _log_event_h */ diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index e21658bc6b8..43b3605ad1a 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -117,6 +117,7 @@ enum Derivation typedef struct my_locale_st { + uint number; const char *name; const char *description; const bool is_ascii; @@ -125,9 +126,11 @@ typedef struct my_locale_st TYPELIB *day_names; TYPELIB *ab_day_names; #ifdef __cplusplus - my_locale_st(const char *name_par, const char *descr_par, bool is_ascii_par, + 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) : + 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) @@ -139,6 +142,7 @@ extern MY_LOCALE my_locale_en_US; extern MY_LOCALE *my_locales[]; MY_LOCALE *my_locale_by_name(const char *name); +MY_LOCALE *my_locale_by_number(uint number); /*************************************************************************** Configuration parameters @@ -302,54 +306,54 @@ MY_LOCALE *my_locale_by_name(const char *name); TODO: separate three contexts above, move them to separate bitfields. */ -#define SELECT_DISTINCT (LL(1) << 0) // SELECT, user -#define SELECT_STRAIGHT_JOIN (LL(1) << 1) // SELECT, user -#define SELECT_DESCRIBE (LL(1) << 2) // SELECT, user -#define SELECT_SMALL_RESULT (LL(1) << 3) // SELECT, user -#define SELECT_BIG_RESULT (LL(1) << 4) // SELECT, user -#define OPTION_FOUND_ROWS (LL(1) << 5) // SELECT, user -#define OPTION_TO_QUERY_CACHE (LL(1) << 6) // SELECT, user -#define SELECT_NO_JOIN_CACHE (LL(1) << 7) // intern -#define OPTION_BIG_TABLES (LL(1) << 8) // THD, user -#define OPTION_BIG_SELECTS (LL(1) << 9) // THD, user -#define OPTION_LOG_OFF (LL(1) << 10) // THD, user -#define OPTION_QUOTE_SHOW_CREATE (LL(1) << 11) // THD, user -#define TMP_TABLE_ALL_COLUMNS (LL(1) << 12) // SELECT, intern -#define OPTION_WARNINGS (LL(1) << 13) // THD, user -#define OPTION_AUTO_IS_NULL (LL(1) << 14) // THD, user, binlog -#define OPTION_FOUND_COMMENT (LL(1) << 15) // SELECT, intern, parser -#define OPTION_SAFE_UPDATES (LL(1) << 16) // THD, user -#define OPTION_BUFFER_RESULT (LL(1) << 17) // SELECT, user -#define OPTION_BIN_LOG (LL(1) << 18) // THD, user -#define OPTION_NOT_AUTOCOMMIT (LL(1) << 19) // THD, user -#define OPTION_BEGIN (LL(1) << 20) // THD, intern -#define OPTION_TABLE_LOCK (LL(1) << 21) // THD, intern -#define OPTION_QUICK (LL(1) << 22) // SELECT (for DELETE) -#define OPTION_KEEP_LOG (LL(1) << 23) // Keep binlog on rollback +#define SELECT_DISTINCT (ULL(1) << 0) // SELECT, user +#define SELECT_STRAIGHT_JOIN (ULL(1) << 1) // SELECT, user +#define SELECT_DESCRIBE (ULL(1) << 2) // SELECT, user +#define SELECT_SMALL_RESULT (ULL(1) << 3) // SELECT, user +#define SELECT_BIG_RESULT (ULL(1) << 4) // SELECT, user +#define OPTION_FOUND_ROWS (ULL(1) << 5) // SELECT, user +#define OPTION_TO_QUERY_CACHE (ULL(1) << 6) // SELECT, user +#define SELECT_NO_JOIN_CACHE (ULL(1) << 7) // intern +#define OPTION_BIG_TABLES (ULL(1) << 8) // THD, user +#define OPTION_BIG_SELECTS (ULL(1) << 9) // THD, user +#define OPTION_LOG_OFF (ULL(1) << 10) // THD, user +#define OPTION_QUOTE_SHOW_CREATE (ULL(1) << 11) // THD, user +#define TMP_TABLE_ALL_COLUMNS (ULL(1) << 12) // SELECT, intern +#define OPTION_WARNINGS (ULL(1) << 13) // THD, user +#define OPTION_AUTO_IS_NULL (ULL(1) << 14) // THD, user, binlog +#define OPTION_FOUND_COMMENT (ULL(1) << 15) // SELECT, intern, parser +#define OPTION_SAFE_UPDATES (ULL(1) << 16) // THD, user +#define OPTION_BUFFER_RESULT (ULL(1) << 17) // SELECT, user +#define OPTION_BIN_LOG (ULL(1) << 18) // THD, user +#define OPTION_NOT_AUTOCOMMIT (ULL(1) << 19) // THD, user +#define OPTION_BEGIN (ULL(1) << 20) // THD, intern +#define OPTION_TABLE_LOCK (ULL(1) << 21) // THD, intern +#define OPTION_QUICK (ULL(1) << 22) // SELECT (for DELETE) +#define OPTION_KEEP_LOG (ULL(1) << 23) // Keep binlog on rollback /* The following is used to detect a conflict with DISTINCT */ -#define SELECT_ALL (LL(1) << 24) // SELECT, user, parser +#define SELECT_ALL (ULL(1) << 24) // SELECT, user, parser /* Set if we are updating a non-transaction safe table */ -#define OPTION_STATUS_NO_TRANS_UPDATE (LL(1) << 25) // THD, intern +#define OPTION_STATUS_NO_TRANS_UPDATE (ULL(1) << 25) // THD, intern /* The following can be set when importing tables in a 'wrong order' to suppress foreign key checks */ -#define OPTION_NO_FOREIGN_KEY_CHECKS (LL(1) << 26) // THD, user, binlog +#define OPTION_NO_FOREIGN_KEY_CHECKS (ULL(1) << 26) // THD, user, binlog /* The following speeds up inserts to InnoDB tables by suppressing unique key checks in some cases */ -#define OPTION_RELAXED_UNIQUE_CHECKS (LL(1) << 27) // THD, user, binlog -#define SELECT_NO_UNLOCK (LL(1) << 28) // SELECT, intern -#define OPTION_SCHEMA_TABLE (LL(1) << 29) // SELECT, intern +#define OPTION_RELAXED_UNIQUE_CHECKS (ULL(1) << 27) // THD, user, binlog +#define SELECT_NO_UNLOCK (ULL(1) << 28) // SELECT, intern +#define OPTION_SCHEMA_TABLE (ULL(1) << 29) // SELECT, intern /* Flag set if setup_tables already done */ -#define OPTION_SETUP_TABLES_DONE (LL(1) << 30) // intern +#define OPTION_SETUP_TABLES_DONE (ULL(1) << 30) // intern /* If not set then the thread will ignore all warnings with level notes. */ -#define OPTION_SQL_NOTES (LL(1) << 31) // THD, user +#define OPTION_SQL_NOTES (ULL(1) << 31) // THD, user /* Force the used temporary table to be a MyISAM table (because we will use fulltext functions when reading from it. */ -#define TMP_TABLE_FORCE_MYISAM (LL(1) << 32) +#define TMP_TABLE_FORCE_MYISAM (ULL(1) << 32) /* Maximum length of time zone name that we support @@ -1559,9 +1563,7 @@ extern ulong query_buff_size, thread_stack; extern ulong max_prepared_stmt_count, prepared_stmt_count; extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit; extern ulong max_binlog_size, max_relay_log_size; -#ifdef HAVE_ROW_BASED_REPLICATION extern ulong opt_binlog_rows_event_max_size; -#endif extern ulong rpl_recovery_rank, thread_cache_size; extern ulong back_log; extern ulong specialflag, current_pid; @@ -1661,7 +1663,6 @@ extern handlerton *partition_hton; extern handlerton *myisam_hton; extern handlerton *heap_hton; -extern SHOW_COMP_OPTION have_row_based_replication; extern SHOW_COMP_OPTION have_openssl, have_symlink, have_dlopen; extern SHOW_COMP_OPTION have_query_cache; extern SHOW_COMP_OPTION have_geometry, have_rtree_keys; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 590d3d59a00..4901cbf3b17 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -27,9 +27,7 @@ #include "../storage/myisam/ha_myisam.h" -#ifdef HAVE_ROW_BASED_REPLICATION #include "rpl_injector.h" -#endif #ifdef WITH_INNOBASE_STORAGE_ENGINE #define OPT_INNODB_DEFAULT 1 @@ -447,12 +445,8 @@ volatile bool mqh_used = 0; my_bool opt_noacl; my_bool sp_automatic_privileges= 1; -#ifdef HAVE_ROW_BASED_REPLICATION ulong opt_binlog_rows_event_max_size; const char *binlog_format_names[]= {"STATEMENT", "ROW", "MIXED", NullS}; -#else -const char *binlog_format_names[]= {"STATEMENT", NullS}; -#endif TYPELIB binlog_format_typelib= { array_elements(binlog_format_names)-1,"", binlog_format_names, NULL }; @@ -564,7 +558,6 @@ CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; CHARSET_INFO *character_set_filesystem; -SHOW_COMP_OPTION have_row_based_replication; SHOW_COMP_OPTION have_openssl, have_symlink, have_dlopen, have_query_cache; SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_crypt, have_compress; @@ -1172,9 +1165,7 @@ void clean_up(bool print_message) what they have that is dependent on the binlog */ ha_binlog_end(current_thd); -#ifdef HAVE_ROW_BASED_REPLICATION injector::free_instance(); -#endif mysql_bin_log.cleanup(); #ifdef HAVE_REPLICATION @@ -3171,11 +3162,7 @@ with --log-bin instead."); } if (global_system_variables.binlog_format == BINLOG_FORMAT_UNSPEC) { -#if defined(HAVE_ROW_BASED_REPLICATION) global_system_variables.binlog_format= BINLOG_FORMAT_MIXED; -#else - global_system_variables.binlog_format= BINLOG_FORMAT_STMT; -#endif } /* Check that we have not let the format to unspecified at this point */ @@ -4716,9 +4703,7 @@ enum options_mysqld #ifndef DBUG_OFF OPT_BINLOG_SHOW_XID, #endif -#ifdef HAVE_ROW_BASED_REPLICATION OPT_BINLOG_ROWS_EVENT_MAX_SIZE, -#endif OPT_WANT_CORE, OPT_CONCURRENT_INSERT, OPT_MEMLOCK, OPT_MYISAM_RECOVER, OPT_REPLICATE_REWRITE_DB, OPT_SERVER_ID, @@ -4929,7 +4914,6 @@ struct my_option my_long_options[] = (gptr*) &my_bind_addr_str, (gptr*) &my_bind_addr_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"binlog_format", OPT_BINLOG_FORMAT, -#ifdef HAVE_ROW_BASED_REPLICATION "Tell the master the form of binary logging to use: either 'row' for " "row-based binary logging, or 'statement' for statement-based binary " "logging, or 'mixed'. 'mixed' is statement-based binary logging except " @@ -4939,17 +4923,8 @@ struct my_option my_long_options[] = #ifdef HAVE_NDB_BINLOG "If ndbcluster is enabled, the default is 'row'." #endif -#else - "Tell the master the form of binary logging to use: this build " - "supports only statement-based binary logging, so only 'statement' is " - "a legal value." -#endif , 0, 0, 0, GET_STR, REQUIRED_ARG, -#ifdef HAVE_ROW_BASED_REPLICATION BINLOG_FORMAT_MIXED -#else - BINLOG_FORMAT_STMT -#endif , 0, 0, 0, 0, 0 }, {"binlog-do-db", OPT_BINLOG_DO_DB, "Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.", @@ -4957,7 +4932,6 @@ struct my_option my_long_options[] = {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB, "Tells the master that updates to the given database should not be logged tothe binary log.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef HAVE_ROW_BASED_REPLICATION {"binlog-row-event-max-size", OPT_BINLOG_ROWS_EVENT_MAX_SIZE, "The maximum size of a row-based binary log event in bytes. Rows will be " "grouped into events smaller than this size if possible. " @@ -4969,7 +4943,6 @@ struct my_option my_long_options[] = /* sub_size */ 0, /* block_size */ 256, /* app_type */ 0 }, -#endif #ifndef DISABLE_GRANT_OPTIONS {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -5235,11 +5208,9 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, "If equal to 0 (the default), then when --log-bin is used, creation of " "a stored function (or trigger) is allowed only to users having the SUPER privilege " "and only if this stored function (trigger) may not break binary logging." -#ifdef HAVE_ROW_BASED_REPLICATION "Note that if ALL connections to this server ALWAYS use row-based binary " "logging, the security issues do not exist and the binary logging cannot " "break, so you can safely set this to 1." -#endif ,(gptr*) &trust_function_creators, (gptr*) &trust_function_creators, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-error", OPT_ERROR_LOG_FILE, "Error log file.", @@ -7077,11 +7048,6 @@ static void mysql_init_variables(void) #else have_partition_db= SHOW_OPTION_NO; #endif -#ifdef HAVE_ROW_BASED_REPLICATION - have_row_based_replication= SHOW_OPTION_YES; -#else - have_row_based_replication= SHOW_OPTION_NO; -#endif #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE have_ndbcluster=SHOW_OPTION_DISABLED; global_system_variables.ndb_index_stat_enable=FALSE; @@ -7311,7 +7277,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int id; if ((id= find_type(argument, &binlog_format_typelib, 2)) <= 0) { -#ifdef HAVE_ROW_BASED_REPLICATION fprintf(stderr, "Unknown binary log format: '%s' " "(should be one of '%s', '%s', '%s')\n", @@ -7319,11 +7284,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), binlog_format_names[BINLOG_FORMAT_STMT], binlog_format_names[BINLOG_FORMAT_ROW], binlog_format_names[BINLOG_FORMAT_MIXED]); -#else - fprintf(stderr, - "Unknown binary log format: '%s' (only legal value is '%s')\n", - argument, binlog_format_names[BINLOG_FORMAT_STMT]); -#endif exit(1); } global_system_variables.binlog_format= id-1; diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index 292e6262382..95b5ecba895 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -15,7 +15,6 @@ #include "mysql_priv.h" #include "rpl_injector.h" -#ifdef HAVE_ROW_BASED_REPLICATION /* injector::transaction - member definitions @@ -189,5 +188,3 @@ void injector::new_trans(THD *thd, injector::transaction *ptr) DBUG_VOID_RETURN; } - -#endif diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h index 381da7c33a5..8b08c0672c9 100644 --- a/sql/rpl_injector.h +++ b/sql/rpl_injector.h @@ -19,7 +19,6 @@ /* Pull in 'byte', 'my_off_t', and 'uint32' */ #include <my_global.h> -#ifdef HAVE_ROW_BASED_REPLICATION #include <my_bitmap.h> /* Forward declarations */ @@ -329,5 +328,4 @@ private: */ }; -#endif /* HAVE_ROW_BASED_REPLICATION */ #endif /* INJECTOR_H */ diff --git a/sql/set_var.cc b/sql/set_var.cc index b998548a6ab..959baf00ae9 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -670,7 +670,6 @@ sys_var_have_variable sys_have_query_cache("have_query_cache", &have_query_cache); sys_var_have_variable sys_have_rtree_keys("have_rtree_keys", &have_rtree_keys); sys_var_have_variable sys_have_symlink("have_symlink", &have_symlink); -sys_var_have_variable sys_have_row_based_replication("have_row_based_replication",&have_row_based_replication); /* Global read-only variable describing server license */ sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE)); @@ -792,7 +791,6 @@ SHOW_VAR init_vars[]= { {sys_have_openssl.name, (char*) &have_openssl, SHOW_HAVE}, {sys_have_partition_db.name,(char*) &have_partition_db, SHOW_HAVE}, {sys_have_query_cache.name, (char*) &have_query_cache, SHOW_HAVE}, - {sys_have_row_based_replication.name, (char*) &have_row_based_replication, SHOW_HAVE}, {sys_have_rtree_keys.name, (char*) &have_rtree_keys, SHOW_HAVE}, {sys_have_symlink.name, (char*) &have_symlink, SHOW_HAVE}, {"init_connect", (char*) &sys_init_connect, SHOW_SYS}, @@ -1307,10 +1305,6 @@ bool sys_var_thd_binlog_format::is_readonly() const If we don't have row-based replication compiled in, the variable is always read-only. */ -#ifndef HAVE_ROW_BASED_REPLICATION - my_error(ER_RBR_NOT_AVAILABLE, MYF(0)); - return 1; -#else if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) && thd->temporary_tables) { @@ -1335,16 +1329,13 @@ bool sys_var_thd_binlog_format::is_readonly() const return 1; } #endif /* HAVE_NDB_BINLOG */ -#endif /* HAVE_ROW_BASED_REPLICATION */ return sys_var_thd_enum::is_readonly(); } void fix_binlog_format_after_update(THD *thd, enum_var_type type) { -#ifdef HAVE_ROW_BASED_REPLICATION thd->reset_current_stmt_binlog_row_based(); -#endif /*HAVE_ROW_BASED_REPLICATION*/ } @@ -2986,17 +2977,39 @@ byte *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type, return (byte*) &(max_user_connections); } + bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var) { - char *locale_str =var->value->str_value.c_ptr(); - MY_LOCALE *locale_match= my_locale_by_name(locale_str); + MY_LOCALE *locale_match; - if (locale_match == NULL) + if (var->value->result_type() == INT_RESULT) { - my_printf_error(ER_UNKNOWN_ERROR, - "Unknown locale: '%s'", MYF(0), locale_str); - return 1; + if (!(locale_match= my_locale_by_number((uint) var->value->val_int()))) + { + char buf[20]; + int10_to_str((int) var->value->val_int(), buf, -10); + my_printf_error(ER_UNKNOWN_ERROR, "Unknown locale: '%s'", MYF(0), buf); + return 1; + } + } + else // STRING_RESULT + { + char buff[6]; + String str(buff, sizeof(buff), &my_charset_latin1), *res; + if (!(res=var->value->val_str(&str))) + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL"); + return 1; + } + const char *locale_str= res->c_ptr(); + if (!(locale_match= my_locale_by_name(locale_str))) + { + my_printf_error(ER_UNKNOWN_ERROR, + "Unknown locale: '%s'", MYF(0), locale_str); + return 1; + } } + var->save_result.locale_value= locale_match; return 0; } diff --git a/sql/set_var.h b/sql/set_var.h index 3b0aa6cde9c..0354189b61f 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -908,13 +908,17 @@ class sys_var_thd_lc_time_names :public sys_var_thd { public: sys_var_thd_lc_time_names(const char *name_arg): - sys_var_thd(name_arg) - {} + sys_var_thd(name_arg) + { +#if MYSQL_VERSION_ID < 50000 + no_support_one_shot= 0; +#endif + } bool check(THD *thd, set_var *var); SHOW_TYPE type() { return SHOW_CHAR; } bool check_update_type(Item_result type) { - return type != STRING_RESULT; /* Only accept strings */ + return ((type != STRING_RESULT) && (type != INT_RESULT)); } bool check_default(enum_var_type type) { return 0; } bool update(THD *thd, set_var *var); @@ -939,9 +943,7 @@ public: } }; -#ifdef HAVE_ROW_BASED_REPLICATION extern void fix_binlog_format_after_update(THD *thd, enum_var_type type); -#endif class sys_var_thd_binlog_format :public sys_var_thd_enum { @@ -949,9 +951,7 @@ public: sys_var_thd_binlog_format(const char *name_arg, ulong SV::*offset_arg) :sys_var_thd_enum(name_arg, offset_arg, &binlog_format_typelib -#ifdef HAVE_ROW_BASED_REPLICATION , fix_binlog_format_after_update -#endif ) {}; bool is_readonly() const; diff --git a/sql/slave.cc b/sql/slave.cc index 88e501143bc..c21aec49e88 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -32,6 +32,7 @@ int queue_event(MASTER_INFO* mi,const char* buf,ulong event_len); +#define FLAGSTR(V,F) ((V)&(F)?#F" ":"") #define MAX_SLAVE_RETRY_PAUSE 5 bool use_slave_mask = 0; @@ -1798,6 +1799,10 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) if (!ev->when) ev->when = time(NULL); ev->thd = thd; // because up to this point, ev->thd == 0 + DBUG_PRINT("info", ("thd->options={ %s%s}", + FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT), + FLAGSTR(thd->options, OPTION_BEGIN))); + exec_res = ev->exec_event(rli); DBUG_PRINT("info", ("exec_event result: %d", exec_res)); DBUG_ASSERT(rli->sql_thd==thd); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 714202b0864..34dfa0891a0 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -92,7 +92,7 @@ sp_map_item_type(enum enum_field_types type) */ static String * -sp_get_item_value(Item *item, String *str) +sp_get_item_value(THD *thd, Item *item, String *str) { Item_result result_type= item->result_type(); @@ -112,15 +112,16 @@ sp_get_item_value(Item *item, String *str) { char buf_holder[STRING_BUFFER_USUAL_SIZE]; String buf(buf_holder, sizeof(buf_holder), result->charset()); + CHARSET_INFO *cs= thd->variables.character_set_client; /* We must reset length of the buffer, because of String specificity. */ buf.length(0); buf.append('_'); buf.append(result->charset()->csname); - if (result->charset()->escape_with_backslash_is_dangerous) + if (cs->escape_with_backslash_is_dangerous) buf.append(' '); - append_query_string(result->charset(), result, &buf); + append_query_string(cs, result, &buf); str->copy(buf); return str; @@ -903,7 +904,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str) val= (*splocal)->this_item(); DBUG_PRINT("info", ("print 0x%lx", (long) val)); - str_value= sp_get_item_value(val, &str_value_holder); + str_value= sp_get_item_value(thd, val, &str_value_holder); if (str_value) res|= qbuf.append(*str_value); else @@ -1470,6 +1471,8 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, { binlog_buf.length(0); binlog_buf.append(STRING_WITH_LEN("SELECT ")); + append_identifier(thd, &binlog_buf, m_db.str, m_db.length); + binlog_buf.append('.'); append_identifier(thd, &binlog_buf, m_name.str, m_name.length); binlog_buf.append('('); for (arg_no= 0; arg_no < argcount; arg_no++) @@ -1480,7 +1483,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, if (arg_no) binlog_buf.append(','); - str_value= sp_get_item_value(nctx->get_item(arg_no), + str_value= sp_get_item_value(thd, nctx->get_item(arg_no), &str_value_holder); if (str_value) @@ -1852,7 +1855,6 @@ sp_head::restore_lex(THD *thd) oldlex->next_state= sublex->next_state; oldlex->trg_table_fields.push_back(&sublex->trg_table_fields); -#ifdef HAVE_ROW_BASED_REPLICATION /* If this substatement needs row-based, the entire routine does too (we cannot switch from statement-based to row-based only for this @@ -1860,7 +1862,6 @@ sp_head::restore_lex(THD *thd) */ if (sublex->binlog_row_based_if_mixed) m_flags|= BINLOG_ROW_BASED_IF_MIXED; -#endif /* Add routines which are used by statement to respective set for diff --git a/sql/sp_head.h b/sql/sp_head.h index 2c554d50bd8..5f36aa9a4f6 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -361,7 +361,6 @@ public: */ void propagate_attributes(LEX *lex) { -#ifdef HAVE_ROW_BASED_REPLICATION /* If this routine needs row-based binary logging, the entire top statement too (we cannot switch from statement-based to row-based only for this @@ -370,7 +369,6 @@ public: */ if (m_flags & BINLOG_ROW_BASED_IF_MIXED) lex->binlog_row_based_if_mixed= TRUE; -#endif } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 4d1451f6bce..0d9653172e0 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1629,7 +1629,7 @@ bool change_password(THD *thd, const char *host, const char *user, { query_length= my_sprintf(buff, - (buff,"SET PASSWORD FOR \"%-.120s\"@\"%-.120s\"=\"%-.120s\"", + (buff,"SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'", acl_user->user ? acl_user->user : "", acl_user->host.hostname ? acl_user->host.hostname : "", new_password)); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 7614506f77f..681536e4d9b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1063,9 +1063,7 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived) handled either before writing a query log event (inside binlog_query()) or when preparing a pending event. */ -#ifdef HAVE_ROW_BASED_REPLICATION thd->binlog_flush_pending_rows_event(TRUE); -#endif /*HAVE_ROW_BASED_REPLICATION*/ mysql_unlock_tables(thd, thd->lock); thd->lock=0; } @@ -3324,13 +3322,11 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) *need_reopen= FALSE; -#ifdef HAVE_ROW_BASED_REPLICATION /* CREATE ... SELECT UUID() locks no tables, we have to test here. */ if (thd->lex->binlog_row_based_if_mixed) thd->set_current_stmt_binlog_row_based_if_mixed(); -#endif /*HAVE_ROW_BASED_REPLICATION*/ if (!tables && !thd->lex->requires_prelocking()) DBUG_RETURN(0); @@ -3362,7 +3358,6 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) { thd->in_lock_tables=1; thd->options|= OPTION_TABLE_LOCK; -#ifdef HAVE_ROW_BASED_REPLICATION /* If we have >= 2 different tables to update with auto_inc columns, statement-based binlogging won't work. We can solve this problem in @@ -3374,7 +3369,6 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) thd->lex->binlog_row_based_if_mixed= TRUE; thd->set_current_stmt_binlog_row_based_if_mixed(); } -#endif } if (! (thd->lock= mysql_lock_tables(thd, start, (uint) (ptr - start), diff --git a/sql/sql_class.cc b/sql/sql_class.cc index af66fd2d3de..2bf70a579fa 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -203,9 +203,7 @@ THD::THD() Open_tables_state(refresh_version), rli_fake(0), lock_id(&main_lock_id), user_time(0), in_sub_stmt(0), -#ifdef HAVE_ROW_BASED_REPLICATION binlog_table_maps(0), -#endif /*HAVE_ROW_BASED_REPLICATION*/ global_read_lock(0), is_fatal_error(0), rand_used(0), time_zone_used(0), arg_of_last_insert_id_function(FALSE), @@ -266,9 +264,7 @@ THD::THD() system_thread= NON_SYSTEM_THREAD; cleanup_done= abort_on_warning= no_warnings_for_error= 0; peer_port= 0; // For SHOW PROCESSLIST -#ifdef HAVE_ROW_BASED_REPLICATION transaction.m_pending_rows_event= 0; -#endif #ifdef __WIN__ real_id = 0; #endif @@ -348,9 +344,7 @@ void THD::init(void) bzero((char*) warn_count, sizeof(warn_count)); total_warn_count= 0; update_charset(); -#ifdef HAVE_ROW_BASED_REPLICATION reset_current_stmt_binlog_row_based(); -#endif /*HAVE_ROW_BASED_REPLICATION*/ bzero((char *) &status_var, sizeof(status_var)); variables.lc_time_names = &my_locale_en_US; } @@ -2293,7 +2287,6 @@ void xid_cache_delete(XID_STATE *xid_state) */ #ifndef MYSQL_CLIENT -#ifdef HAVE_ROW_BASED_REPLICATION /* Template member function for ensuring that there is an rows log @@ -2786,8 +2779,6 @@ void THD::binlog_delete_pending_rows_event() } } -#endif /* HAVE_ROW_BASED_REPLICATION */ - /* Member function that will log query, either row-based or statement-based depending on the value of the 'current_stmt_binlog_row_based' @@ -2828,18 +2819,14 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, If we are in prelocked mode, the flushing will be done inside the top-most close_thread_tables(). */ -#ifdef HAVE_ROW_BASED_REPLICATION if (this->prelocked_mode == NON_PRELOCKED) if (int error= binlog_flush_pending_rows_event(TRUE)) DBUG_RETURN(error); -#endif /*HAVE_ROW_BASED_REPLICATION*/ switch (qtype) { case THD::ROW_QUERY_TYPE: -#ifdef HAVE_ROW_BASED_REPLICATION if (current_stmt_binlog_row_based) DBUG_RETURN(0); -#endif /* Otherwise, we fall through */ case THD::MYSQL_QUERY_TYPE: /* @@ -2857,9 +2844,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, */ { Query_log_event qinfo(this, query, query_len, is_trans, suppress_use); -#ifdef HAVE_ROW_BASED_REPLICATION qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F; -#endif /* Binlog table maps will be irrelevant after a Query_log_event (they are just removed on the slave side) so after the query @@ -2867,9 +2852,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, table maps were written. */ int error= mysql_bin_log.write(&qinfo); -#ifdef HAVE_ROW_BASED_REPLICATION binlog_table_maps= 0; -#endif /*HAVE_ROW_BASED_REPLICATION*/ DBUG_RETURN(error); } break; diff --git a/sql/sql_class.h b/sql/sql_class.h index 94535d6f57b..c183e780c73 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -941,12 +941,12 @@ public: #ifndef MYSQL_CLIENT int binlog_setup_trx_data(); -#ifdef HAVE_ROW_BASED_REPLICATION - /* Public interface to write RBR events to the binlog */ void binlog_start_trans_and_stmt(); + int binlog_flush_transaction_cache(); + void binlog_set_stmt_begin(); int binlog_write_table_map(TABLE *table, bool is_transactional); int binlog_write_row(TABLE* table, bool is_transactional, MY_BITMAP const* cols, my_size_t colcnt, @@ -996,7 +996,6 @@ public: uint get_binlog_table_maps() const { return binlog_table_maps; } -#endif /* HAVE_ROW_BASED_REPLICATION */ #endif /* MYSQL_CLIENT */ #ifndef MYSQL_CLIENT @@ -1035,9 +1034,7 @@ public: XID xid; // transaction identifier enum xa_states xa_state; // used by external XA only XID_STATE xid_state; -#ifdef HAVE_ROW_BASED_REPLICATION Rows_log_event *m_pending_rows_event; -#endif /* Tables changed in transaction (that must be invalidated in query cache). @@ -1544,7 +1541,6 @@ public: void restore_active_arena(Query_arena *set, Query_arena *backup); inline void set_current_stmt_binlog_row_based_if_mixed() { -#ifdef HAVE_ROW_BASED_REPLICATION /* If in a stored/function trigger, the caller should already have done the change. We test in_sub_stmt to prevent introducing bugs where people @@ -1557,23 +1553,17 @@ public: if ((variables.binlog_format == BINLOG_FORMAT_MIXED) && (in_sub_stmt == 0)) current_stmt_binlog_row_based= TRUE; -#endif } inline void set_current_stmt_binlog_row_based() { -#ifdef HAVE_ROW_BASED_REPLICATION current_stmt_binlog_row_based= TRUE; -#endif } inline void clear_current_stmt_binlog_row_based() { -#ifdef HAVE_ROW_BASED_REPLICATION current_stmt_binlog_row_based= FALSE; -#endif } inline void reset_current_stmt_binlog_row_based() { -#ifdef HAVE_ROW_BASED_REPLICATION /* If there are temporary tables, don't reset back to statement-based. Indeed it could be that: @@ -1597,9 +1587,6 @@ public: current_stmt_binlog_row_based= test(variables.binlog_format == BINLOG_FORMAT_ROW); } -#else - current_stmt_binlog_row_based= FALSE; -#endif } /* diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ccacd71a614..db89cc091d4 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2277,7 +2277,6 @@ bool delayed_insert::handle_inserts(void) thd.proc_info=0; pthread_mutex_unlock(&mutex); -#ifdef HAVE_ROW_BASED_REPLICATION /* We need to flush the pending event when using row-based replication since the flushing normally done in binlog_query() is @@ -2292,7 +2291,6 @@ bool delayed_insert::handle_inserts(void) */ if (thd.current_stmt_binlog_row_based) thd.binlog_flush_pending_rows_event(TRUE); -#endif /* HAVE_ROW_BASED_REPLICATION */ if ((error=table->file->extra(HA_EXTRA_NO_CACHE))) { // This shouldn't happen @@ -2644,8 +2642,7 @@ void select_insert::send_error(uint errcode,const char *err) If the creation of the table failed (due to a syntax error, for example), no table will have been opened and therefore 'table' will be NULL. In that case, we still need to execute the rollback - and the end of the function to truncate the binary log, but we can - skip all the intermediate steps. + and the end of the function. */ if (table) { @@ -2676,10 +2673,8 @@ void select_insert::send_error(uint errcode,const char *err) if (!table->file->has_transactions()) { if (mysql_bin_log.is_open()) - { thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, table->file->has_transactions(), FALSE); - } if (!thd->current_stmt_binlog_row_based && !table->s->tmp_table && !can_rollback_data()) thd->options|= OPTION_STATUS_NO_TRANS_UPDATE; @@ -2948,7 +2943,24 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) DBUG_ENTER("select_create::prepare"); TABLEOP_HOOKS *hook_ptr= NULL; -#ifdef HAVE_ROW_BASED_REPLICATION + /* + For row-based replication, the CREATE-SELECT statement is written + in two pieces: the first one contain the CREATE TABLE statement + necessary to create the table and the second part contain the rows + that should go into the table. + + For non-temporary tables, the start of the CREATE-SELECT + implicitly commits the previous transaction, and all events + forming the statement will be stored the transaction cache. At end + of the statement, the entire statement is committed as a + transaction, and all events are written to the binary log. + + On the master, the table is locked for the duration of the + statement, but since the CREATE part is replicated as a simple + statement, there is no way to lock the table for accesses on the + slave. Hence, we have to hold on to the CREATE part of the + statement until the statement has finished. + */ class MY_HOOKS : public TABLEOP_HOOKS { public: MY_HOOKS(select_create *x) : ptr(x) { } @@ -2958,7 +2970,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) { TABLE const *const table = *tables; if (ptr->get_thd()->current_stmt_binlog_row_based && - table->s->tmp_table == NO_TMP_TABLE && + !table->s->tmp_table && !ptr->get_create_info()->table_existed) { ptr->binlog_show_create_table(tables, count); @@ -2970,22 +2982,19 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) MY_HOOKS hooks(this); hook_ptr= &hooks; -#endif unit= u; -#ifdef HAVE_ROW_BASED_REPLICATION /* - Start a statement transaction before the create if we are creating - a non-temporary table and are using row-based replication for the - statement. + Start a statement transaction before the create if we are using + row-based replication for the statement. If we are creating a + temporary table, we need to start a statement transaction. */ if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 && thd->current_stmt_binlog_row_based) { thd->binlog_start_trans_and_stmt(); } -#endif if (!(table= create_table_from_items(thd, create_info, create_table, extra_fields, keys, &values, @@ -3029,8 +3038,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) DBUG_RETURN(0); } - -#ifdef HAVE_ROW_BASED_REPLICATION void select_create::binlog_show_create_table(TABLE **tables, uint count) { @@ -3071,7 +3078,6 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) /* is_trans */ TRUE, /* suppress_use */ FALSE); } -#endif // HAVE_ROW_BASED_REPLICATION void select_create::store_values(List<Item> &values) { @@ -3082,13 +3088,35 @@ void select_create::store_values(List<Item> &values) void select_create::send_error(uint errcode,const char *err) { + DBUG_ENTER("select_create::send_error"); + + DBUG_PRINT("info", + ("Current statement %s row-based", + thd->current_stmt_binlog_row_based ? "is" : "is NOT")); + DBUG_PRINT("info", + ("Current table (at 0x%lu) %s a temporary (or non-existant) table", + table, + table && !table->s->tmp_table ? "is NOT" : "is")); + DBUG_PRINT("info", + ("Table %s prior to executing this statement", + get_create_info()->table_existed ? "existed" : "did not exist")); + /* - Disable binlog, because we "roll back" partial inserts in ::abort - by removing the table, even for non-transactional tables. + This will execute any rollbacks that are necessary before writing + the transcation cache. + + We disable the binary log since nothing should be written to the + binary log. This disabling is important, since we potentially do + a "roll back" of non-transactional tables by removing the table, + and the actual rollback might generate events that should not be + written to the binary log. + */ tmp_disable_binlog(thd); select_insert::send_error(errcode, err); reenable_binlog(thd); + + DBUG_VOID_RETURN; } @@ -3099,6 +3127,14 @@ bool select_create::send_eof() abort(); else { + /* + Do an implicit commit at end of statement for non-temporary + tables. This can fail, but we should unlock the table + nevertheless. + */ + if (!table->s->tmp_table) + ha_commit(thd); // Can fail, but we proceed anyway + table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); VOID(pthread_mutex_lock(&LOCK_open)); @@ -3117,12 +3153,31 @@ bool select_create::send_eof() void select_create::abort() { + DBUG_ENTER("select_create::abort"); VOID(pthread_mutex_lock(&LOCK_open)); + + /* + We roll back the statement, including truncating the transaction + cache of the binary log, if the statement failed. + + We roll back the statement prior to deleting the table and prior + to releasing the lock on the table, since there might be potential + for failure if the rollback is executed after the drop or after + unlocking the table. + + We also roll back the statement regardless of whether the creation + of the table succeeded or not, since we need to reset the binary + log state. + */ + if (thd->current_stmt_binlog_row_based) + ha_rollback_stmt(thd); + if (thd->extra_lock) { mysql_unlock_tables(thd, thd->extra_lock); thd->extra_lock=0; } + if (table) { table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); @@ -3134,17 +3189,8 @@ void select_create::abort() table->s->version= 0; hash_delete(&open_cache,(byte*) table); if (!create_info->table_existed) - { quick_rm_table(table_type, create_table->db, create_table->table_name, 0); - /* - We roll back the statement, including truncating the - transaction cache of the binary log, if the statement - failed. - */ - if (thd->current_stmt_binlog_row_based) - ha_rollback_stmt(thd); - } /* Tell threads waiting for refresh that something has happened */ if (version != refresh_version) broadcast_refresh(); @@ -3154,6 +3200,7 @@ void select_create::abort() table=0; // Safety } VOID(pthread_mutex_unlock(&LOCK_open)); + DBUG_VOID_RETURN; } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 18d30494701..a69e02bebfd 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1681,9 +1681,7 @@ void Query_tables_list::reset_query_tables_list(bool init) sroutines_list.empty(); sroutines_list_own_last= sroutines_list.next; sroutines_list_own_elements= 0; -#ifdef HAVE_ROW_BASED_REPLICATION binlog_row_based_if_mixed= FALSE; -#endif } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 12e41d12899..0c16c3f8415 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -821,7 +821,6 @@ public: byte **sroutines_list_own_last; uint sroutines_list_own_elements; -#ifdef HAVE_ROW_BASED_REPLICATION /* Tells if the parsing stage detected that some items require row-based binlogging to give a reliable binlog/replication, or if we will use @@ -829,7 +828,6 @@ public: binlogging. */ bool binlog_row_based_if_mixed; -#endif /* These constructor and destructor serve for creation/destruction diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 81dd710dbcb..c1c775f95b7 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -464,7 +464,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, #ifndef EMBEDDED_LIBRARY if (mysql_bin_log.is_open()) { -#ifdef HAVE_ROW_BASED_REPLICATION /* We need to do the job that is normally done inside binlog_query() here, which is to ensure that the pending event @@ -476,7 +475,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, if (thd->current_stmt_binlog_row_based) thd->binlog_flush_pending_rows_event(true); else -#endif { /* As already explained above, we need to call end_io_cache() or the last diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index 217c09d9e00..4e61c664106 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -23,17 +23,6 @@ #include "mysql_priv.h" -MY_LOCALE *my_locale_by_name(const char *name) -{ - MY_LOCALE **locale; - for( locale= my_locales; *locale != NULL; locale++) - { - if(!strcmp((*locale)->name, name)) - return *locale; - } - return NULL; -} - /***** LOCALE BEGIN ar_AE: Arabic - United Arab Emirates *****/ static const char *my_locale_month_names_ar_AE[13] = {"يناير","Ùبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوÙمبر","ديسمبر", NullS }; @@ -51,7 +40,17 @@ static TYPELIB my_locale_typelib_day_names_ar_AE = { array_elements(my_locale_day_names_ar_AE)-1, "", my_locale_day_names_ar_AE, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ar_AE = { array_elements(my_locale_ab_day_names_ar_AE)-1, "", my_locale_ab_day_names_ar_AE, NULL }; -MY_LOCALE my_locale_ar_AE ( "ar_AE", "Arabic - United Arab Emirates", FALSE, &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 my_locale_ar_AE +( + 6, + "ar_AE", + "Arabic - United Arab Emirates", + FALSE, + &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 +); /***** LOCALE END ar_AE *****/ /***** LOCALE BEGIN ar_BH: Arabic - Bahrain *****/ @@ -71,7 +70,17 @@ static TYPELIB my_locale_typelib_day_names_ar_BH = { array_elements(my_locale_day_names_ar_BH)-1, "", my_locale_day_names_ar_BH, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ar_BH = { array_elements(my_locale_ab_day_names_ar_BH)-1, "", my_locale_ab_day_names_ar_BH, NULL }; -MY_LOCALE my_locale_ar_BH ( "ar_BH", "Arabic - Bahrain", FALSE, &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 my_locale_ar_BH +( + 7, + "ar_BH", + "Arabic - Bahrain", + FALSE, + &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 +); /***** LOCALE END ar_BH *****/ /***** LOCALE BEGIN ar_JO: Arabic - Jordan *****/ @@ -91,7 +100,17 @@ static TYPELIB my_locale_typelib_day_names_ar_JO = { array_elements(my_locale_day_names_ar_JO)-1, "", my_locale_day_names_ar_JO, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ar_JO = { array_elements(my_locale_ab_day_names_ar_JO)-1, "", my_locale_ab_day_names_ar_JO, NULL }; -MY_LOCALE my_locale_ar_JO ( "ar_JO", "Arabic - Jordan", FALSE, &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 my_locale_ar_JO +( + 8, + "ar_JO", + "Arabic - Jordan", + FALSE, + &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 +); /***** LOCALE END ar_JO *****/ /***** LOCALE BEGIN ar_SA: Arabic - Saudi Arabia *****/ @@ -111,7 +130,17 @@ static TYPELIB my_locale_typelib_day_names_ar_SA = { array_elements(my_locale_day_names_ar_SA)-1, "", my_locale_day_names_ar_SA, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ar_SA = { array_elements(my_locale_ab_day_names_ar_SA)-1, "", my_locale_ab_day_names_ar_SA, NULL }; -MY_LOCALE my_locale_ar_SA ( "ar_SA", "Arabic - Saudi Arabia", FALSE, &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 my_locale_ar_SA +( + 9, + "ar_SA", + "Arabic - Saudi Arabia", + FALSE, + &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 +); /***** LOCALE END ar_SA *****/ /***** LOCALE BEGIN ar_SY: Arabic - Syria *****/ @@ -131,7 +160,17 @@ static TYPELIB my_locale_typelib_day_names_ar_SY = { array_elements(my_locale_day_names_ar_SY)-1, "", my_locale_day_names_ar_SY, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ar_SY = { array_elements(my_locale_ab_day_names_ar_SY)-1, "", my_locale_ab_day_names_ar_SY, NULL }; -MY_LOCALE my_locale_ar_SY ( "ar_SY", "Arabic - Syria", FALSE, &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 my_locale_ar_SY +( + 10, + "ar_SY", + "Arabic - Syria", + FALSE, + &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 +); /***** LOCALE END ar_SY *****/ /***** LOCALE BEGIN be_BY: Belarusian - Belarus *****/ @@ -151,7 +190,17 @@ static TYPELIB my_locale_typelib_day_names_be_BY = { array_elements(my_locale_day_names_be_BY)-1, "", my_locale_day_names_be_BY, NULL }; static TYPELIB my_locale_typelib_ab_day_names_be_BY = { array_elements(my_locale_ab_day_names_be_BY)-1, "", my_locale_ab_day_names_be_BY, NULL }; -MY_LOCALE my_locale_be_BY ( "be_BY", "Belarusian - Belarus", FALSE, &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 my_locale_be_BY +( + 11, + "be_BY", + "Belarusian - Belarus", + FALSE, + &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 +); /***** LOCALE END be_BY *****/ /***** LOCALE BEGIN bg_BG: Bulgarian - Bulgaria *****/ @@ -171,7 +220,17 @@ static TYPELIB my_locale_typelib_day_names_bg_BG = { array_elements(my_locale_day_names_bg_BG)-1, "", my_locale_day_names_bg_BG, NULL }; static TYPELIB my_locale_typelib_ab_day_names_bg_BG = { array_elements(my_locale_ab_day_names_bg_BG)-1, "", my_locale_ab_day_names_bg_BG, NULL }; -MY_LOCALE my_locale_bg_BG ( "bg_BG", "Bulgarian - Bulgaria", FALSE, &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 my_locale_bg_BG +( + 12, + "bg_BG", + "Bulgarian - Bulgaria", + FALSE, + &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 +); /***** LOCALE END bg_BG *****/ /***** LOCALE BEGIN ca_ES: Catalan - Catalan *****/ @@ -191,7 +250,17 @@ static TYPELIB my_locale_typelib_day_names_ca_ES = { array_elements(my_locale_day_names_ca_ES)-1, "", my_locale_day_names_ca_ES, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ca_ES = { array_elements(my_locale_ab_day_names_ca_ES)-1, "", my_locale_ab_day_names_ca_ES, NULL }; -MY_LOCALE my_locale_ca_ES ( "ca_ES", "Catalan - Catalan", FALSE, &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 my_locale_ca_ES +( + 13, + "ca_ES", + "Catalan - Catalan", + FALSE, + &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 +); /***** LOCALE END ca_ES *****/ /***** LOCALE BEGIN cs_CZ: Czech - Czech Republic *****/ @@ -211,7 +280,17 @@ static TYPELIB my_locale_typelib_day_names_cs_CZ = { array_elements(my_locale_day_names_cs_CZ)-1, "", my_locale_day_names_cs_CZ, NULL }; static TYPELIB my_locale_typelib_ab_day_names_cs_CZ = { array_elements(my_locale_ab_day_names_cs_CZ)-1, "", my_locale_ab_day_names_cs_CZ, NULL }; -MY_LOCALE my_locale_cs_CZ ( "cs_CZ", "Czech - Czech Republic", FALSE, &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 my_locale_cs_CZ +( + 14, + "cs_CZ", + "Czech - Czech Republic", + FALSE, + &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 +); /***** LOCALE END cs_CZ *****/ /***** LOCALE BEGIN da_DK: Danish - Denmark *****/ @@ -231,7 +310,17 @@ static TYPELIB my_locale_typelib_day_names_da_DK = { array_elements(my_locale_day_names_da_DK)-1, "", my_locale_day_names_da_DK, NULL }; static TYPELIB my_locale_typelib_ab_day_names_da_DK = { array_elements(my_locale_ab_day_names_da_DK)-1, "", my_locale_ab_day_names_da_DK, NULL }; -MY_LOCALE my_locale_da_DK ( "da_DK", "Danish - Denmark", FALSE, &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 my_locale_da_DK +( + 15, + "da_DK", + "Danish - Denmark", + FALSE, + &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 +); /***** LOCALE END da_DK *****/ /***** LOCALE BEGIN de_AT: German - Austria *****/ @@ -251,7 +340,17 @@ static TYPELIB my_locale_typelib_day_names_de_AT = { array_elements(my_locale_day_names_de_AT)-1, "", my_locale_day_names_de_AT, NULL }; static TYPELIB my_locale_typelib_ab_day_names_de_AT = { array_elements(my_locale_ab_day_names_de_AT)-1, "", my_locale_ab_day_names_de_AT, NULL }; -MY_LOCALE my_locale_de_AT ( "de_AT", "German - Austria", FALSE, &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 my_locale_de_AT +( + 16, + "de_AT", + "German - Austria", + FALSE, + &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 +); /***** LOCALE END de_AT *****/ /***** LOCALE BEGIN de_DE: German - Germany *****/ @@ -271,7 +370,17 @@ static TYPELIB my_locale_typelib_day_names_de_DE = { array_elements(my_locale_day_names_de_DE)-1, "", my_locale_day_names_de_DE, NULL }; static TYPELIB my_locale_typelib_ab_day_names_de_DE = { array_elements(my_locale_ab_day_names_de_DE)-1, "", my_locale_ab_day_names_de_DE, NULL }; -MY_LOCALE my_locale_de_DE ( "de_DE", "German - Germany", FALSE, &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 my_locale_de_DE +( + 4, + "de_DE", + "German - Germany", + FALSE, + &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 +); /***** LOCALE END de_DE *****/ /***** LOCALE BEGIN en_US: English - United States *****/ @@ -291,7 +400,17 @@ static TYPELIB my_locale_typelib_day_names_en_US = { array_elements(my_locale_day_names_en_US)-1, "", my_locale_day_names_en_US, NULL }; static TYPELIB my_locale_typelib_ab_day_names_en_US = { array_elements(my_locale_ab_day_names_en_US)-1, "", my_locale_ab_day_names_en_US, NULL }; -MY_LOCALE my_locale_en_US ( "en_US", "English - United States", TRUE, &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 my_locale_en_US +( + 0, + "en_US", + "English - United States", + TRUE, + &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 +); /***** LOCALE END en_US *****/ /***** LOCALE BEGIN es_ES: Spanish - Spain *****/ @@ -311,7 +430,17 @@ static TYPELIB my_locale_typelib_day_names_es_ES = { array_elements(my_locale_day_names_es_ES)-1, "", my_locale_day_names_es_ES, NULL }; static TYPELIB my_locale_typelib_ab_day_names_es_ES = { array_elements(my_locale_ab_day_names_es_ES)-1, "", my_locale_ab_day_names_es_ES, NULL }; -MY_LOCALE my_locale_es_ES ( "es_ES", "Spanish - Spain", FALSE, &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 my_locale_es_ES +( + 17, + "es_ES", + "Spanish - Spain", + FALSE, + &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 +); /***** LOCALE END es_ES *****/ /***** LOCALE BEGIN et_EE: Estonian - Estonia *****/ @@ -331,7 +460,17 @@ static TYPELIB my_locale_typelib_day_names_et_EE = { array_elements(my_locale_day_names_et_EE)-1, "", my_locale_day_names_et_EE, NULL }; static TYPELIB my_locale_typelib_ab_day_names_et_EE = { array_elements(my_locale_ab_day_names_et_EE)-1, "", my_locale_ab_day_names_et_EE, NULL }; -MY_LOCALE my_locale_et_EE ( "et_EE", "Estonian - Estonia", FALSE, &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 my_locale_et_EE +( + 18, + "et_EE", + "Estonian - Estonia", + FALSE, + &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 +); /***** LOCALE END et_EE *****/ /***** LOCALE BEGIN eu_ES: Basque - Basque *****/ @@ -351,7 +490,17 @@ static TYPELIB my_locale_typelib_day_names_eu_ES = { array_elements(my_locale_day_names_eu_ES)-1, "", my_locale_day_names_eu_ES, NULL }; static TYPELIB my_locale_typelib_ab_day_names_eu_ES = { array_elements(my_locale_ab_day_names_eu_ES)-1, "", my_locale_ab_day_names_eu_ES, NULL }; -MY_LOCALE my_locale_eu_ES ( "eu_ES", "Basque - Basque", TRUE, &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 my_locale_eu_ES +( + 19, + "eu_ES", + "Basque - Basque", + TRUE, + &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 +); /***** LOCALE END eu_ES *****/ /***** LOCALE BEGIN fi_FI: Finnish - Finland *****/ @@ -371,7 +520,17 @@ static TYPELIB my_locale_typelib_day_names_fi_FI = { array_elements(my_locale_day_names_fi_FI)-1, "", my_locale_day_names_fi_FI, NULL }; static TYPELIB my_locale_typelib_ab_day_names_fi_FI = { array_elements(my_locale_ab_day_names_fi_FI)-1, "", my_locale_ab_day_names_fi_FI, NULL }; -MY_LOCALE my_locale_fi_FI ( "fi_FI", "Finnish - Finland", FALSE, &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 my_locale_fi_FI +( + 20, + "fi_FI", + "Finnish - Finland", + FALSE, + &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 +); /***** LOCALE END fi_FI *****/ /***** LOCALE BEGIN fo_FO: Faroese - Faroe Islands *****/ @@ -391,7 +550,17 @@ static TYPELIB my_locale_typelib_day_names_fo_FO = { array_elements(my_locale_day_names_fo_FO)-1, "", my_locale_day_names_fo_FO, NULL }; static TYPELIB my_locale_typelib_ab_day_names_fo_FO = { array_elements(my_locale_ab_day_names_fo_FO)-1, "", my_locale_ab_day_names_fo_FO, NULL }; -MY_LOCALE my_locale_fo_FO ( "fo_FO", "Faroese - Faroe Islands", FALSE, &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 my_locale_fo_FO +( + 21, + "fo_FO", + "Faroese - Faroe Islands", + FALSE, + &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 +); /***** LOCALE END fo_FO *****/ /***** LOCALE BEGIN fr_FR: French - France *****/ @@ -411,7 +580,17 @@ static TYPELIB my_locale_typelib_day_names_fr_FR = { array_elements(my_locale_day_names_fr_FR)-1, "", my_locale_day_names_fr_FR, NULL }; static TYPELIB my_locale_typelib_ab_day_names_fr_FR = { array_elements(my_locale_ab_day_names_fr_FR)-1, "", my_locale_ab_day_names_fr_FR, NULL }; -MY_LOCALE my_locale_fr_FR ( "fr_FR", "French - France", FALSE, &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 my_locale_fr_FR +( + 5, + "fr_FR", + "French - France", + FALSE, + &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 +); /***** LOCALE END fr_FR *****/ /***** LOCALE BEGIN gl_ES: Galician - Galician *****/ @@ -431,7 +610,17 @@ static TYPELIB my_locale_typelib_day_names_gl_ES = { array_elements(my_locale_day_names_gl_ES)-1, "", my_locale_day_names_gl_ES, NULL }; static TYPELIB my_locale_typelib_ab_day_names_gl_ES = { array_elements(my_locale_ab_day_names_gl_ES)-1, "", my_locale_ab_day_names_gl_ES, NULL }; -MY_LOCALE my_locale_gl_ES ( "gl_ES", "Galician - Galician", FALSE, &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 my_locale_gl_ES +( + 22, + "gl_ES", + "Galician - Galician", + FALSE, + &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 +); /***** LOCALE END gl_ES *****/ /***** LOCALE BEGIN gu_IN: Gujarati - India *****/ @@ -451,7 +640,17 @@ static TYPELIB my_locale_typelib_day_names_gu_IN = { array_elements(my_locale_day_names_gu_IN)-1, "", my_locale_day_names_gu_IN, NULL }; static TYPELIB my_locale_typelib_ab_day_names_gu_IN = { array_elements(my_locale_ab_day_names_gu_IN)-1, "", my_locale_ab_day_names_gu_IN, NULL }; -MY_LOCALE my_locale_gu_IN ( "gu_IN", "Gujarati - India", FALSE, &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 my_locale_gu_IN +( + 23, + "gu_IN", + "Gujarati - India", + FALSE, + &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 +); /***** LOCALE END gu_IN *****/ /***** LOCALE BEGIN he_IL: Hebrew - Israel *****/ @@ -471,7 +670,17 @@ static TYPELIB my_locale_typelib_day_names_he_IL = { array_elements(my_locale_day_names_he_IL)-1, "", my_locale_day_names_he_IL, NULL }; static TYPELIB my_locale_typelib_ab_day_names_he_IL = { array_elements(my_locale_ab_day_names_he_IL)-1, "", my_locale_ab_day_names_he_IL, NULL }; -MY_LOCALE my_locale_he_IL ( "he_IL", "Hebrew - Israel", FALSE, &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 my_locale_he_IL +( + 24, + "he_IL", + "Hebrew - Israel", + FALSE, + &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 +); /***** LOCALE END he_IL *****/ /***** LOCALE BEGIN hi_IN: Hindi - India *****/ @@ -491,7 +700,17 @@ static TYPELIB my_locale_typelib_day_names_hi_IN = { array_elements(my_locale_day_names_hi_IN)-1, "", my_locale_day_names_hi_IN, NULL }; static TYPELIB my_locale_typelib_ab_day_names_hi_IN = { array_elements(my_locale_ab_day_names_hi_IN)-1, "", my_locale_ab_day_names_hi_IN, NULL }; -MY_LOCALE my_locale_hi_IN ( "hi_IN", "Hindi - India", FALSE, &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 my_locale_hi_IN +( + 25, + "hi_IN", + "Hindi - India", + FALSE, + &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 +); /***** LOCALE END hi_IN *****/ /***** LOCALE BEGIN hr_HR: Croatian - Croatia *****/ @@ -511,7 +730,17 @@ static TYPELIB my_locale_typelib_day_names_hr_HR = { array_elements(my_locale_day_names_hr_HR)-1, "", my_locale_day_names_hr_HR, NULL }; static TYPELIB my_locale_typelib_ab_day_names_hr_HR = { array_elements(my_locale_ab_day_names_hr_HR)-1, "", my_locale_ab_day_names_hr_HR, NULL }; -MY_LOCALE my_locale_hr_HR ( "hr_HR", "Croatian - Croatia", FALSE, &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 my_locale_hr_HR +( + 26, + "hr_HR", + "Croatian - Croatia", + FALSE, + &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 +); /***** LOCALE END hr_HR *****/ /***** LOCALE BEGIN hu_HU: Hungarian - Hungary *****/ @@ -531,7 +760,17 @@ static TYPELIB my_locale_typelib_day_names_hu_HU = { array_elements(my_locale_day_names_hu_HU)-1, "", my_locale_day_names_hu_HU, NULL }; static TYPELIB my_locale_typelib_ab_day_names_hu_HU = { array_elements(my_locale_ab_day_names_hu_HU)-1, "", my_locale_ab_day_names_hu_HU, NULL }; -MY_LOCALE my_locale_hu_HU ( "hu_HU", "Hungarian - Hungary", FALSE, &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 my_locale_hu_HU +( + 27, + "hu_HU", + "Hungarian - Hungary", + FALSE, + &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 +); /***** LOCALE END hu_HU *****/ /***** LOCALE BEGIN id_ID: Indonesian - Indonesia *****/ @@ -551,7 +790,17 @@ static TYPELIB my_locale_typelib_day_names_id_ID = { array_elements(my_locale_day_names_id_ID)-1, "", my_locale_day_names_id_ID, NULL }; static TYPELIB my_locale_typelib_ab_day_names_id_ID = { array_elements(my_locale_ab_day_names_id_ID)-1, "", my_locale_ab_day_names_id_ID, NULL }; -MY_LOCALE my_locale_id_ID ( "id_ID", "Indonesian - Indonesia", TRUE, &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 my_locale_id_ID +( + 28, + "id_ID", + "Indonesian - Indonesia", + TRUE, + &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 +); /***** LOCALE END id_ID *****/ /***** LOCALE BEGIN is_IS: Icelandic - Iceland *****/ @@ -571,7 +820,17 @@ static TYPELIB my_locale_typelib_day_names_is_IS = { array_elements(my_locale_day_names_is_IS)-1, "", my_locale_day_names_is_IS, NULL }; static TYPELIB my_locale_typelib_ab_day_names_is_IS = { array_elements(my_locale_ab_day_names_is_IS)-1, "", my_locale_ab_day_names_is_IS, NULL }; -MY_LOCALE my_locale_is_IS ( "is_IS", "Icelandic - Iceland", FALSE, &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 my_locale_is_IS +( + 29, + "is_IS", + "Icelandic - Iceland", + FALSE, + &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 +); /***** LOCALE END is_IS *****/ /***** LOCALE BEGIN it_CH: Italian - Switzerland *****/ @@ -591,7 +850,17 @@ static TYPELIB my_locale_typelib_day_names_it_CH = { array_elements(my_locale_day_names_it_CH)-1, "", my_locale_day_names_it_CH, NULL }; static TYPELIB my_locale_typelib_ab_day_names_it_CH = { array_elements(my_locale_ab_day_names_it_CH)-1, "", my_locale_ab_day_names_it_CH, NULL }; -MY_LOCALE my_locale_it_CH ( "it_CH", "Italian - Switzerland", FALSE, &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 my_locale_it_CH +( + 30, + "it_CH", + "Italian - Switzerland", + FALSE, + &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 +); /***** LOCALE END it_CH *****/ /***** LOCALE BEGIN ja_JP: Japanese - Japan *****/ @@ -611,7 +880,17 @@ static TYPELIB my_locale_typelib_day_names_ja_JP = { array_elements(my_locale_day_names_ja_JP)-1, "", my_locale_day_names_ja_JP, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ja_JP = { array_elements(my_locale_ab_day_names_ja_JP)-1, "", my_locale_ab_day_names_ja_JP, NULL }; -MY_LOCALE my_locale_ja_JP ( "ja_JP", "Japanese - Japan", FALSE, &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 my_locale_ja_JP +( + 2, + "ja_JP", + "Japanese - Japan", + FALSE, + &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 +); /***** LOCALE END ja_JP *****/ /***** LOCALE BEGIN ko_KR: Korean - Korea *****/ @@ -631,7 +910,17 @@ static TYPELIB my_locale_typelib_day_names_ko_KR = { array_elements(my_locale_day_names_ko_KR)-1, "", my_locale_day_names_ko_KR, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ko_KR = { array_elements(my_locale_ab_day_names_ko_KR)-1, "", my_locale_ab_day_names_ko_KR, NULL }; -MY_LOCALE my_locale_ko_KR ( "ko_KR", "Korean - Korea", FALSE, &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 my_locale_ko_KR +( + 31, + "ko_KR", + "Korean - Korea", + FALSE, + &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 +); /***** LOCALE END ko_KR *****/ /***** LOCALE BEGIN lt_LT: Lithuanian - Lithuania *****/ @@ -651,7 +940,17 @@ static TYPELIB my_locale_typelib_day_names_lt_LT = { array_elements(my_locale_day_names_lt_LT)-1, "", my_locale_day_names_lt_LT, NULL }; static TYPELIB my_locale_typelib_ab_day_names_lt_LT = { array_elements(my_locale_ab_day_names_lt_LT)-1, "", my_locale_ab_day_names_lt_LT, NULL }; -MY_LOCALE my_locale_lt_LT ( "lt_LT", "Lithuanian - Lithuania", FALSE, &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 my_locale_lt_LT +( + 32, + "lt_LT", + "Lithuanian - Lithuania", + FALSE, + &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 +); /***** LOCALE END lt_LT *****/ /***** LOCALE BEGIN lv_LV: Latvian - Latvia *****/ @@ -671,7 +970,17 @@ static TYPELIB my_locale_typelib_day_names_lv_LV = { array_elements(my_locale_day_names_lv_LV)-1, "", my_locale_day_names_lv_LV, NULL }; static TYPELIB my_locale_typelib_ab_day_names_lv_LV = { array_elements(my_locale_ab_day_names_lv_LV)-1, "", my_locale_ab_day_names_lv_LV, NULL }; -MY_LOCALE my_locale_lv_LV ( "lv_LV", "Latvian - Latvia", FALSE, &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 my_locale_lv_LV +( + 33, + "lv_LV", + "Latvian - Latvia", + FALSE, + &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 +); /***** LOCALE END lv_LV *****/ /***** LOCALE BEGIN mk_MK: Macedonian - FYROM *****/ @@ -691,7 +1000,17 @@ static TYPELIB my_locale_typelib_day_names_mk_MK = { array_elements(my_locale_day_names_mk_MK)-1, "", my_locale_day_names_mk_MK, NULL }; static TYPELIB my_locale_typelib_ab_day_names_mk_MK = { array_elements(my_locale_ab_day_names_mk_MK)-1, "", my_locale_ab_day_names_mk_MK, NULL }; -MY_LOCALE my_locale_mk_MK ( "mk_MK", "Macedonian - FYROM", FALSE, &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 my_locale_mk_MK +( + 34, + "mk_MK", + "Macedonian - FYROM", + FALSE, + &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 +); /***** LOCALE END mk_MK *****/ /***** LOCALE BEGIN mn_MN: Mongolia - Mongolian *****/ @@ -711,7 +1030,17 @@ static TYPELIB my_locale_typelib_day_names_mn_MN = { array_elements(my_locale_day_names_mn_MN)-1, "", my_locale_day_names_mn_MN, NULL }; static TYPELIB my_locale_typelib_ab_day_names_mn_MN = { array_elements(my_locale_ab_day_names_mn_MN)-1, "", my_locale_ab_day_names_mn_MN, NULL }; -MY_LOCALE my_locale_mn_MN ( "mn_MN", "Mongolia - Mongolian", FALSE, &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 my_locale_mn_MN +( + 35, + "mn_MN", + "Mongolia - Mongolian", + FALSE, + &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 +); /***** LOCALE END mn_MN *****/ /***** LOCALE BEGIN ms_MY: Malay - Malaysia *****/ @@ -731,7 +1060,17 @@ static TYPELIB my_locale_typelib_day_names_ms_MY = { array_elements(my_locale_day_names_ms_MY)-1, "", my_locale_day_names_ms_MY, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ms_MY = { array_elements(my_locale_ab_day_names_ms_MY)-1, "", my_locale_ab_day_names_ms_MY, NULL }; -MY_LOCALE my_locale_ms_MY ( "ms_MY", "Malay - Malaysia", TRUE, &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 my_locale_ms_MY +( + 36, + "ms_MY", + "Malay - Malaysia", + TRUE, + &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 +); /***** LOCALE END ms_MY *****/ /***** LOCALE BEGIN nb_NO: Norwegian(Bokml) - Norway *****/ @@ -751,7 +1090,17 @@ static TYPELIB my_locale_typelib_day_names_nb_NO = { array_elements(my_locale_day_names_nb_NO)-1, "", my_locale_day_names_nb_NO, NULL }; static TYPELIB my_locale_typelib_ab_day_names_nb_NO = { array_elements(my_locale_ab_day_names_nb_NO)-1, "", my_locale_ab_day_names_nb_NO, NULL }; -MY_LOCALE my_locale_nb_NO ( "nb_NO", "Norwegian(Bokml) - Norway", FALSE, &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 my_locale_nb_NO +( + 37, + "nb_NO", + "Norwegian(Bokml) - Norway", + FALSE, + &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 +); /***** LOCALE END nb_NO *****/ /***** LOCALE BEGIN nl_NL: Dutch - The Netherlands *****/ @@ -771,7 +1120,17 @@ static TYPELIB my_locale_typelib_day_names_nl_NL = { array_elements(my_locale_day_names_nl_NL)-1, "", my_locale_day_names_nl_NL, NULL }; static TYPELIB my_locale_typelib_ab_day_names_nl_NL = { array_elements(my_locale_ab_day_names_nl_NL)-1, "", my_locale_ab_day_names_nl_NL, NULL }; -MY_LOCALE my_locale_nl_NL ( "nl_NL", "Dutch - The Netherlands", TRUE, &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 my_locale_nl_NL +( + 38, + "nl_NL", + "Dutch - The Netherlands", + TRUE, + &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 +); /***** LOCALE END nl_NL *****/ /***** LOCALE BEGIN pl_PL: Polish - Poland *****/ @@ -791,7 +1150,17 @@ static TYPELIB my_locale_typelib_day_names_pl_PL = { array_elements(my_locale_day_names_pl_PL)-1, "", my_locale_day_names_pl_PL, NULL }; static TYPELIB my_locale_typelib_ab_day_names_pl_PL = { array_elements(my_locale_ab_day_names_pl_PL)-1, "", my_locale_ab_day_names_pl_PL, NULL }; -MY_LOCALE my_locale_pl_PL ( "pl_PL", "Polish - Poland", FALSE, &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 my_locale_pl_PL +( + 39, + "pl_PL", + "Polish - Poland", + FALSE, + &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 +); /***** LOCALE END pl_PL *****/ /***** LOCALE BEGIN pt_BR: Portugese - Brazil *****/ @@ -811,7 +1180,17 @@ static TYPELIB my_locale_typelib_day_names_pt_BR = { array_elements(my_locale_day_names_pt_BR)-1, "", my_locale_day_names_pt_BR, NULL }; static TYPELIB my_locale_typelib_ab_day_names_pt_BR = { array_elements(my_locale_ab_day_names_pt_BR)-1, "", my_locale_ab_day_names_pt_BR, NULL }; -MY_LOCALE my_locale_pt_BR ( "pt_BR", "Portugese - Brazil", FALSE, &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 my_locale_pt_BR +( + 40, + "pt_BR", + "Portugese - Brazil", + FALSE, + &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 +); /***** LOCALE END pt_BR *****/ /***** LOCALE BEGIN pt_PT: Portugese - Portugal *****/ @@ -831,7 +1210,17 @@ static TYPELIB my_locale_typelib_day_names_pt_PT = { array_elements(my_locale_day_names_pt_PT)-1, "", my_locale_day_names_pt_PT, NULL }; static TYPELIB my_locale_typelib_ab_day_names_pt_PT = { array_elements(my_locale_ab_day_names_pt_PT)-1, "", my_locale_ab_day_names_pt_PT, NULL }; -MY_LOCALE my_locale_pt_PT ( "pt_PT", "Portugese - Portugal", FALSE, &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 my_locale_pt_PT +( + 41, + "pt_PT", + "Portugese - Portugal", + FALSE, + &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 +); /***** LOCALE END pt_PT *****/ /***** LOCALE BEGIN ro_RO: Romanian - Romania *****/ @@ -851,7 +1240,17 @@ static TYPELIB my_locale_typelib_day_names_ro_RO = { array_elements(my_locale_day_names_ro_RO)-1, "", my_locale_day_names_ro_RO, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ro_RO = { array_elements(my_locale_ab_day_names_ro_RO)-1, "", my_locale_ab_day_names_ro_RO, NULL }; -MY_LOCALE my_locale_ro_RO ( "ro_RO", "Romanian - Romania", FALSE, &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 my_locale_ro_RO +( + 42, + "ro_RO", + "Romanian - Romania", + FALSE, + &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 +); /***** LOCALE END ro_RO *****/ /***** LOCALE BEGIN ru_RU: Russian - Russia *****/ @@ -871,7 +1270,17 @@ static TYPELIB my_locale_typelib_day_names_ru_RU = { array_elements(my_locale_day_names_ru_RU)-1, "", my_locale_day_names_ru_RU, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ru_RU = { array_elements(my_locale_ab_day_names_ru_RU)-1, "", my_locale_ab_day_names_ru_RU, NULL }; -MY_LOCALE my_locale_ru_RU ( "ru_RU", "Russian - Russia", FALSE, &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 my_locale_ru_RU +( + 43, + "ru_RU", + "Russian - Russia", + FALSE, + &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 +); /***** LOCALE END ru_RU *****/ /***** LOCALE BEGIN ru_UA: Russian - Ukraine *****/ @@ -891,7 +1300,17 @@ static TYPELIB my_locale_typelib_day_names_ru_UA = { array_elements(my_locale_day_names_ru_UA)-1, "", my_locale_day_names_ru_UA, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ru_UA = { array_elements(my_locale_ab_day_names_ru_UA)-1, "", my_locale_ab_day_names_ru_UA, NULL }; -MY_LOCALE my_locale_ru_UA ( "ru_UA", "Russian - Ukraine", FALSE, &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 my_locale_ru_UA +( + 44, + "ru_UA", + "Russian - Ukraine", + FALSE, + &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 +); /***** LOCALE END ru_UA *****/ /***** LOCALE BEGIN sk_SK: Slovak - Slovakia *****/ @@ -911,7 +1330,17 @@ static TYPELIB my_locale_typelib_day_names_sk_SK = { array_elements(my_locale_day_names_sk_SK)-1, "", my_locale_day_names_sk_SK, NULL }; static TYPELIB my_locale_typelib_ab_day_names_sk_SK = { array_elements(my_locale_ab_day_names_sk_SK)-1, "", my_locale_ab_day_names_sk_SK, NULL }; -MY_LOCALE my_locale_sk_SK ( "sk_SK", "Slovak - Slovakia", FALSE, &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 my_locale_sk_SK +( + 45, + "sk_SK", + "Slovak - Slovakia", + FALSE, + &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 +); /***** LOCALE END sk_SK *****/ /***** LOCALE BEGIN sl_SI: Slovenian - Slovenia *****/ @@ -931,7 +1360,17 @@ static TYPELIB my_locale_typelib_day_names_sl_SI = { array_elements(my_locale_day_names_sl_SI)-1, "", my_locale_day_names_sl_SI, NULL }; static TYPELIB my_locale_typelib_ab_day_names_sl_SI = { array_elements(my_locale_ab_day_names_sl_SI)-1, "", my_locale_ab_day_names_sl_SI, NULL }; -MY_LOCALE my_locale_sl_SI ( "sl_SI", "Slovenian - Slovenia", FALSE, &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 my_locale_sl_SI +( + 46, + "sl_SI", + "Slovenian - Slovenia", + FALSE, + &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 +); /***** LOCALE END sl_SI *****/ /***** LOCALE BEGIN sq_AL: Albanian - Albania *****/ @@ -951,7 +1390,17 @@ static TYPELIB my_locale_typelib_day_names_sq_AL = { array_elements(my_locale_day_names_sq_AL)-1, "", my_locale_day_names_sq_AL, NULL }; static TYPELIB my_locale_typelib_ab_day_names_sq_AL = { array_elements(my_locale_ab_day_names_sq_AL)-1, "", my_locale_ab_day_names_sq_AL, NULL }; -MY_LOCALE my_locale_sq_AL ( "sq_AL", "Albanian - Albania", FALSE, &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 my_locale_sq_AL +( + 47, + "sq_AL", + "Albanian - Albania", + FALSE, + &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 +); /***** LOCALE END sq_AL *****/ /***** LOCALE BEGIN sr_YU: Servian - Yugoslavia *****/ @@ -971,7 +1420,17 @@ static TYPELIB my_locale_typelib_day_names_sr_YU = { array_elements(my_locale_day_names_sr_YU)-1, "", my_locale_day_names_sr_YU, NULL }; static TYPELIB my_locale_typelib_ab_day_names_sr_YU = { array_elements(my_locale_ab_day_names_sr_YU)-1, "", my_locale_ab_day_names_sr_YU, NULL }; -MY_LOCALE my_locale_sr_YU ( "sr_YU", "Servian - Yugoslavia", FALSE, &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 my_locale_sr_YU +( + 48, + "sr_YU", + "Servian - Yugoslavia", + FALSE, + &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 +); /***** LOCALE END sr_YU *****/ /***** LOCALE BEGIN sv_SE: Swedish - Sweden *****/ @@ -991,7 +1450,17 @@ static TYPELIB my_locale_typelib_day_names_sv_SE = { array_elements(my_locale_day_names_sv_SE)-1, "", my_locale_day_names_sv_SE, NULL }; static TYPELIB my_locale_typelib_ab_day_names_sv_SE = { array_elements(my_locale_ab_day_names_sv_SE)-1, "", my_locale_ab_day_names_sv_SE, NULL }; -MY_LOCALE my_locale_sv_SE ( "sv_SE", "Swedish - Sweden", FALSE, &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 my_locale_sv_SE +( + 3, + "sv_SE", + "Swedish - Sweden", + FALSE, + &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 +); /***** LOCALE END sv_SE *****/ /***** LOCALE BEGIN ta_IN: Tamil - India *****/ @@ -1011,7 +1480,17 @@ static TYPELIB my_locale_typelib_day_names_ta_IN = { array_elements(my_locale_day_names_ta_IN)-1, "", my_locale_day_names_ta_IN, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ta_IN = { array_elements(my_locale_ab_day_names_ta_IN)-1, "", my_locale_ab_day_names_ta_IN, NULL }; -MY_LOCALE my_locale_ta_IN ( "ta_IN", "Tamil - India", FALSE, &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 my_locale_ta_IN +( + 49, + "ta_IN", + "Tamil - India", + FALSE, + &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 +); /***** LOCALE END ta_IN *****/ /***** LOCALE BEGIN te_IN: Telugu - India *****/ @@ -1031,7 +1510,17 @@ static TYPELIB my_locale_typelib_day_names_te_IN = { array_elements(my_locale_day_names_te_IN)-1, "", my_locale_day_names_te_IN, NULL }; static TYPELIB my_locale_typelib_ab_day_names_te_IN = { array_elements(my_locale_ab_day_names_te_IN)-1, "", my_locale_ab_day_names_te_IN, NULL }; -MY_LOCALE my_locale_te_IN ( "te_IN", "Telugu - India", FALSE, &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 my_locale_te_IN +( + 50, + "te_IN", + "Telugu - India", + FALSE, + &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 +); /***** LOCALE END te_IN *****/ /***** LOCALE BEGIN th_TH: Thai - Thailand *****/ @@ -1051,7 +1540,17 @@ static TYPELIB my_locale_typelib_day_names_th_TH = { array_elements(my_locale_day_names_th_TH)-1, "", my_locale_day_names_th_TH, NULL }; static TYPELIB my_locale_typelib_ab_day_names_th_TH = { array_elements(my_locale_ab_day_names_th_TH)-1, "", my_locale_ab_day_names_th_TH, NULL }; -MY_LOCALE my_locale_th_TH ( "th_TH", "Thai - Thailand", FALSE, &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 my_locale_th_TH +( + 51, + "th_TH", + "Thai - Thailand", + FALSE, + &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 +); /***** LOCALE END th_TH *****/ /***** LOCALE BEGIN tr_TR: Turkish - Turkey *****/ @@ -1071,7 +1570,17 @@ static TYPELIB my_locale_typelib_day_names_tr_TR = { array_elements(my_locale_day_names_tr_TR)-1, "", my_locale_day_names_tr_TR, NULL }; static TYPELIB my_locale_typelib_ab_day_names_tr_TR = { array_elements(my_locale_ab_day_names_tr_TR)-1, "", my_locale_ab_day_names_tr_TR, NULL }; -MY_LOCALE my_locale_tr_TR ( "tr_TR", "Turkish - Turkey", FALSE, &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 my_locale_tr_TR +( + 52, + "tr_TR", + "Turkish - Turkey", + FALSE, + &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 +); /***** LOCALE END tr_TR *****/ /***** LOCALE BEGIN uk_UA: Ukrainian - Ukraine *****/ @@ -1091,7 +1600,17 @@ static TYPELIB my_locale_typelib_day_names_uk_UA = { array_elements(my_locale_day_names_uk_UA)-1, "", my_locale_day_names_uk_UA, NULL }; static TYPELIB my_locale_typelib_ab_day_names_uk_UA = { array_elements(my_locale_ab_day_names_uk_UA)-1, "", my_locale_ab_day_names_uk_UA, NULL }; -MY_LOCALE my_locale_uk_UA ( "uk_UA", "Ukrainian - Ukraine", FALSE, &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 my_locale_uk_UA +( + 53, + "uk_UA", + "Ukrainian - Ukraine", + FALSE, + &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 +); /***** LOCALE END uk_UA *****/ /***** LOCALE BEGIN ur_PK: Urdu - Pakistan *****/ @@ -1111,7 +1630,17 @@ static TYPELIB my_locale_typelib_day_names_ur_PK = { array_elements(my_locale_day_names_ur_PK)-1, "", my_locale_day_names_ur_PK, NULL }; static TYPELIB my_locale_typelib_ab_day_names_ur_PK = { array_elements(my_locale_ab_day_names_ur_PK)-1, "", my_locale_ab_day_names_ur_PK, NULL }; -MY_LOCALE my_locale_ur_PK ( "ur_PK", "Urdu - Pakistan", FALSE, &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 my_locale_ur_PK +( + 54, + "ur_PK", + "Urdu - Pakistan", + FALSE, + &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 +); /***** LOCALE END ur_PK *****/ /***** LOCALE BEGIN vi_VN: Vietnamese - Vietnam *****/ @@ -1131,7 +1660,17 @@ static TYPELIB my_locale_typelib_day_names_vi_VN = { array_elements(my_locale_day_names_vi_VN)-1, "", my_locale_day_names_vi_VN, NULL }; static TYPELIB my_locale_typelib_ab_day_names_vi_VN = { array_elements(my_locale_ab_day_names_vi_VN)-1, "", my_locale_ab_day_names_vi_VN, NULL }; -MY_LOCALE my_locale_vi_VN ( "vi_VN", "Vietnamese - Vietnam", FALSE, &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 my_locale_vi_VN +( + 55, + "vi_VN", + "Vietnamese - Vietnam", + FALSE, + &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 +); /***** LOCALE END vi_VN *****/ /***** LOCALE BEGIN zh_CN: Chinese - Peoples Republic of China *****/ @@ -1151,7 +1690,17 @@ static TYPELIB my_locale_typelib_day_names_zh_CN = { array_elements(my_locale_day_names_zh_CN)-1, "", my_locale_day_names_zh_CN, NULL }; static TYPELIB my_locale_typelib_ab_day_names_zh_CN = { array_elements(my_locale_ab_day_names_zh_CN)-1, "", my_locale_ab_day_names_zh_CN, NULL }; -MY_LOCALE my_locale_zh_CN ( "zh_CN", "Chinese - Peoples Republic of China", FALSE, &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 my_locale_zh_CN +( + 56, + "zh_CN", + "Chinese - Peoples Republic of China", + FALSE, + &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 +); /***** LOCALE END zh_CN *****/ /***** LOCALE BEGIN zh_TW: Chinese - Taiwan *****/ @@ -1171,217 +1720,754 @@ static TYPELIB my_locale_typelib_day_names_zh_TW = { array_elements(my_locale_day_names_zh_TW)-1, "", my_locale_day_names_zh_TW, NULL }; static TYPELIB my_locale_typelib_ab_day_names_zh_TW = { array_elements(my_locale_ab_day_names_zh_TW)-1, "", my_locale_ab_day_names_zh_TW, NULL }; -MY_LOCALE my_locale_zh_TW ( "zh_TW", "Chinese - Taiwan", FALSE, &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 my_locale_zh_TW +( + 57, + "zh_TW", + "Chinese - Taiwan", + FALSE, + &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 +); /***** LOCALE END zh_TW *****/ /***** LOCALE BEGIN ar_DZ: Arabic - Algeria *****/ -MY_LOCALE my_locale_ar_DZ ( "ar_DZ", "Arabic - Algeria", FALSE, &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 my_locale_ar_DZ +( + 58, + "ar_DZ", + "Arabic - Algeria", + FALSE, + &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 +); /***** LOCALE END ar_DZ *****/ /***** LOCALE BEGIN ar_EG: Arabic - Egypt *****/ -MY_LOCALE my_locale_ar_EG ( "ar_EG", "Arabic - Egypt", FALSE, &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 my_locale_ar_EG +( + 59, + "ar_EG", + "Arabic - Egypt", + FALSE, + &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 +); /***** LOCALE END ar_EG *****/ /***** LOCALE BEGIN ar_IN: Arabic - Iran *****/ -MY_LOCALE my_locale_ar_IN ( "ar_IN", "Arabic - Iran", FALSE, &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 my_locale_ar_IN +( + 60, + "ar_IN", + "Arabic - Iran", + FALSE, + &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 +); /***** LOCALE END ar_IN *****/ /***** LOCALE BEGIN ar_IQ: Arabic - Iraq *****/ -MY_LOCALE my_locale_ar_IQ ( "ar_IQ", "Arabic - Iraq", FALSE, &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 my_locale_ar_IQ +( + 61, + "ar_IQ", + "Arabic - Iraq", + FALSE, + &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 +); /***** LOCALE END ar_IQ *****/ /***** LOCALE BEGIN ar_KW: Arabic - Kuwait *****/ -MY_LOCALE my_locale_ar_KW ( "ar_KW", "Arabic - Kuwait", FALSE, &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 my_locale_ar_KW +( + 62, + "ar_KW", + "Arabic - Kuwait", + FALSE, + &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 +); /***** LOCALE END ar_KW *****/ /***** LOCALE BEGIN ar_LB: Arabic - Lebanon *****/ -MY_LOCALE my_locale_ar_LB ( "ar_LB", "Arabic - Lebanon", FALSE, &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 my_locale_ar_LB +( + 63, + "ar_LB", + "Arabic - Lebanon", + FALSE, + &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 +); /***** LOCALE END ar_LB *****/ /***** LOCALE BEGIN ar_LY: Arabic - Libya *****/ -MY_LOCALE my_locale_ar_LY ( "ar_LY", "Arabic - Libya", FALSE, &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 my_locale_ar_LY +( + 64, + "ar_LY", + "Arabic - Libya", + FALSE, + &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 +); /***** LOCALE END ar_LY *****/ /***** LOCALE BEGIN ar_MA: Arabic - Morocco *****/ -MY_LOCALE my_locale_ar_MA ( "ar_MA", "Arabic - Morocco", FALSE, &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 my_locale_ar_MA +( + 65, + "ar_MA", + "Arabic - Morocco", + FALSE, + &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 +); /***** LOCALE END ar_MA *****/ /***** LOCALE BEGIN ar_OM: Arabic - Oman *****/ -MY_LOCALE my_locale_ar_OM ( "ar_OM", "Arabic - Oman", FALSE, &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 my_locale_ar_OM +( + 66, + "ar_OM", + "Arabic - Oman", + FALSE, + &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 +); /***** LOCALE END ar_OM *****/ /***** LOCALE BEGIN ar_QA: Arabic - Qatar *****/ -MY_LOCALE my_locale_ar_QA ( "ar_QA", "Arabic - Qatar", FALSE, &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 my_locale_ar_QA +( + 67, + "ar_QA", + "Arabic - Qatar", + FALSE, + &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 +); /***** LOCALE END ar_QA *****/ /***** LOCALE BEGIN ar_SD: Arabic - Sudan *****/ -MY_LOCALE my_locale_ar_SD ( "ar_SD", "Arabic - Sudan", FALSE, &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 my_locale_ar_SD +( + 68, + "ar_SD", + "Arabic - Sudan", + FALSE, + &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 +); /***** LOCALE END ar_SD *****/ /***** LOCALE BEGIN ar_TN: Arabic - Tunisia *****/ -MY_LOCALE my_locale_ar_TN ( "ar_TN", "Arabic - Tunisia", FALSE, &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 my_locale_ar_TN +( + 69, + "ar_TN", + "Arabic - Tunisia", + FALSE, + &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 +); /***** LOCALE END ar_TN *****/ /***** LOCALE BEGIN ar_YE: Arabic - Yemen *****/ -MY_LOCALE my_locale_ar_YE ( "ar_YE", "Arabic - Yemen", FALSE, &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 my_locale_ar_YE +( + 70, + "ar_YE", + "Arabic - Yemen", + FALSE, + &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 +); /***** LOCALE END ar_YE *****/ /***** LOCALE BEGIN de_BE: German - Belgium *****/ -MY_LOCALE my_locale_de_BE ( "de_BE", "German - Belgium", FALSE, &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 my_locale_de_BE +( + 71, + "de_BE", + "German - Belgium", + FALSE, + &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 +); /***** LOCALE END de_BE *****/ /***** LOCALE BEGIN de_CH: German - Switzerland *****/ -MY_LOCALE my_locale_de_CH ( "de_CH", "German - Switzerland", FALSE, &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 my_locale_de_CH +( + 72, + "de_CH", + "German - Switzerland", + FALSE, + &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 +); /***** LOCALE END de_CH *****/ /***** LOCALE BEGIN de_LU: German - Luxembourg *****/ -MY_LOCALE my_locale_de_LU ( "de_LU", "German - Luxembourg", FALSE, &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 my_locale_de_LU +( + 73, + "de_LU", + "German - Luxembourg", + FALSE, + &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 +); /***** LOCALE END de_LU *****/ /***** LOCALE BEGIN en_AU: English - Australia *****/ -MY_LOCALE my_locale_en_AU ( "en_AU", "English - Australia", TRUE, &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 my_locale_en_AU +( + 74, + "en_AU", + "English - Australia", + TRUE, + &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 +); /***** LOCALE END en_AU *****/ /***** LOCALE BEGIN en_CA: English - Canada *****/ -MY_LOCALE my_locale_en_CA ( "en_CA", "English - Canada", TRUE, &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 my_locale_en_CA +( + 75, + "en_CA", + "English - Canada", + TRUE, + &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 +); /***** LOCALE END en_CA *****/ /***** LOCALE BEGIN en_GB: English - United Kingdom *****/ -MY_LOCALE my_locale_en_GB ( "en_GB", "English - United Kingdom", TRUE, &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 my_locale_en_GB +( + 1, + "en_GB", + "English - United Kingdom", + TRUE, + &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 +); /***** LOCALE END en_GB *****/ /***** LOCALE BEGIN en_IN: English - India *****/ -MY_LOCALE my_locale_en_IN ( "en_IN", "English - India", TRUE, &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 my_locale_en_IN +( + 76, + "en_IN", + "English - India", + TRUE, + &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 +); /***** LOCALE END en_IN *****/ /***** LOCALE BEGIN en_NZ: English - New Zealand *****/ -MY_LOCALE my_locale_en_NZ ( "en_NZ", "English - New Zealand", TRUE, &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 my_locale_en_NZ +( + 77, + "en_NZ", + "English - New Zealand", + TRUE, + &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 +); /***** LOCALE END en_NZ *****/ /***** LOCALE BEGIN en_PH: English - Philippines *****/ -MY_LOCALE my_locale_en_PH ( "en_PH", "English - Philippines", TRUE, &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 my_locale_en_PH +( + 78, + "en_PH", + "English - Philippines", + TRUE, + &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 +); /***** LOCALE END en_PH *****/ /***** LOCALE BEGIN en_ZA: English - South Africa *****/ -MY_LOCALE my_locale_en_ZA ( "en_ZA", "English - South Africa", TRUE, &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 my_locale_en_ZA +( + 79, + "en_ZA", + "English - South Africa", + TRUE, + &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 +); /***** LOCALE END en_ZA *****/ /***** LOCALE BEGIN en_ZW: English - Zimbabwe *****/ -MY_LOCALE my_locale_en_ZW ( "en_ZW", "English - Zimbabwe", TRUE, &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 my_locale_en_ZW +( + 80, + "en_ZW", + "English - Zimbabwe", + TRUE, + &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 +); /***** LOCALE END en_ZW *****/ /***** LOCALE BEGIN es_AR: Spanish - Argentina *****/ -MY_LOCALE my_locale_es_AR ( "es_AR", "Spanish - Argentina", FALSE, &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 my_locale_es_AR +( + 81, + "es_AR", + "Spanish - Argentina", + FALSE, + &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 +); /***** LOCALE END es_AR *****/ /***** LOCALE BEGIN es_BO: Spanish - Bolivia *****/ -MY_LOCALE my_locale_es_BO ( "es_BO", "Spanish - Bolivia", FALSE, &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 my_locale_es_BO +( + 82, + "es_BO", + "Spanish - Bolivia", + FALSE, + &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 +); /***** LOCALE END es_BO *****/ /***** LOCALE BEGIN es_CL: Spanish - Chile *****/ -MY_LOCALE my_locale_es_CL ( "es_CL", "Spanish - Chile", FALSE, &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 my_locale_es_CL +( + 83, + "es_CL", + "Spanish - Chile", + FALSE, + &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 +); /***** LOCALE END es_CL *****/ /***** LOCALE BEGIN es_CO: Spanish - Columbia *****/ -MY_LOCALE my_locale_es_CO ( "es_CO", "Spanish - Columbia", FALSE, &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 my_locale_es_CO +( + 84, + "es_CO", + "Spanish - Columbia", + FALSE, + &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 +); /***** LOCALE END es_CO *****/ /***** LOCALE BEGIN es_CR: Spanish - Costa Rica *****/ -MY_LOCALE my_locale_es_CR ( "es_CR", "Spanish - Costa Rica", FALSE, &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 my_locale_es_CR +( + 85, + "es_CR", + "Spanish - Costa Rica", + FALSE, + &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 +); /***** LOCALE END es_CR *****/ /***** LOCALE BEGIN es_DO: Spanish - Dominican Republic *****/ -MY_LOCALE my_locale_es_DO ( "es_DO", "Spanish - Dominican Republic", FALSE, &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 my_locale_es_DO +( + 86, + "es_DO", + "Spanish - Dominican Republic", + FALSE, + &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 +); /***** LOCALE END es_DO *****/ /***** LOCALE BEGIN es_EC: Spanish - Ecuador *****/ -MY_LOCALE my_locale_es_EC ( "es_EC", "Spanish - Ecuador", FALSE, &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 my_locale_es_EC +( + 87, + "es_EC", + "Spanish - Ecuador", + FALSE, + &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 +); /***** LOCALE END es_EC *****/ /***** LOCALE BEGIN es_GT: Spanish - Guatemala *****/ -MY_LOCALE my_locale_es_GT ( "es_GT", "Spanish - Guatemala", FALSE, &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 my_locale_es_GT +( + 88, + "es_GT", + "Spanish - Guatemala", + FALSE, + &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 +); /***** LOCALE END es_GT *****/ /***** LOCALE BEGIN es_HN: Spanish - Honduras *****/ -MY_LOCALE my_locale_es_HN ( "es_HN", "Spanish - Honduras", FALSE, &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 my_locale_es_HN +( + 89, + "es_HN", + "Spanish - Honduras", + FALSE, + &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 +); /***** LOCALE END es_HN *****/ /***** LOCALE BEGIN es_MX: Spanish - Mexico *****/ -MY_LOCALE my_locale_es_MX ( "es_MX", "Spanish - Mexico", FALSE, &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 my_locale_es_MX +( + 90, + "es_MX", + "Spanish - Mexico", + FALSE, + &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 +); /***** LOCALE END es_MX *****/ /***** LOCALE BEGIN es_NI: Spanish - Nicaragua *****/ -MY_LOCALE my_locale_es_NI ( "es_NI", "Spanish - Nicaragua", FALSE, &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 my_locale_es_NI +( + 91, + "es_NI", + "Spanish - Nicaragua", + FALSE, + &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 +); /***** LOCALE END es_NI *****/ /***** LOCALE BEGIN es_PA: Spanish - Panama *****/ -MY_LOCALE my_locale_es_PA ( "es_PA", "Spanish - Panama", FALSE, &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 my_locale_es_PA +( + 92, + "es_PA", + "Spanish - Panama", + FALSE, + &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 +); /***** LOCALE END es_PA *****/ /***** LOCALE BEGIN es_PE: Spanish - Peru *****/ -MY_LOCALE my_locale_es_PE ( "es_PE", "Spanish - Peru", FALSE, &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 my_locale_es_PE +( + 93, + "es_PE", + "Spanish - Peru", + FALSE, + &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 +); /***** LOCALE END es_PE *****/ /***** LOCALE BEGIN es_PR: Spanish - Puerto Rico *****/ -MY_LOCALE my_locale_es_PR ( "es_PR", "Spanish - Puerto Rico", FALSE, &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 my_locale_es_PR +( + 94, + "es_PR", + "Spanish - Puerto Rico", + FALSE, + &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 +); /***** LOCALE END es_PR *****/ /***** LOCALE BEGIN es_PY: Spanish - Paraguay *****/ -MY_LOCALE my_locale_es_PY ( "es_PY", "Spanish - Paraguay", FALSE, &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 my_locale_es_PY +( + 95, + "es_PY", + "Spanish - Paraguay", + FALSE, + &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 +); /***** LOCALE END es_PY *****/ /***** LOCALE BEGIN es_SV: Spanish - El Salvador *****/ -MY_LOCALE my_locale_es_SV ( "es_SV", "Spanish - El Salvador", FALSE, &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 my_locale_es_SV +( + 96, + "es_SV", + "Spanish - El Salvador", + FALSE, + &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 +); /***** LOCALE END es_SV *****/ /***** LOCALE BEGIN es_US: Spanish - United States *****/ -MY_LOCALE my_locale_es_US ( "es_US", "Spanish - United States", FALSE, &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 my_locale_es_US +( + 97, + "es_US", + "Spanish - United States", + FALSE, + &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 +); /***** LOCALE END es_US *****/ /***** LOCALE BEGIN es_UY: Spanish - Uruguay *****/ -MY_LOCALE my_locale_es_UY ( "es_UY", "Spanish - Uruguay", FALSE, &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 my_locale_es_UY +( + 98, + "es_UY", + "Spanish - Uruguay", + FALSE, + &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 +); /***** LOCALE END es_UY *****/ /***** LOCALE BEGIN es_VE: Spanish - Venezuela *****/ -MY_LOCALE my_locale_es_VE ( "es_VE", "Spanish - Venezuela", FALSE, &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 my_locale_es_VE +( + 99, + "es_VE", + "Spanish - Venezuela", + FALSE, + &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 +); /***** LOCALE END es_VE *****/ /***** LOCALE BEGIN fr_BE: French - Belgium *****/ -MY_LOCALE my_locale_fr_BE ( "fr_BE", "French - Belgium", FALSE, &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 my_locale_fr_BE +( + 100, + "fr_BE", + "French - Belgium", + FALSE, + &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 +); /***** LOCALE END fr_BE *****/ /***** LOCALE BEGIN fr_CA: French - Canada *****/ -MY_LOCALE my_locale_fr_CA ( "fr_CA", "French - Canada", FALSE, &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 my_locale_fr_CA +( + 101, + "fr_CA", + "French - Canada", + FALSE, + &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 +); /***** LOCALE END fr_CA *****/ /***** LOCALE BEGIN fr_CH: French - Switzerland *****/ -MY_LOCALE my_locale_fr_CH ( "fr_CH", "French - Switzerland", FALSE, &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 my_locale_fr_CH +( + 102, + "fr_CH", + "French - Switzerland", + FALSE, + &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 +); /***** LOCALE END fr_CH *****/ /***** LOCALE BEGIN fr_LU: French - Luxembourg *****/ -MY_LOCALE my_locale_fr_LU ( "fr_LU", "French - Luxembourg", FALSE, &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 my_locale_fr_LU +( + 103, + "fr_LU", + "French - Luxembourg", + FALSE, + &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 +); /***** LOCALE END fr_LU *****/ /***** LOCALE BEGIN it_IT: Italian - Italy *****/ -MY_LOCALE my_locale_it_IT ( "it_IT", "Italian - Italy", FALSE, &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 my_locale_it_IT +( + 104, + "it_IT", + "Italian - Italy", + FALSE, + &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 +); /***** LOCALE END it_IT *****/ /***** LOCALE BEGIN nl_BE: Dutch - Belgium *****/ -MY_LOCALE my_locale_nl_BE ( "nl_BE", "Dutch - Belgium", TRUE, &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 my_locale_nl_BE +( + 105, + "nl_BE", + "Dutch - Belgium", + TRUE, + &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 +); /***** LOCALE END nl_BE *****/ /***** LOCALE BEGIN no_NO: Norwegian - Norway *****/ -MY_LOCALE my_locale_no_NO ( "no_NO", "Norwegian - Norway", FALSE, &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 my_locale_no_NO +( + 106, + "no_NO", + "Norwegian - Norway", + FALSE, + &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 +); /***** LOCALE END no_NO *****/ /***** LOCALE BEGIN sv_FI: Swedish - Finland *****/ -MY_LOCALE my_locale_sv_FI ( "sv_FI", "Swedish - Finland", FALSE, &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 my_locale_sv_FI +( + 107, + "sv_FI", + "Swedish - Finland", + FALSE, + &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 +); /***** LOCALE END sv_FI *****/ /***** LOCALE BEGIN zh_HK: Chinese - Hong Kong SAR *****/ -MY_LOCALE my_locale_zh_HK ( "zh_HK", "Chinese - Hong Kong SAR", FALSE, &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 my_locale_zh_HK +( + 108, + "zh_HK", + "Chinese - Hong Kong SAR", + FALSE, + &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 +); /***** LOCALE END zh_HK *****/ + +/* + The list of all locales. + Note, locales must be ordered according to their + numbers to make my_locale_by_number() work fast. + Some debug asserts below check this. +*/ MY_LOCALE *my_locales[]= { &my_locale_en_US, @@ -1495,3 +2581,31 @@ MY_LOCALE *my_locales[]= &my_locale_zh_HK, NULL }; + + +MY_LOCALE *my_locale_by_number(uint number) +{ + MY_LOCALE *locale; + if (number >= array_elements(my_locales) - 1) + return NULL; + locale= my_locales[number]; + // Check that locale is on its correct position in the array + DBUG_ASSERT(locale == my_locales[locale->number]); + return locale; +} + + +MY_LOCALE *my_locale_by_name(const char *name) +{ + MY_LOCALE **locale; + for (locale= my_locales; *locale != NULL; locale++) + { + if (!my_strcasecmp(&my_charset_latin1, (*locale)->name, name)) + { + // Check that locale is on its correct position in the array + DBUG_ASSERT((*locale) == my_locales[(*locale)->number]); + return *locale; + } + } + return NULL; +} diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 01aa7565e28..5ed07251aa0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2487,6 +2487,7 @@ static void reset_one_shot_variables(THD *thd) thd->update_charset(); thd->variables.time_zone= global_system_variables.time_zone; + thd->variables.lc_time_names= &my_locale_en_US; thd->one_shot_set= 0; } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index a699a801e2b..55f6fc04442 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1089,14 +1089,12 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, table->next_global= view_tables; } -#ifdef HAVE_ROW_BASED_REPLICATION /* If the view's body needs row-based binlogging (e.g. the VIEW is created from SELECT UUID()), the top statement also needs it. */ if (lex->binlog_row_based_if_mixed) old_lex->binlog_row_based_if_mixed= TRUE; -#endif bool view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE && lex->can_be_merged()); TABLE_LIST *view_main_select_tables; diff --git a/sql/table.cc b/sql/table.cc index e4e087b0e64..29d288d483e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -122,7 +122,6 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key, share->version= refresh_version; share->flush_version= flush_version; -#ifdef HAVE_ROW_BASED_REPLICATION /* This constant is used to mark that no table map version has been assigned. No arithmetic is done on the value: it will be @@ -140,8 +139,6 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key, share->table_map_id= ~0UL; share->cached_row_logging_check= -1; -#endif - memcpy((char*) &share->mem_root, (char*) &mem_root, sizeof(mem_root)); pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST); pthread_cond_init(&share->cond, NULL); @@ -193,7 +190,6 @@ void init_tmp_table_share(TABLE_SHARE *share, const char *key, share->path.length= share->normalized_path.length= strlen(path); share->frm_version= FRM_VER_TRUE_VARCHAR; -#ifdef HAVE_ROW_BASED_REPLICATION /* Temporary tables are not replicated, but we set up these fields anyway to be able to catch errors. @@ -201,7 +197,6 @@ void init_tmp_table_share(TABLE_SHARE *share, const char *key, share->table_map_version= ~(ulonglong)0; share->table_map_id= ~0UL; share->cached_row_logging_check= -1; -#endif DBUG_VOID_RETURN; } diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c index aa730552582..f636ffed97f 100644 --- a/unittest/mysys/my_atomic-t.c +++ b/unittest/mysys/my_atomic-t.c @@ -173,9 +173,15 @@ int main() pthread_cond_init(&cond, 0); my_atomic_rwlock_init(&rwl); - test_atomic("my_atomic_add32", test_atomic_add_handler, 100,10000); - test_atomic("my_atomic_swap32", test_atomic_swap_handler, 100,10000); - test_atomic("my_atomic_cas32", test_atomic_cas_handler, 100,10000); +#ifdef HPUX11 +#define CYCLES 1000 +#else +#define CYCLES 10000 +#endif +#define THREADS 100 + test_atomic("my_atomic_add32", test_atomic_add_handler, THREADS, CYCLES); + test_atomic("my_atomic_swap32", test_atomic_swap_handler, THREADS, CYCLES); + test_atomic("my_atomic_cas32", test_atomic_cas_handler, THREADS, CYCLES); /* workaround until we know why it crashes randomly on some machine |