summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-08-01 14:42:51 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-08-01 14:42:51 +0300
commit50a11f396af81aac6d5f51e8278ec9a7fa17e7c8 (patch)
tree1a695f030aa737b200e9271f9403971f8a571849
parent842da858b6c5b619bb5395ef4216f7e675b0f3a0 (diff)
parent9216114ce729733e6b0c4ce952bfdf57595ff387 (diff)
downloadmariadb-git-50a11f396af81aac6d5f51e8278ec9a7fa17e7c8.tar.gz
Merge 10.4 into 10.5
-rw-r--r--client/mysql_upgrade.c1
-rw-r--r--configure.cmake5
-rw-r--r--extra/mariabackup/xtrabackup.cc8
-rw-r--r--include/my_rdtsc.h14
-rw-r--r--include/my_time.h7
-rw-r--r--include/violite.h2
-rw-r--r--mysql-test/include/binlog_parallel_replication_marks.test2
-rw-r--r--mysql-test/main/func_math.result106
-rw-r--r--mysql-test/main/grant.result2
-rw-r--r--mysql-test/main/grant4.result2
-rw-r--r--mysql-test/main/grant5.result6
-rw-r--r--mysql-test/main/grant5.test10
-rw-r--r--mysql-test/main/information_schema.result1
-rw-r--r--mysql-test/main/mdev-21101.opt1
-rw-r--r--mysql-test/main/mdev-21101.result43
-rw-r--r--mysql-test/main/mdev-21101.test54
-rw-r--r--mysql-test/main/metadata.result40
-rw-r--r--mysql-test/main/mysqlbinlog-innodb.result8
-rw-r--r--mysql-test/main/mysqlbinlog.result74
-rw-r--r--mysql-test/main/mysqlbinlog_row_compressed.result16
-rw-r--r--mysql-test/main/mysqlbinlog_row_minimal.result18
-rw-r--r--mysql-test/main/mysqlbinlog_stmt_compressed.result16
-rw-r--r--mysql-test/main/mysqltest_tracking_info.result12
-rw-r--r--mysql-test/main/mysqltest_tracking_info.test15
-rw-r--r--mysql-test/main/parser.result8
-rw-r--r--mysql-test/main/parser.test8
-rw-r--r--mysql-test/main/plugin.result14
-rw-r--r--mysql-test/main/plugin.test23
-rw-r--r--mysql-test/main/signal.result6
-rw-r--r--mysql-test/main/signal.test6
-rw-r--r--mysql-test/main/sp-error.result4
-rw-r--r--mysql-test/main/sp-error.test4
-rw-r--r--mysql-test/main/sp.result18
-rw-r--r--mysql-test/main/sp.test18
-rw-r--r--mysql-test/main/type_bit.result983
-rw-r--r--mysql-test/main/type_bit.test29
-rw-r--r--mysql-test/main/type_date.result14
-rw-r--r--mysql-test/main/type_date.test8
-rw-r--r--mysql-test/main/type_datetime_hires.result165
-rw-r--r--mysql-test/main/type_datetime_hires.test98
-rw-r--r--mysql-test/main/type_enum.result21
-rw-r--r--mysql-test/main/type_enum.test13
-rw-r--r--mysql-test/main/type_hex_hybrid.result158
-rw-r--r--mysql-test/main/type_hex_hybrid.test30
-rw-r--r--mysql-test/main/type_int.result216
-rw-r--r--mysql-test/main/type_int.test35
-rw-r--r--mysql-test/main/type_set.result21
-rw-r--r--mysql-test/main/type_set.test13
-rw-r--r--mysql-test/main/type_time_hires.result237
-rw-r--r--mysql-test/main/type_time_hires.test123
-rw-r--r--mysql-test/main/type_timestamp_hires.result12
-rw-r--r--mysql-test/main/type_timestamp_hires.test10
-rw-r--r--mysql-test/main/type_year.result27
-rw-r--r--mysql-test/main/type_year.test15
-rw-r--r--mysql-test/main/upgrade_MDEV-19650.result1
-rw-r--r--mysql-test/main/user_var-binlog.result4
-rw-r--r--mysql-test/main/view_grant.result1
-rw-r--r--mysql-test/main/win.result7
-rw-r--r--mysql-test/main/win.test9
-rw-r--r--mysql-test/main/win_ntile.result78
-rw-r--r--mysql-test/main/win_ntile.test43
-rwxr-xr-xmysql-test/std_data/wsrep_notify.sh18
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result206
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result358
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result40
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result40
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result16
-rw-r--r--mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_annotate.result72
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result14
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result28
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result14
-rw-r--r--mysql-test/suite/binlog/r/flashback.result20
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.result36
-rw-r--r--mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result100
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result2
-rw-r--r--mysql-test/suite/compat/oracle/r/sp.result8
-rw-r--r--mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt1
-rw-r--r--mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test117
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test2
-rw-r--r--mysql-test/suite/compat/oracle/t/sp.test8
-rw-r--r--mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result3
-rw-r--r--mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test2
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_privileges.result1
-rw-r--r--mysql-test/suite/galera/disabled.def3
-rw-r--r--mysql-test/suite/galera/include/galera_st_clean_slave.inc6
-rw-r--r--mysql-test/suite/galera/include/galera_st_disconnect_slave.inc6
-rw-r--r--mysql-test/suite/galera/include/galera_st_kill_slave.inc6
-rw-r--r--mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc5
-rw-r--r--mysql-test/suite/galera/include/galera_st_shutdown_slave.inc6
-rw-r--r--mysql-test/suite/galera/r/MDEV-22458.result10
-rw-r--r--mysql-test/suite/galera/r/MW-328A.result3
-rw-r--r--mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result33
-rw-r--r--mysql-test/suite/galera/r/galera_var_notify_cmd.result2
-rw-r--r--mysql-test/suite/galera/r/mdev_21718.result16
-rw-r--r--mysql-test/suite/galera/suite.pm1
-rw-r--r--mysql-test/suite/galera/t/MDEV-22458.test21
-rw-r--r--mysql-test/suite/galera/t/MW-328A.test4
-rw-r--r--mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test50
-rw-r--r--mysql-test/suite/galera/t/mdev_21718.cnf4
-rw-r--r--mysql-test/suite/galera/t/mdev_21718.test35
-rw-r--r--mysql-test/suite/galera_3nodes/suite.pm7
-rw-r--r--mysql-test/suite/galera_sr/suite.pm3
-rw-r--r--mysql-test/suite/gcol/r/gcol_bugfixes.result66
-rw-r--r--mysql-test/suite/gcol/t/gcol_bugfixes.test70
-rw-r--r--mysql-test/suite/innodb/disabled.def1
-rw-r--r--mysql-test/suite/innodb/r/alter_primary_key.result26
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter,compact.rdiff10
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff10
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result17
-rw-r--r--mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result2
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_bugs.result8
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_charset.result40
-rw-r--r--mysql-test/suite/innodb/r/mvcc.result14
-rw-r--r--mysql-test/suite/innodb/t/alter_primary_key.test34
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_alter.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test22
-rw-r--r--mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test3
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_bugs.test10
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_charset.test40
-rw-r--r--mysql-test/suite/innodb/t/mvcc.test20
-rw-r--r--mysql-test/suite/plugins/r/audit_null_debug.result1
-rw-r--r--mysql-test/suite/plugins/t/audit_null_debug.test3
-rw-r--r--mysql-test/suite/roles/set_role-table-column-priv.result2
-rw-r--r--mysql-test/suite/roles/set_role-table-simple.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_virt.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result52
-rw-r--r--mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_virt.test27
-rw-r--r--mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test7
-rw-r--r--mysql-test/suite/versioning/r/partition.result30
-rw-r--r--mysql-test/suite/versioning/t/partition.test19
-rw-r--r--mysys/my_rdtsc.c6
-rw-r--r--plugin/auth_pam/CMakeLists.txt2
-rw-r--r--plugin/type_inet/sql_type_inet.cc13
-rw-r--r--scripts/mysql_system_tables.sql2
-rw-r--r--sql-common/client.c2
-rw-r--r--sql/field.cc8
-rw-r--r--sql/handler.h3
-rw-r--r--sql/item.cc35
-rw-r--r--sql/item_create.cc2
-rw-r--r--sql/item_func.cc112
-rw-r--r--sql/item_func.h55
-rw-r--r--sql/item_timefunc.cc5
-rw-r--r--sql/item_windowfunc.cc6
-rw-r--r--sql/item_windowfunc.h10
-rw-r--r--sql/log_event_client.cc9
-rw-r--r--sql/log_event_server.cc14
-rw-r--r--sql/net_serv.cc12
-rw-r--r--sql/partition_info.cc5
-rw-r--r--sql/protocol.cc2
-rw-r--r--sql/session_tracker.cc8
-rw-r--r--sql/slave.cc3
-rw-r--r--sql/sql_acl.cc37
-rw-r--r--sql/sql_alter.cc14
-rw-r--r--sql/sql_alter.h9
-rw-r--r--sql/sql_base.cc43
-rw-r--r--sql/sql_class.cc1
-rw-r--r--sql/sql_class.h21
-rw-r--r--sql/sql_lex.cc23
-rw-r--r--sql/sql_lex.h5
-rw-r--r--sql/sql_parse.cc31
-rw-r--r--sql/sql_plugin.cc74
-rw-r--r--sql/sql_prepare.cc2
-rw-r--r--sql/sql_table.cc34
-rw-r--r--sql/sql_time.cc22
-rw-r--r--sql/sql_time.h4
-rw-r--r--sql/sql_type.cc154
-rw-r--r--sql/sql_type.h103
-rw-r--r--sql/sys_vars.cc6
-rw-r--r--sql/sys_vars.ic13
-rw-r--r--sql/table.cc16
-rw-r--r--sql/table.h1
-rw-r--r--sql/threadpool.h1
-rw-r--r--sql/threadpool_common.cc22
-rw-r--r--sql/threadpool_generic.cc22
-rw-r--r--sql/wsrep_high_priority_service.cc7
-rw-r--r--storage/innobase/btr/btr0btr.cc9
-rw-r--r--storage/innobase/btr/btr0cur.cc29
-rw-r--r--storage/innobase/btr/btr0sea.cc20
-rw-r--r--storage/innobase/buf/buf0buf.cc14
-rw-r--r--storage/innobase/buf/buf0flu.cc4
-rw-r--r--storage/innobase/dict/dict0dict.cc1
-rw-r--r--storage/innobase/handler/ha_innodb.cc152
-rw-r--r--storage/innobase/handler/handler0alter.cc19
-rw-r--r--storage/innobase/include/rem0rec.h7
-rw-r--r--storage/innobase/include/srv0srv.h25
-rw-r--r--storage/innobase/log/log0log.cc3
-rw-r--r--storage/innobase/log/log0recv.cc2
-rw-r--r--storage/innobase/row/row0ins.cc10
-rw-r--r--storage/innobase/row/row0mysql.cc2
-rw-r--r--storage/innobase/row/row0vers.cc8
-rw-r--r--storage/innobase/srv/srv0srv.cc49
-rw-r--r--storage/innobase/srv/srv0start.cc3
-rw-r--r--storage/innobase/trx/trx0roll.cc8
-rw-r--r--storage/innobase/trx/trx0trx.cc5
-rw-r--r--storage/rocksdb/CMakeLists.txt7
-rw-r--r--storage/rocksdb/build_rocksdb.cmake26
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test2
-rw-r--r--vio/vio_priv.h1
-rw-r--r--vio/viopipe.c6
-rw-r--r--vio/viosocket.c29
m---------wsrep-lib0
210 files changed, 5231 insertions, 1207 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index a6af46e6d7b..c262b7d80bd 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -896,6 +896,7 @@ static const char *expected_errors[]=
"ERROR 1290", /* RR_OPTION_PREVENTS_STATEMENT */
"ERROR 1347", /* 'mysql.user' is not of type 'BASE TABLE' */
"ERROR 1348", /* Column 'Show_db_priv' is not updatable */
+ "ERROR 1356", /* definer of view lack rights (UPDATE) */
0
};
diff --git a/configure.cmake b/configure.cmake
index a7e044b13d2..deef3c5f366 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -69,6 +69,11 @@ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
SET(PLUGIN_QUERY_RESPONSE_TIME NO CACHE BOOL "Disabled, gcc is too old")
ENDIF()
+# use runtime atomic-support detection in aarch64
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
+ MY_CHECK_AND_SET_COMPILER_FLAG("-moutline-atomics")
+ENDIF()
+
IF(WITHOUT_DYNAMIC_PLUGINS)
MESSAGE("Dynamic plugins are disabled.")
ENDIF(WITHOUT_DYNAMIC_PLUGINS)
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index f4c793fc1d8..1a79068d5a5 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -244,14 +244,6 @@ static char* innobase_ignored_opt;
char* innobase_data_home_dir;
char* innobase_data_file_path;
-/* The following counter is used to convey information to InnoDB
-about server activity: in selects it is not sensible to call
-srv_active_wake_master_thread after each fetch or search, we only do
-it every INNOBASE_WAKE_INTERVAL'th step. */
-
-#define INNOBASE_WAKE_INTERVAL 32
-ulong innobase_active_counter = 0;
-
#ifndef _WIN32
static char *xtrabackup_debug_sync = NULL;
#endif
diff --git a/include/my_rdtsc.h b/include/my_rdtsc.h
index a2e5afcb79f..33d722764d4 100644
--- a/include/my_rdtsc.h
+++ b/include/my_rdtsc.h
@@ -77,7 +77,7 @@ C_MODE_START
/**
A cycle timer.
- On clang, we use __builtin_readcyclecounter().
+ On clang we use __builtin_readcyclecounter(), except for AARCH64.
On other compilers:
On IA-32 and AMD64, we use the RDTSC instruction.
@@ -88,6 +88,9 @@ C_MODE_START
On IBM S/390 System z we use the STCK instruction.
On ARM, we probably should use the Generic Timer, but should figure out
how to ensure that it can be accessed.
+ On AARCH64, we use the generic timer base register. We override clang
+ implementation for aarch64 as it access a PMU register which is not
+ guarenteed to be active.
Sadly, we have nothing for the Digital Alpha, MIPS, Motorola m68k,
HP PA-RISC or other non-mainstream (or obsolete) processors.
@@ -125,7 +128,7 @@ C_MODE_START
*/
static inline ulonglong my_timer_cycles(void)
{
-# if __has_builtin(__builtin_readcyclecounter)
+# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__)
return __builtin_readcyclecounter();
# elif defined _WIN32 || defined __i386__ || defined __x86_64__
return __rdtsc();
@@ -164,6 +167,12 @@ static inline ulonglong my_timer_cycles(void)
__asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
return result;
}
+#elif defined(__GNUC__) && defined (__aarch64__)
+ {
+ ulonglong result;
+ __asm __volatile("mrs %0, CNTVCT_EL0" : "=&r" (result));
+ return result;
+ }
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
/* gethrtime may appear as either cycle or nanosecond counter */
return (ulonglong) gethrtime();
@@ -221,6 +230,7 @@ C_MODE_END
#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
#define MY_TIMER_ROUTINE_ASM_S390 28
+#define MY_TIMER_ROUTINE_AARCH64 29
#endif
diff --git a/include/my_time.h b/include/my_time.h
index bad2b8bf4b0..b7b54db5586 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -233,9 +233,16 @@ static inline long my_time_fraction_remainder(long nr, uint decimals)
DBUG_ASSERT(decimals <= TIME_SECOND_PART_DIGITS);
return nr % (long) log_10_int[TIME_SECOND_PART_DIGITS - decimals];
}
+static inline void my_datetime_trunc(MYSQL_TIME *ltime, uint decimals)
+{
+ ltime->second_part-= my_time_fraction_remainder(ltime->second_part, decimals);
+}
static inline void my_time_trunc(MYSQL_TIME *ltime, uint decimals)
{
ltime->second_part-= my_time_fraction_remainder(ltime->second_part, decimals);
+ if (!ltime->second_part && ltime->neg &&
+ !ltime->hour && !ltime->minute && !ltime->second)
+ ltime->neg= FALSE;
}
static inline void my_timeval_trunc(struct timeval *tv, uint decimals)
{
diff --git a/include/violite.h b/include/violite.h
index 59fac20c376..fa154ac28b8 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -112,9 +112,7 @@ my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen);
/* Wait for an I/O event notification. */
int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout);
my_bool vio_is_connected(Vio *vio);
-#ifndef DBUG_OFF
ssize_t vio_pending(Vio *vio);
-#endif
/* Set timeout for a network operation. */
extern int vio_timeout(Vio *vio, uint which, int timeout_sec);
extern void vio_set_wait_callback(void (*before_wait)(void),
diff --git a/mysql-test/include/binlog_parallel_replication_marks.test b/mysql-test/include/binlog_parallel_replication_marks.test
index 3976088ca43..29e86d64d3e 100644
--- a/mysql-test/include/binlog_parallel_replication_marks.test
+++ b/mysql-test/include/binlog_parallel_replication_marks.test
@@ -80,7 +80,7 @@ while (<F>) {
s/table id \d+/table id #/;
s/mapped to number \d+/mapped to number #/;
s/CRC32 0x[0-9a-f]+/CRC32 0x########/;
- print if /\b(GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY)\b/;
+ print if /\b(GTID|START TRANSACTION|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY)\b/;
}
close F;
EOF
diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result
index 547339e56ac..97f66476919 100644
--- a/mysql-test/main/func_math.result
+++ b/mysql-test/main/func_math.result
@@ -2619,7 +2619,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(3) DEFAULT NULL
+ `c1` varchar(2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(4));
@@ -2664,7 +2664,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(5) DEFAULT NULL
+ `c1` varchar(3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(7));
@@ -2709,7 +2709,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(6) DEFAULT NULL
+ `c1` varchar(5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(10));
@@ -2754,7 +2754,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(7) DEFAULT NULL
+ `c1` varchar(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(13));
@@ -2769,7 +2769,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(7) DEFAULT NULL
+ `c1` varchar(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(14));
@@ -2799,7 +2799,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(9) DEFAULT NULL
+ `c1` varchar(7) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(16));
@@ -2814,7 +2814,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(9) DEFAULT NULL
+ `c1` varchar(7) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(17));
@@ -2844,7 +2844,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(10) DEFAULT NULL
+ `c1` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(19));
@@ -2859,7 +2859,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(10) DEFAULT NULL
+ `c1` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(20));
@@ -2889,7 +2889,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(11) DEFAULT NULL
+ `c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(22));
@@ -2904,7 +2904,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(11) DEFAULT NULL
+ `c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(23));
@@ -2919,7 +2919,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(11) DEFAULT NULL
+ `c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(24));
@@ -2934,7 +2934,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(13) DEFAULT NULL
+ `c1` varchar(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(25));
@@ -2949,7 +2949,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(13) DEFAULT NULL
+ `c1` varchar(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(26));
@@ -2964,7 +2964,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(13) DEFAULT NULL
+ `c1` varchar(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(27));
@@ -2979,7 +2979,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(14) DEFAULT NULL
+ `c1` varchar(13) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(28));
@@ -2994,7 +2994,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(14) DEFAULT NULL
+ `c1` varchar(13) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(29));
@@ -3009,7 +3009,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(14) DEFAULT NULL
+ `c1` varchar(13) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(30));
@@ -3024,7 +3024,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(15) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(31));
@@ -3039,7 +3039,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(15) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(32));
@@ -3054,7 +3054,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(15) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(33));
@@ -3069,7 +3069,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(17) DEFAULT NULL
+ `c1` varchar(14) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(34));
@@ -3084,7 +3084,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(17) DEFAULT NULL
+ `c1` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(35));
@@ -3099,7 +3099,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(17) DEFAULT NULL
+ `c1` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(36));
@@ -3114,7 +3114,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(18) DEFAULT NULL
+ `c1` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(37));
@@ -3129,7 +3129,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(18) DEFAULT NULL
+ `c1` varchar(17) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(38));
@@ -3144,7 +3144,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(18) DEFAULT NULL
+ `c1` varchar(17) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(39));
@@ -3159,7 +3159,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(19) DEFAULT NULL
+ `c1` varchar(17) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(40));
@@ -3174,7 +3174,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(19) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(41));
@@ -3189,7 +3189,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(19) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(42));
@@ -3204,7 +3204,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(43));
@@ -3219,7 +3219,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(18) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(44));
@@ -3234,7 +3234,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(21) DEFAULT NULL
+ `c1` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(45));
@@ -3249,7 +3249,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(22) DEFAULT NULL
+ `c1` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(46));
@@ -3264,7 +3264,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(22) DEFAULT NULL
+ `c1` varchar(19) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(47));
@@ -3279,7 +3279,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(22) DEFAULT NULL
+ `c1` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(48));
@@ -3294,7 +3294,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(23) DEFAULT NULL
+ `c1` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(49));
@@ -3309,7 +3309,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(23) DEFAULT NULL
+ `c1` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(50));
@@ -3324,7 +3324,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(23) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(51));
@@ -3339,7 +3339,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(25) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(52));
@@ -3354,7 +3354,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(25) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(53));
@@ -3369,7 +3369,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(25) DEFAULT NULL
+ `c1` varchar(22) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(54));
@@ -3384,7 +3384,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(26) DEFAULT NULL
+ `c1` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(55));
@@ -3399,7 +3399,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(26) DEFAULT NULL
+ `c1` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(56));
@@ -3414,7 +3414,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(26) DEFAULT NULL
+ `c1` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(57));
@@ -3429,7 +3429,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(27) DEFAULT NULL
+ `c1` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(58));
@@ -3444,7 +3444,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(27) DEFAULT NULL
+ `c1` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(59));
@@ -3459,7 +3459,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(27) DEFAULT NULL
+ `c1` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(60));
@@ -3474,7 +3474,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(29) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(61));
@@ -3489,7 +3489,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(29) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(62));
@@ -3504,7 +3504,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(29) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(63));
@@ -3519,7 +3519,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(30) DEFAULT NULL
+ `c1` varchar(26) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (c1 BIT(64));
@@ -3534,7 +3534,7 @@ HEX(c1)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `c1` varchar(30) DEFAULT NULL
+ `c1` varchar(27) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (f float);
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result
index 20f670cbef4..ae365ea207a 100644
--- a/mysql-test/main/grant.result
+++ b/mysql-test/main/grant.result
@@ -975,7 +975,6 @@ select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
connect conn5,localhost,mysqltest_8,,;
select * from t1;
@@ -992,7 +991,6 @@ GRANT USAGE ON *.* TO `mysqltest_8`@`%`
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
flush privileges;
show grants for mysqltest_8@'';
diff --git a/mysql-test/main/grant4.result b/mysql-test/main/grant4.result
index f252a4c2ad5..29021b608aa 100644
--- a/mysql-test/main/grant4.result
+++ b/mysql-test/main/grant4.result
@@ -148,7 +148,7 @@ call mtr.add_suppression('mysql.user table is damaged');
rename table mysql.user to mysql.user1;
create table mysql.user (Host char(100), User char(100));
flush privileges;
-ERROR HY000: Unknown error
+ERROR HY000: Fatal error: mysql.user table is damaged or in unsupported 3.20 format
drop table mysql.user;
rename table mysql.user1 to mysql.user;
# switching back from mysql.user to mysql.global_priv
diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result
index df09b1fcc64..2cc1c11f7d8 100644
--- a/mysql-test/main/grant5.result
+++ b/mysql-test/main/grant5.result
@@ -242,4 +242,10 @@ disconnect con1;
connection default;
drop database db;
drop user foo;
+call mtr.add_suppression('mysql.host table is damaged');
+create table mysql.host (c1 int);
+insert mysql.host values (1);
+flush privileges;
+ERROR HY000: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
+drop table mysql.host;
# End of 10.4 tests
diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test
index 39fcff92435..054b16c0a6e 100644
--- a/mysql-test/main/grant5.test
+++ b/mysql-test/main/grant5.test
@@ -199,4 +199,14 @@ delete from db.t1 returning *;
drop database db;
drop user foo;
+#
+# MDEV-23009 SIGSEGV in get_field from acl_load (on optimized builds)
+#
+call mtr.add_suppression('mysql.host table is damaged');
+create table mysql.host (c1 int);
+insert mysql.host values (1);
+--error ER_UNKNOWN_ERROR
+flush privileges;
+drop table mysql.host;
+
--echo # End of 10.4 tests
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index 1e1f66e377c..60ea49f25ab 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -576,7 +576,6 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
drop view v1, v2, v3;
drop table t1;
diff --git a/mysql-test/main/mdev-21101.opt b/mysql-test/main/mdev-21101.opt
new file mode 100644
index 00000000000..b446a28986b
--- /dev/null
+++ b/mysql-test/main/mdev-21101.opt
@@ -0,0 +1 @@
+--thread-handling=pool-of-threads \ No newline at end of file
diff --git a/mysql-test/main/mdev-21101.result b/mysql-test/main/mdev-21101.result
new file mode 100644
index 00000000000..94da9c31108
--- /dev/null
+++ b/mysql-test/main/mdev-21101.result
@@ -0,0 +1,43 @@
+SELECT
+@@global.wait_timeout, @@global.thread_pool_max_threads, @@global.thread_pool_size,
+@@global.thread_pool_oversubscribe, @@global.thread_pool_stall_limit
+INTO
+@_wait_timeout,@_thread_pool_max_threads,@_thread_pool_size,
+@_thread_pool_oversubscribe,@_thread_pool_stall_limit;
+SET @@global.wait_timeout=1,
+@@global.thread_pool_max_threads=2,
+@@global.thread_pool_size=1,
+@@global.thread_pool_oversubscribe=1,
+@@global.thread_pool_stall_limit=10;
+connect c1, localhost, root,,;
+connect c2, localhost, root,,;
+connect c3, localhost, root,,;
+connection c1;
+select sleep(1.1);
+connection c2;
+select sleep(1.1);
+connection c3;
+select sleep(1.1);
+connection default;
+select sleep(1.1);
+connection c1;
+sleep(1.1)
+0
+connection c2;
+sleep(1.1)
+0
+connection c3;
+sleep(1.1)
+0
+connection default;
+sleep(1.1)
+0
+disconnect c1;
+disconnect c2;
+disconnect c3;
+connection default;
+SET @@global.wait_timeout=@_wait_timeout,
+@@global.thread_pool_max_threads=@_thread_pool_max_threads,
+@@global.thread_pool_size=@_thread_pool_size,
+@@global.thread_pool_oversubscribe=@_thread_pool_oversubscribe,
+@@global.thread_pool_stall_limit=@_thread_pool_stall_limit;
diff --git a/mysql-test/main/mdev-21101.test b/mysql-test/main/mdev-21101.test
new file mode 100644
index 00000000000..627e86462a1
--- /dev/null
+++ b/mysql-test/main/mdev-21101.test
@@ -0,0 +1,54 @@
+--source include/not_embedded.inc
+# Test that wait_timeout does not cause connection to be closed, when connection is delayed due to
+# threadpool internal problems, e.g misconfiguration - too few threads and queueing.
+# So if client did not cause wait_timeout, do not report it either.
+# See MDEV-21101 for details.
+
+# Intentionally misconfigure threadpool to have at most 1 or 2 threads (
+# depends on the implementation). Use minimal wait_timeout, do some slow queries from
+# different connections simultaneously, to force queueing occurs.
+# Verify connections are intact, even if queueing time exceeds wait_timeout
+
+SELECT
+ @@global.wait_timeout, @@global.thread_pool_max_threads, @@global.thread_pool_size,
+ @@global.thread_pool_oversubscribe, @@global.thread_pool_stall_limit
+INTO
+ @_wait_timeout,@_thread_pool_max_threads,@_thread_pool_size,
+ @_thread_pool_oversubscribe,@_thread_pool_stall_limit;
+
+SET @@global.wait_timeout=1,
+ @@global.thread_pool_max_threads=2,
+ @@global.thread_pool_size=1,
+ @@global.thread_pool_oversubscribe=1,
+ @@global.thread_pool_stall_limit=10;
+
+--connect (c1, localhost, root,,)
+--connect (c2, localhost, root,,)
+--connect (c3, localhost, root,,)
+--connection c1
+--send select sleep(1.1)
+--connection c2
+--send select sleep(1.1)
+--connection c3
+--send select sleep(1.1)
+--connection default
+--send select sleep(1.1)
+--connection c1
+--reap
+--connection c2
+--reap
+--connection c3
+--reap
+--connection default
+--reap
+--disconnect c1
+--disconnect c2
+--disconnect c3
+--connection default
+
+SET @@global.wait_timeout=@_wait_timeout,
+ @@global.thread_pool_max_threads=@_thread_pool_max_threads,
+ @@global.thread_pool_size=@_thread_pool_size,
+ @@global.thread_pool_oversubscribe=@_thread_pool_oversubscribe,
+ @@global.thread_pool_stall_limit=@_thread_pool_stall_limit;
+
diff --git a/mysql-test/main/metadata.result b/mysql-test/main/metadata.result
index 1f917bfe5ab..0704f5b8ae8 100644
--- a/mysql-test/main/metadata.result
+++ b/mysql-test/main/metadata.result
@@ -715,16 +715,16 @@ CEILING(11111111),
CEILING(111111111),
CEILING(1111111111) LIMIT 0;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def CEILING(1) 3 3 0 N 32897 0 63
-def CEILING(11) 3 4 0 N 32897 0 63
-def CEILING(111) 3 5 0 N 32897 0 63
-def CEILING(1111) 3 6 0 N 32897 0 63
-def CEILING(11111) 3 7 0 N 32897 0 63
-def CEILING(111111) 3 8 0 N 32897 0 63
-def CEILING(1111111) 3 9 0 N 32897 0 63
-def CEILING(11111111) 8 10 0 N 32897 0 63
-def CEILING(111111111) 8 11 0 N 32897 0 63
-def CEILING(1111111111) 8 12 0 N 32897 0 63
+def CEILING(1) 3 1 0 N 32897 0 63
+def CEILING(11) 3 2 0 N 32897 0 63
+def CEILING(111) 3 3 0 N 32897 0 63
+def CEILING(1111) 3 4 0 N 32897 0 63
+def CEILING(11111) 3 5 0 N 32897 0 63
+def CEILING(111111) 3 6 0 N 32897 0 63
+def CEILING(1111111) 3 7 0 N 32897 0 63
+def CEILING(11111111) 3 8 0 N 32897 0 63
+def CEILING(111111111) 3 9 0 N 32897 0 63
+def CEILING(1111111111) 8 10 0 N 32897 0 63
CEILING(1) CEILING(11) CEILING(111) CEILING(1111) CEILING(11111) CEILING(111111) CEILING(1111111) CEILING(11111111) CEILING(111111111) CEILING(1111111111)
SELECT
FLOOR(1),
@@ -738,16 +738,16 @@ FLOOR(11111111),
FLOOR(111111111),
FLOOR(1111111111) LIMIT 0;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def FLOOR(1) 3 3 0 N 32897 0 63
-def FLOOR(11) 3 4 0 N 32897 0 63
-def FLOOR(111) 3 5 0 N 32897 0 63
-def FLOOR(1111) 3 6 0 N 32897 0 63
-def FLOOR(11111) 3 7 0 N 32897 0 63
-def FLOOR(111111) 3 8 0 N 32897 0 63
-def FLOOR(1111111) 3 9 0 N 32897 0 63
-def FLOOR(11111111) 8 10 0 N 32897 0 63
-def FLOOR(111111111) 8 11 0 N 32897 0 63
-def FLOOR(1111111111) 8 12 0 N 32897 0 63
+def FLOOR(1) 3 1 0 N 32897 0 63
+def FLOOR(11) 3 2 0 N 32897 0 63
+def FLOOR(111) 3 3 0 N 32897 0 63
+def FLOOR(1111) 3 4 0 N 32897 0 63
+def FLOOR(11111) 3 5 0 N 32897 0 63
+def FLOOR(111111) 3 6 0 N 32897 0 63
+def FLOOR(1111111) 3 7 0 N 32897 0 63
+def FLOOR(11111111) 3 8 0 N 32897 0 63
+def FLOOR(111111111) 3 9 0 N 32897 0 63
+def FLOOR(1111111111) 8 10 0 N 32897 0 63
FLOOR(1) FLOOR(11) FLOOR(111) FLOOR(1111) FLOOR(11111) FLOOR(111111) FLOOR(1111111) FLOOR(11111111) FLOOR(111111111) FLOOR(1111111111)
SELECT
ROUND(1),
diff --git a/mysql-test/main/mysqlbinlog-innodb.result b/mysql-test/main/mysqlbinlog-innodb.result
index 342cd7cbd82..8428e4cd74b 100644
--- a/mysql-test/main/mysqlbinlog-innodb.result
+++ b/mysql-test/main/mysqlbinlog-innodb.result
@@ -24,7 +24,7 @@ FLUSH LOGS;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -39,7 +39,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
INSERT INTO t1 VALUES (1)
/*!*/;
COMMIT/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (2)
@@ -55,7 +55,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `foo`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -70,7 +70,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
INSERT INTO t1 VALUES (1)
/*!*/;
COMMIT/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (2)
diff --git a/mysql-test/main/mysqlbinlog.result b/mysql-test/main/mysqlbinlog.result
index e514c951284..e31246efef9 100644
--- a/mysql-test/main/mysqlbinlog.result
+++ b/mysql-test/main/mysqlbinlog.result
@@ -37,7 +37,7 @@ create table t1 (word varchar(20))
SET TIMESTAMP=1000000000/*!*/;
create table t2 (id int auto_increment not null primary key)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")
@@ -45,7 +45,7 @@ insert into t1 values ("abirvalg")
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -54,7 +54,7 @@ insert into t2 values ()
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -62,7 +62,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -70,7 +70,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -78,7 +78,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -97,7 +97,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -114,7 +114,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
@@ -134,7 +134,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
@@ -147,28 +147,28 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
@@ -184,7 +184,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -231,7 +231,7 @@ create table t1 (word varchar(20))
SET TIMESTAMP=1000000000/*!*/;
create table t2 (id int auto_increment not null primary key)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")
@@ -239,7 +239,7 @@ insert into t1 values ("abirvalg")
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -248,7 +248,7 @@ insert into t2 values ()
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -256,7 +256,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -264,7 +264,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -272,7 +272,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
@@ -291,7 +291,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -308,7 +308,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
@@ -328,7 +328,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
@@ -341,28 +341,28 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
COMMIT
@@ -378,7 +378,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -553,7 +553,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a varchar(64) character set utf8)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
@@ -561,7 +561,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
@@ -570,7 +570,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
@@ -579,7 +579,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
@@ -587,7 +587,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
@@ -596,7 +596,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
@@ -605,7 +605,7 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` CHARACTER SET koi8r FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
diff --git a/mysql-test/main/mysqlbinlog_row_compressed.result b/mysql-test/main/mysqlbinlog_row_compressed.result
index d32c2c21b28..95a81c7305c 100644
--- a/mysql-test/main/mysqlbinlog_row_compressed.result
+++ b/mysql-test/main/mysqlbinlog_row_compressed.result
@@ -53,7 +53,7 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN
# at 727
#<date> server id 1 end_log_pos 769 CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 769
# at 843
@@ -82,7 +82,7 @@ COMMIT
# at 1040
#<date> server id 1 end_log_pos 1082 CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1082
# at 1158
@@ -111,7 +111,7 @@ COMMIT
# at 1354
#<date> server id 1 end_log_pos 1396 CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1396
# at 1474
@@ -140,7 +140,7 @@ COMMIT
# at 1669
#<date> server id 1 end_log_pos 1711 CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1711
# at 1786
@@ -169,7 +169,7 @@ COMMIT
# at 1982
#<date> server id 1 end_log_pos 2024 CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2024
# at 2078
@@ -231,7 +231,7 @@ COMMIT
# at 2298
#<date> server id 1 end_log_pos 2340 CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2340
# at 2406
@@ -312,7 +312,7 @@ COMMIT
# at 2634
#<date> server id 1 end_log_pos 2676 CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2676
# at 2713
@@ -374,7 +374,7 @@ COMMIT
# at 2934
#<date> server id 1 end_log_pos 2976 CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2976
# at 3013
diff --git a/mysql-test/main/mysqlbinlog_row_minimal.result b/mysql-test/main/mysqlbinlog_row_minimal.result
index 7133381420a..f385b4ca69a 100644
--- a/mysql-test/main/mysqlbinlog_row_minimal.result
+++ b/mysql-test/main/mysqlbinlog_row_minimal.result
@@ -51,7 +51,7 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN
# at 774
#<date> server id 1 end_log_pos 816 CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 816
# at 890
@@ -80,7 +80,7 @@ COMMIT
# at 1088
#<date> server id 1 end_log_pos 1130 CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1130
# at 1206
@@ -109,7 +109,7 @@ COMMIT
# at 1403
#<date> server id 1 end_log_pos 1445 CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1445
# at 1523
@@ -138,7 +138,7 @@ COMMIT
# at 1719
#<date> server id 1 end_log_pos 1761 CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1761
# at 1836
@@ -167,7 +167,7 @@ COMMIT
# at 2035
#<date> server id 1 end_log_pos 2077 CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2077
# at 2131
@@ -229,7 +229,7 @@ COMMIT
# at 2427
#<date> server id 1 end_log_pos 2469 CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2469
# at 2535
@@ -262,7 +262,7 @@ COMMIT
# at 2730
#<date> server id 1 end_log_pos 2772 CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2772
# at 2809
@@ -292,7 +292,7 @@ COMMIT
# at 2992
#<date> server id 1 end_log_pos 3034 CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 3034
# at 3071
@@ -357,7 +357,7 @@ DELIMITER /*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=16*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 429
# at 543
diff --git a/mysql-test/main/mysqlbinlog_stmt_compressed.result b/mysql-test/main/mysqlbinlog_stmt_compressed.result
index 82f36f42fcb..078e6a746ff 100644
--- a/mysql-test/main/mysqlbinlog_stmt_compressed.result
+++ b/mysql-test/main/mysqlbinlog_stmt_compressed.result
@@ -53,7 +53,7 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN
# at 727
#<date> server id 1 end_log_pos 769 CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 769
#<date> server id 1 end_log_pos 897 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -68,7 +68,7 @@ COMMIT
# at 970
#<date> server id 1 end_log_pos 1012 CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1012
#<date> server id 1 end_log_pos 1140 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -83,7 +83,7 @@ COMMIT
# at 1213
#<date> server id 1 end_log_pos 1255 CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1255
#<date> server id 1 end_log_pos 1385 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -98,7 +98,7 @@ COMMIT
# at 1458
#<date> server id 1 end_log_pos 1500 CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1500
#<date> server id 1 end_log_pos 1627 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -113,7 +113,7 @@ COMMIT
# at 1700
#<date> server id 1 end_log_pos 1742 CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1742
#<date> server id 1 end_log_pos 1850 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -128,7 +128,7 @@ COMMIT
# at 1923
#<date> server id 1 end_log_pos 1965 CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 1965
#<date> server id 1 end_log_pos 2082 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -143,7 +143,7 @@ COMMIT
# at 2155
#<date> server id 1 end_log_pos 2197 CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2197
#<date> server id 1 end_log_pos 2288 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
@@ -158,7 +158,7 @@ COMMIT
# at 2361
#<date> server id 1 end_log_pos 2403 CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at 2403
#<date> server id 1 end_log_pos 2494 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result
index 72d4c2e52d8..2a58ba430ca 100644
--- a/mysql-test/main/mysqltest_tracking_info.result
+++ b/mysql-test/main/mysqltest_tracking_info.result
@@ -46,6 +46,18 @@ set @@optimizer_switch=@save_optimizer_switch;
SET @@session.session_track_system_variables= @save_session_track_system_variables;
# End of 10.2 tests
#
+# MDEV-22134 handle_fatal_signal (sig=11) in __strlen_avx2 on START
+# SLAVE | Assertion
+# `global_system_variables.session_track_system_variables' failed in
+# Session_sysvars_tracker::init | *** buffer overflow detected ***
+# (on optimized builds)
+#
+SET @@GLOBAL.session_track_system_variables=NULL;
+ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
+SET SESSION session_track_system_variables=NULL;
+ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
+# End of 10.3 tests
+#
# MDEV-16470 - Session user variables tracker
#
# End of 10.5 tests
diff --git a/mysql-test/main/mysqltest_tracking_info.test b/mysql-test/main/mysqltest_tracking_info.test
index 37f6115124f..a3dfbba53c0 100644
--- a/mysql-test/main/mysqltest_tracking_info.test
+++ b/mysql-test/main/mysqltest_tracking_info.test
@@ -47,6 +47,21 @@ SET @@session.session_track_system_variables= @save_session_track_system_variabl
--echo # End of 10.2 tests
--echo #
+--echo # MDEV-22134 handle_fatal_signal (sig=11) in __strlen_avx2 on START
+--echo # SLAVE | Assertion
+--echo # `global_system_variables.session_track_system_variables' failed in
+--echo # Session_sysvars_tracker::init | *** buffer overflow detected ***
+--echo # (on optimized builds)
+--echo #
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@GLOBAL.session_track_system_variables=NULL;
+--error ER_WRONG_VALUE_FOR_VAR
+SET SESSION session_track_system_variables=NULL;
+
+--echo # End of 10.3 tests
+
+--echo #
--echo # MDEV-16470 - Session user variables tracker
--echo #
#SET @@session.session_track_user_variables=1;
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index af564eb280d..9483dfee9fb 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1930,6 +1930,14 @@ i
1
i
2
+#
+# MDEV-21998: Server crashes in st_select_lex::add_table_to_list
+# upon mix of KILL and sequences
+#
+KILL ( SELECT 1 ) + LASTVAL(s);
+ERROR 42000: KILL does not support subqueries or stored functions
+KILL LASTVAL(s);
+ERROR 42000: KILL does not support subqueries or stored functions
# End of 10.4 tests
#
# Start of 10.5 tests
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 368cfa01bee..07f2d409d94 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1679,7 +1679,15 @@ $$
DELIMITER ;$$
+--echo #
+--echo # MDEV-21998: Server crashes in st_select_lex::add_table_to_list
+--echo # upon mix of KILL and sequences
+--echo #
+--error ER_SUBQUERIES_NOT_SUPPORTED
+KILL ( SELECT 1 ) + LASTVAL(s);
+--error ER_SUBQUERIES_NOT_SUPPORTED
+KILL LASTVAL(s);
--echo # End of 10.4 tests
diff --git a/mysql-test/main/plugin.result b/mysql-test/main/plugin.result
index 6fbbc0a880a..50986b95ccc 100644
--- a/mysql-test/main/plugin.result
+++ b/mysql-test/main/plugin.result
@@ -342,6 +342,19 @@ ERROR 42S02: Table 'test.t1' doesn't exist
DROP TABLE t1;
# End of 10.1 test
#
+# MDEV-21258: Can't uninstall plugin if the library file doesn't exist
+#
+insert into mysql.plugin values ("unexisting_plugin", "soname");
+select * from mysql.plugin WHERE name='unexisting_plugin';
+name dl
+unexisting_plugin soname
+UNINSTALL PLUGIN unexisting_plugin;
+select * from mysql.plugin WHERE name='unexisting_plugin';
+name dl
+UNINSTALL PLUGIN unexisting_plugin;
+ERROR 42000: PLUGIN unexisting_plugin does not exist
+# End of 10.2 tests
+#
# MDEV-16294: INSTALL PLUGIN IF NOT EXISTS / UNINSTALL PLUGIN IF EXISTS
#
# INSTALL IF NOT EXISTS PLUGIN name SONAME library /
@@ -403,3 +416,4 @@ INSTALL PLUGIN example SONAME 'ha_example';
CREATE TEMPORARY TABLE t1(a INT) ENGINE=example;
DROP TABLE t1;
UNINSTALL PLUGIN example;
+# End of 10.4 tests
diff --git a/mysql-test/main/plugin.test b/mysql-test/main/plugin.test
index 5a855a1276e..19199f767f5 100644
--- a/mysql-test/main/plugin.test
+++ b/mysql-test/main/plugin.test
@@ -277,8 +277,27 @@ DROP TABLE t1;
--echo # End of 10.1 test
---source include/install_plugin_if_exists.inc
+--echo #
+--echo # MDEV-21258: Can't uninstall plugin if the library file doesn't exist
+--echo #
+
+insert into mysql.plugin values ("unexisting_plugin", "soname");
+
+# check that we have the plugin installed
+select * from mysql.plugin WHERE name='unexisting_plugin';
+
+# make attempt to uninstall the plugin
+UNINSTALL PLUGIN unexisting_plugin;
+# check that we have the plugin uninstalled
+select * from mysql.plugin WHERE name='unexisting_plugin';
+
+--error ER_SP_DOES_NOT_EXIST
+UNINSTALL PLUGIN unexisting_plugin;
+
+--echo # End of 10.2 tests
+
+--source include/install_plugin_if_exists.inc
--echo #
--echo # Make sure temporary tables maintain plugin references properly
@@ -294,3 +313,5 @@ INSTALL PLUGIN example SONAME 'ha_example';
CREATE TEMPORARY TABLE t1(a INT) ENGINE=example;
DROP TABLE t1;
UNINSTALL PLUGIN example;
+
+--echo # End of 10.4 tests
diff --git a/mysql-test/main/signal.result b/mysql-test/main/signal.result
index 40b1609fc26..b5b479db017 100644
--- a/mysql-test/main/signal.result
+++ b/mysql-test/main/signal.result
@@ -2285,13 +2285,13 @@ begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo SET MYSQL_ERRNO = `65`; /* illegal */
end $$
-ERROR 42S22: Unknown column '65' in 'field list'
+ERROR 42000: Undeclared variable: 65
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo SET MYSQL_ERRNO = `A`; /* illegal */
end $$
-ERROR 42S22: Unknown column 'A' in 'field list'
+ERROR 42000: Undeclared variable: A
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -2342,7 +2342,7 @@ DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo SET MYSQL_ERRNO = 1000,
MESSAGE_TEXT = `Hello`;
end $$
-ERROR 42S22: Unknown column 'Hello' in 'field list'
+ERROR 42000: Undeclared variable: Hello
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
diff --git a/mysql-test/main/signal.test b/mysql-test/main/signal.test
index 5b40863b0e6..22cfc080895 100644
--- a/mysql-test/main/signal.test
+++ b/mysql-test/main/signal.test
@@ -2546,7 +2546,7 @@ end $$
call test_signal $$
drop procedure test_signal $$
--- error ER_BAD_FIELD_ERROR
+-- error ER_SP_UNDECLARED_VAR
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -2554,7 +2554,7 @@ begin
end $$
--- error ER_BAD_FIELD_ERROR
+-- error ER_SP_UNDECLARED_VAR
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
@@ -2616,7 +2616,7 @@ end $$
call test_signal $$
drop procedure test_signal $$
--- error ER_BAD_FIELD_ERROR
+-- error ER_SP_UNDECLARED_VAR
create procedure test_signal()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
diff --git a/mysql-test/main/sp-error.result b/mysql-test/main/sp-error.result
index 35aaec5663e..55777da3ee8 100644
--- a/mysql-test/main/sp-error.result
+++ b/mysql-test/main/sp-error.result
@@ -452,7 +452,7 @@ else
set b = a;
end if;
end|
-ERROR 42S22: Unknown column 'aa' in 'field list'
+ERROR 42000: Undeclared variable: aa
create procedure bug4344() drop procedure bug4344|
ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine
create procedure bug4344() drop function bug4344|
@@ -1067,7 +1067,7 @@ IF bug13037_foo THEN
SELECT 1;
END IF;
END|
-ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+ERROR 42000: Undeclared variable: bug13037_foo
CREATE PROCEDURE bug13037_p2()
BEGIN
SET @bug13037_foo = bug13037_bar;
diff --git a/mysql-test/main/sp-error.test b/mysql-test/main/sp-error.test
index 36bb3cfe4d3..4eb1a00caa4 100644
--- a/mysql-test/main/sp-error.test
+++ b/mysql-test/main/sp-error.test
@@ -612,7 +612,7 @@ create procedure bug2653_1(a int, out b int)
set b = aa|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug2653_2(a int, out b int)
begin
if aa < 0 then
@@ -1505,7 +1505,7 @@ DROP PROCEDURE IF EXISTS bug13037_p3;
delimiter |;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE bug13037_p1()
BEGIN
IF bug13037_foo THEN
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index dd7e12949f4..ed20689ed11 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -4184,7 +4184,7 @@ select v, isnull(v);
end if;
end;
end|
-ERROR 42S22: Unknown column 'undefined_var' in 'field list'
+ERROR 42000: Undeclared variable: undefined_var
create procedure bug14643_2()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
@@ -4196,7 +4196,7 @@ select 2;
end case;
select undefined_var;
end|
-ERROR 42S22: Unknown column 'undefined_var' in 'field list'
+ERROR 42000: Undeclared variable: undefined_var
drop procedure if exists bug14304|
drop table if exists t3, t4|
create table t3(a int primary key auto_increment)|
@@ -4226,7 +4226,7 @@ create procedure bug14376()
begin
declare x int default x;
end|
-ERROR 42S22: Unknown column 'x' in 'field list'
+ERROR 42000: Undeclared variable: x
create procedure bug14376()
begin
declare x int default 42;
@@ -4481,7 +4481,7 @@ select 'no' as 'v';
end if;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_2()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4490,7 +4490,7 @@ select 'yes' as 'v';
end while;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_3()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4499,7 +4499,7 @@ select 'maybe' as 'v';
until v end repeat;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_4()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4513,7 +4513,7 @@ select '?' as 'v';
end case;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
create procedure bug14498_5()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -4527,7 +4527,7 @@ select '?' as 'v';
end case;
select 'done' as 'End';
end|
-ERROR 42S22: Unknown column 'v' in 'field list'
+ERROR 42000: Undeclared variable: v
drop table if exists t3|
drop procedure if exists bug15231_1|
drop procedure if exists bug15231_2|
@@ -8401,7 +8401,7 @@ DECLARE name VARCHAR(10);
SET name="hello";
call p1(name2);
END|
-ERROR 42S22: Unknown column 'name2' in 'field list'
+ERROR 42000: Undeclared variable: name2
call p2();
a
hello
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index 7d1e8e2a8f9..bddd07bdb6c 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -5046,7 +5046,7 @@ drop procedure if exists bug14643_1|
drop procedure if exists bug14643_2|
--enable_warnings
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14643_1()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
@@ -5062,7 +5062,7 @@ begin
end;
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14643_2()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
@@ -5117,7 +5117,7 @@ drop table t3, t4|
drop procedure if exists bug14376|
--enable_warnings
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14376()
begin
declare x int default x;
@@ -5344,7 +5344,7 @@ drop procedure if exists bug14498_4|
drop procedure if exists bug14498_5|
--enable_warnings
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_1()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5357,7 +5357,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_2()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5368,7 +5368,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_3()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5379,7 +5379,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_4()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -5395,7 +5395,7 @@ begin
select 'done' as 'End';
end|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
create procedure bug14498_5()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
@@ -9931,7 +9931,7 @@ BEGIN
call p1(name);
END|
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE OR REPLACE PROCEDURE p3 ()
BEGIN
DECLARE name VARCHAR(10);
diff --git a/mysql-test/main/type_bit.result b/mysql-test/main/type_bit.result
index 35a05388754..f44bdf70c4a 100644
--- a/mysql-test/main/type_bit.result
+++ b/mysql-test/main/type_bit.result
@@ -876,6 +876,989 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1;
#
+# MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+#
+BEGIN NOT ATOMIC
+FOR i IN 1..64
+DO
+SELECT '-----', CONCAT('BIT(',i,')') AS Type;
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a BIT(64))','64', i);
+INSERT IGNORE INTO t1 VALUES (0xFFFFFFFFFFFFFFFF);
+CREATE TABLE t2 AS SELECT
+a,
+FLOOR(a) AS cf,
+CEILING(a) AS cc,
+ROUND(a) AS cr,
+TRUNCATE(a,0) AS ct
+FROM t1;
+SHOW CREATE TABLE t2;
+SELECT CAST(a AS UNSIGNED) AS a, cf, cc, cr, ct FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
+END FOR;
+END;
+$$
+----- -----
+Type BIT(1)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(1) DEFAULT NULL,
+ `cf` int(1) unsigned DEFAULT NULL,
+ `cc` int(1) unsigned DEFAULT NULL,
+ `cr` int(1) unsigned DEFAULT NULL,
+ `ct` int(1) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1
+cf 1
+cc 1
+cr 1
+ct 1
+----- -----
+Type BIT(2)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(2) DEFAULT NULL,
+ `cf` int(1) unsigned DEFAULT NULL,
+ `cc` int(1) unsigned DEFAULT NULL,
+ `cr` int(1) unsigned DEFAULT NULL,
+ `ct` int(1) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 3
+cf 3
+cc 3
+cr 3
+ct 3
+----- -----
+Type BIT(3)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(3) DEFAULT NULL,
+ `cf` int(1) unsigned DEFAULT NULL,
+ `cc` int(1) unsigned DEFAULT NULL,
+ `cr` int(1) unsigned DEFAULT NULL,
+ `ct` int(1) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 7
+cf 7
+cc 7
+cr 7
+ct 7
+----- -----
+Type BIT(4)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(4) DEFAULT NULL,
+ `cf` int(2) unsigned DEFAULT NULL,
+ `cc` int(2) unsigned DEFAULT NULL,
+ `cr` int(2) unsigned DEFAULT NULL,
+ `ct` int(2) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 15
+cf 15
+cc 15
+cr 15
+ct 15
+----- -----
+Type BIT(5)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(5) DEFAULT NULL,
+ `cf` int(2) unsigned DEFAULT NULL,
+ `cc` int(2) unsigned DEFAULT NULL,
+ `cr` int(2) unsigned DEFAULT NULL,
+ `ct` int(2) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 31
+cf 31
+cc 31
+cr 31
+ct 31
+----- -----
+Type BIT(6)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(6) DEFAULT NULL,
+ `cf` int(2) unsigned DEFAULT NULL,
+ `cc` int(2) unsigned DEFAULT NULL,
+ `cr` int(2) unsigned DEFAULT NULL,
+ `ct` int(2) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 63
+cf 63
+cc 63
+cr 63
+ct 63
+----- -----
+Type BIT(7)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(7) DEFAULT NULL,
+ `cf` int(3) unsigned DEFAULT NULL,
+ `cc` int(3) unsigned DEFAULT NULL,
+ `cr` int(3) unsigned DEFAULT NULL,
+ `ct` int(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 127
+cf 127
+cc 127
+cr 127
+ct 127
+----- -----
+Type BIT(8)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(8) DEFAULT NULL,
+ `cf` int(3) unsigned DEFAULT NULL,
+ `cc` int(3) unsigned DEFAULT NULL,
+ `cr` int(3) unsigned DEFAULT NULL,
+ `ct` int(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 255
+cf 255
+cc 255
+cr 255
+ct 255
+----- -----
+Type BIT(9)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(9) DEFAULT NULL,
+ `cf` int(3) unsigned DEFAULT NULL,
+ `cc` int(3) unsigned DEFAULT NULL,
+ `cr` int(3) unsigned DEFAULT NULL,
+ `ct` int(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 511
+cf 511
+cc 511
+cr 511
+ct 511
+----- -----
+Type BIT(10)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(10) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1023
+cf 1023
+cc 1023
+cr 1023
+ct 1023
+----- -----
+Type BIT(11)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(11) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2047
+cf 2047
+cc 2047
+cr 2047
+ct 2047
+----- -----
+Type BIT(12)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(12) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4095
+cf 4095
+cc 4095
+cr 4095
+ct 4095
+----- -----
+Type BIT(13)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(13) DEFAULT NULL,
+ `cf` int(4) unsigned DEFAULT NULL,
+ `cc` int(4) unsigned DEFAULT NULL,
+ `cr` int(4) unsigned DEFAULT NULL,
+ `ct` int(4) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8191
+cf 8191
+cc 8191
+cr 8191
+ct 8191
+----- -----
+Type BIT(14)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(14) DEFAULT NULL,
+ `cf` int(5) unsigned DEFAULT NULL,
+ `cc` int(5) unsigned DEFAULT NULL,
+ `cr` int(5) unsigned DEFAULT NULL,
+ `ct` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 16383
+cf 16383
+cc 16383
+cr 16383
+ct 16383
+----- -----
+Type BIT(15)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(15) DEFAULT NULL,
+ `cf` int(5) unsigned DEFAULT NULL,
+ `cc` int(5) unsigned DEFAULT NULL,
+ `cr` int(5) unsigned DEFAULT NULL,
+ `ct` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 32767
+cf 32767
+cc 32767
+cr 32767
+ct 32767
+----- -----
+Type BIT(16)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(16) DEFAULT NULL,
+ `cf` int(5) unsigned DEFAULT NULL,
+ `cc` int(5) unsigned DEFAULT NULL,
+ `cr` int(5) unsigned DEFAULT NULL,
+ `ct` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 65535
+cf 65535
+cc 65535
+cr 65535
+ct 65535
+----- -----
+Type BIT(17)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(17) DEFAULT NULL,
+ `cf` int(6) unsigned DEFAULT NULL,
+ `cc` int(6) unsigned DEFAULT NULL,
+ `cr` int(6) unsigned DEFAULT NULL,
+ `ct` int(6) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 131071
+cf 131071
+cc 131071
+cr 131071
+ct 131071
+----- -----
+Type BIT(18)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(18) DEFAULT NULL,
+ `cf` int(6) unsigned DEFAULT NULL,
+ `cc` int(6) unsigned DEFAULT NULL,
+ `cr` int(6) unsigned DEFAULT NULL,
+ `ct` int(6) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 262143
+cf 262143
+cc 262143
+cr 262143
+ct 262143
+----- -----
+Type BIT(19)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(19) DEFAULT NULL,
+ `cf` int(6) unsigned DEFAULT NULL,
+ `cc` int(6) unsigned DEFAULT NULL,
+ `cr` int(6) unsigned DEFAULT NULL,
+ `ct` int(6) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 524287
+cf 524287
+cc 524287
+cr 524287
+ct 524287
+----- -----
+Type BIT(20)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(20) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1048575
+cf 1048575
+cc 1048575
+cr 1048575
+ct 1048575
+----- -----
+Type BIT(21)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(21) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2097151
+cf 2097151
+cc 2097151
+cr 2097151
+ct 2097151
+----- -----
+Type BIT(22)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(22) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4194303
+cf 4194303
+cc 4194303
+cr 4194303
+ct 4194303
+----- -----
+Type BIT(23)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(23) DEFAULT NULL,
+ `cf` int(7) unsigned DEFAULT NULL,
+ `cc` int(7) unsigned DEFAULT NULL,
+ `cr` int(7) unsigned DEFAULT NULL,
+ `ct` int(7) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8388607
+cf 8388607
+cc 8388607
+cr 8388607
+ct 8388607
+----- -----
+Type BIT(24)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(24) DEFAULT NULL,
+ `cf` int(8) unsigned DEFAULT NULL,
+ `cc` int(8) unsigned DEFAULT NULL,
+ `cr` int(8) unsigned DEFAULT NULL,
+ `ct` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 16777215
+cf 16777215
+cc 16777215
+cr 16777215
+ct 16777215
+----- -----
+Type BIT(25)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(25) DEFAULT NULL,
+ `cf` int(8) unsigned DEFAULT NULL,
+ `cc` int(8) unsigned DEFAULT NULL,
+ `cr` int(8) unsigned DEFAULT NULL,
+ `ct` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 33554431
+cf 33554431
+cc 33554431
+cr 33554431
+ct 33554431
+----- -----
+Type BIT(26)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(26) DEFAULT NULL,
+ `cf` int(8) unsigned DEFAULT NULL,
+ `cc` int(8) unsigned DEFAULT NULL,
+ `cr` int(8) unsigned DEFAULT NULL,
+ `ct` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 67108863
+cf 67108863
+cc 67108863
+cr 67108863
+ct 67108863
+----- -----
+Type BIT(27)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(27) DEFAULT NULL,
+ `cf` int(9) unsigned DEFAULT NULL,
+ `cc` int(9) unsigned DEFAULT NULL,
+ `cr` int(9) unsigned DEFAULT NULL,
+ `ct` int(9) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 134217727
+cf 134217727
+cc 134217727
+cr 134217727
+ct 134217727
+----- -----
+Type BIT(28)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(28) DEFAULT NULL,
+ `cf` int(9) unsigned DEFAULT NULL,
+ `cc` int(9) unsigned DEFAULT NULL,
+ `cr` int(9) unsigned DEFAULT NULL,
+ `ct` int(9) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 268435455
+cf 268435455
+cc 268435455
+cr 268435455
+ct 268435455
+----- -----
+Type BIT(29)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(29) DEFAULT NULL,
+ `cf` int(9) unsigned DEFAULT NULL,
+ `cc` int(9) unsigned DEFAULT NULL,
+ `cr` int(9) unsigned DEFAULT NULL,
+ `ct` int(9) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 536870911
+cf 536870911
+cc 536870911
+cr 536870911
+ct 536870911
+----- -----
+Type BIT(30)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(30) DEFAULT NULL,
+ `cf` int(10) unsigned DEFAULT NULL,
+ `cc` int(10) unsigned DEFAULT NULL,
+ `cr` int(10) unsigned DEFAULT NULL,
+ `ct` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1073741823
+cf 1073741823
+cc 1073741823
+cr 1073741823
+ct 1073741823
+----- -----
+Type BIT(31)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(31) DEFAULT NULL,
+ `cf` int(10) unsigned DEFAULT NULL,
+ `cc` int(10) unsigned DEFAULT NULL,
+ `cr` int(10) unsigned DEFAULT NULL,
+ `ct` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2147483647
+cf 2147483647
+cc 2147483647
+cr 2147483647
+ct 2147483647
+----- -----
+Type BIT(32)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(32) DEFAULT NULL,
+ `cf` int(10) unsigned DEFAULT NULL,
+ `cc` int(10) unsigned DEFAULT NULL,
+ `cr` int(10) unsigned DEFAULT NULL,
+ `ct` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4294967295
+cf 4294967295
+cc 4294967295
+cr 4294967295
+ct 4294967295
+----- -----
+Type BIT(33)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(33) DEFAULT NULL,
+ `cf` bigint(10) unsigned DEFAULT NULL,
+ `cc` bigint(10) unsigned DEFAULT NULL,
+ `cr` bigint(10) unsigned DEFAULT NULL,
+ `ct` bigint(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8589934591
+cf 8589934591
+cc 8589934591
+cr 8589934591
+ct 8589934591
+----- -----
+Type BIT(34)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(34) DEFAULT NULL,
+ `cf` bigint(11) unsigned DEFAULT NULL,
+ `cc` bigint(11) unsigned DEFAULT NULL,
+ `cr` bigint(11) unsigned DEFAULT NULL,
+ `ct` bigint(11) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 17179869183
+cf 17179869183
+cc 17179869183
+cr 17179869183
+ct 17179869183
+----- -----
+Type BIT(35)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(35) DEFAULT NULL,
+ `cf` bigint(11) unsigned DEFAULT NULL,
+ `cc` bigint(11) unsigned DEFAULT NULL,
+ `cr` bigint(11) unsigned DEFAULT NULL,
+ `ct` bigint(11) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 34359738367
+cf 34359738367
+cc 34359738367
+cr 34359738367
+ct 34359738367
+----- -----
+Type BIT(36)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(36) DEFAULT NULL,
+ `cf` bigint(11) unsigned DEFAULT NULL,
+ `cc` bigint(11) unsigned DEFAULT NULL,
+ `cr` bigint(11) unsigned DEFAULT NULL,
+ `ct` bigint(11) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 68719476735
+cf 68719476735
+cc 68719476735
+cr 68719476735
+ct 68719476735
+----- -----
+Type BIT(37)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(37) DEFAULT NULL,
+ `cf` bigint(12) unsigned DEFAULT NULL,
+ `cc` bigint(12) unsigned DEFAULT NULL,
+ `cr` bigint(12) unsigned DEFAULT NULL,
+ `ct` bigint(12) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 137438953471
+cf 137438953471
+cc 137438953471
+cr 137438953471
+ct 137438953471
+----- -----
+Type BIT(38)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(38) DEFAULT NULL,
+ `cf` bigint(12) unsigned DEFAULT NULL,
+ `cc` bigint(12) unsigned DEFAULT NULL,
+ `cr` bigint(12) unsigned DEFAULT NULL,
+ `ct` bigint(12) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 274877906943
+cf 274877906943
+cc 274877906943
+cr 274877906943
+ct 274877906943
+----- -----
+Type BIT(39)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(39) DEFAULT NULL,
+ `cf` bigint(12) unsigned DEFAULT NULL,
+ `cc` bigint(12) unsigned DEFAULT NULL,
+ `cr` bigint(12) unsigned DEFAULT NULL,
+ `ct` bigint(12) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 549755813887
+cf 549755813887
+cc 549755813887
+cr 549755813887
+ct 549755813887
+----- -----
+Type BIT(40)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(40) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1099511627775
+cf 1099511627775
+cc 1099511627775
+cr 1099511627775
+ct 1099511627775
+----- -----
+Type BIT(41)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(41) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2199023255551
+cf 2199023255551
+cc 2199023255551
+cr 2199023255551
+ct 2199023255551
+----- -----
+Type BIT(42)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(42) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4398046511103
+cf 4398046511103
+cc 4398046511103
+cr 4398046511103
+ct 4398046511103
+----- -----
+Type BIT(43)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(43) DEFAULT NULL,
+ `cf` bigint(13) unsigned DEFAULT NULL,
+ `cc` bigint(13) unsigned DEFAULT NULL,
+ `cr` bigint(13) unsigned DEFAULT NULL,
+ `ct` bigint(13) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 8796093022207
+cf 8796093022207
+cc 8796093022207
+cr 8796093022207
+ct 8796093022207
+----- -----
+Type BIT(44)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(44) DEFAULT NULL,
+ `cf` bigint(14) unsigned DEFAULT NULL,
+ `cc` bigint(14) unsigned DEFAULT NULL,
+ `cr` bigint(14) unsigned DEFAULT NULL,
+ `ct` bigint(14) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 17592186044415
+cf 17592186044415
+cc 17592186044415
+cr 17592186044415
+ct 17592186044415
+----- -----
+Type BIT(45)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(45) DEFAULT NULL,
+ `cf` bigint(14) unsigned DEFAULT NULL,
+ `cc` bigint(14) unsigned DEFAULT NULL,
+ `cr` bigint(14) unsigned DEFAULT NULL,
+ `ct` bigint(14) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 35184372088831
+cf 35184372088831
+cc 35184372088831
+cr 35184372088831
+ct 35184372088831
+----- -----
+Type BIT(46)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(46) DEFAULT NULL,
+ `cf` bigint(14) unsigned DEFAULT NULL,
+ `cc` bigint(14) unsigned DEFAULT NULL,
+ `cr` bigint(14) unsigned DEFAULT NULL,
+ `ct` bigint(14) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 70368744177663
+cf 70368744177663
+cc 70368744177663
+cr 70368744177663
+ct 70368744177663
+----- -----
+Type BIT(47)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(47) DEFAULT NULL,
+ `cf` bigint(15) unsigned DEFAULT NULL,
+ `cc` bigint(15) unsigned DEFAULT NULL,
+ `cr` bigint(15) unsigned DEFAULT NULL,
+ `ct` bigint(15) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 140737488355327
+cf 140737488355327
+cc 140737488355327
+cr 140737488355327
+ct 140737488355327
+----- -----
+Type BIT(48)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(48) DEFAULT NULL,
+ `cf` bigint(15) unsigned DEFAULT NULL,
+ `cc` bigint(15) unsigned DEFAULT NULL,
+ `cr` bigint(15) unsigned DEFAULT NULL,
+ `ct` bigint(15) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 281474976710655
+cf 281474976710655
+cc 281474976710655
+cr 281474976710655
+ct 281474976710655
+----- -----
+Type BIT(49)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(49) DEFAULT NULL,
+ `cf` bigint(15) unsigned DEFAULT NULL,
+ `cc` bigint(15) unsigned DEFAULT NULL,
+ `cr` bigint(15) unsigned DEFAULT NULL,
+ `ct` bigint(15) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 562949953421311
+cf 562949953421311
+cc 562949953421311
+cr 562949953421311
+ct 562949953421311
+----- -----
+Type BIT(50)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(50) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1125899906842623
+cf 1125899906842623
+cc 1125899906842623
+cr 1125899906842623
+ct 1125899906842623
+----- -----
+Type BIT(51)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(51) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2251799813685247
+cf 2251799813685247
+cc 2251799813685247
+cr 2251799813685247
+ct 2251799813685247
+----- -----
+Type BIT(52)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(52) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4503599627370495
+cf 4503599627370495
+cc 4503599627370495
+cr 4503599627370495
+ct 4503599627370495
+----- -----
+Type BIT(53)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(53) DEFAULT NULL,
+ `cf` bigint(16) unsigned DEFAULT NULL,
+ `cc` bigint(16) unsigned DEFAULT NULL,
+ `cr` bigint(16) unsigned DEFAULT NULL,
+ `ct` bigint(16) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 9007199254740991
+cf 9007199254740991
+cc 9007199254740991
+cr 9007199254740991
+ct 9007199254740991
+----- -----
+Type BIT(54)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(54) DEFAULT NULL,
+ `cf` bigint(17) unsigned DEFAULT NULL,
+ `cc` bigint(17) unsigned DEFAULT NULL,
+ `cr` bigint(17) unsigned DEFAULT NULL,
+ `ct` bigint(17) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 18014398509481983
+cf 18014398509481983
+cc 18014398509481983
+cr 18014398509481983
+ct 18014398509481983
+----- -----
+Type BIT(55)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(55) DEFAULT NULL,
+ `cf` bigint(17) unsigned DEFAULT NULL,
+ `cc` bigint(17) unsigned DEFAULT NULL,
+ `cr` bigint(17) unsigned DEFAULT NULL,
+ `ct` bigint(17) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 36028797018963967
+cf 36028797018963967
+cc 36028797018963967
+cr 36028797018963967
+ct 36028797018963967
+----- -----
+Type BIT(56)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(56) DEFAULT NULL,
+ `cf` bigint(17) unsigned DEFAULT NULL,
+ `cc` bigint(17) unsigned DEFAULT NULL,
+ `cr` bigint(17) unsigned DEFAULT NULL,
+ `ct` bigint(17) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 72057594037927935
+cf 72057594037927935
+cc 72057594037927935
+cr 72057594037927935
+ct 72057594037927935
+----- -----
+Type BIT(57)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(57) DEFAULT NULL,
+ `cf` bigint(18) unsigned DEFAULT NULL,
+ `cc` bigint(18) unsigned DEFAULT NULL,
+ `cr` bigint(18) unsigned DEFAULT NULL,
+ `ct` bigint(18) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 144115188075855871
+cf 144115188075855871
+cc 144115188075855871
+cr 144115188075855871
+ct 144115188075855871
+----- -----
+Type BIT(58)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(58) DEFAULT NULL,
+ `cf` bigint(18) unsigned DEFAULT NULL,
+ `cc` bigint(18) unsigned DEFAULT NULL,
+ `cr` bigint(18) unsigned DEFAULT NULL,
+ `ct` bigint(18) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 288230376151711743
+cf 288230376151711743
+cc 288230376151711743
+cr 288230376151711743
+ct 288230376151711743
+----- -----
+Type BIT(59)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(59) DEFAULT NULL,
+ `cf` bigint(18) unsigned DEFAULT NULL,
+ `cc` bigint(18) unsigned DEFAULT NULL,
+ `cr` bigint(18) unsigned DEFAULT NULL,
+ `ct` bigint(18) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 576460752303423487
+cf 576460752303423487
+cc 576460752303423487
+cr 576460752303423487
+ct 576460752303423487
+----- -----
+Type BIT(60)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(60) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 1152921504606846975
+cf 1152921504606846975
+cc 1152921504606846975
+cr 1152921504606846975
+ct 1152921504606846975
+----- -----
+Type BIT(61)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(61) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 2305843009213693951
+cf 2305843009213693951
+cc 2305843009213693951
+cr 2305843009213693951
+ct 2305843009213693951
+----- -----
+Type BIT(62)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(62) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 4611686018427387903
+cf 4611686018427387903
+cc 4611686018427387903
+cr 4611686018427387903
+ct 4611686018427387903
+----- -----
+Type BIT(63)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(63) DEFAULT NULL,
+ `cf` bigint(19) unsigned DEFAULT NULL,
+ `cc` bigint(19) unsigned DEFAULT NULL,
+ `cr` bigint(19) unsigned DEFAULT NULL,
+ `ct` bigint(19) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 9223372036854775807
+cf 9223372036854775807
+cc 9223372036854775807
+cr 9223372036854775807
+ct 9223372036854775807
+----- -----
+Type BIT(64)
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bit(64) DEFAULT NULL,
+ `cf` bigint(20) unsigned DEFAULT NULL,
+ `cc` bigint(20) unsigned DEFAULT NULL,
+ `cr` bigint(20) unsigned DEFAULT NULL,
+ `ct` bigint(20) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 18446744073709551615
+cf 18446744073709551615
+cc 18446744073709551615
+cr 18446744073709551615
+ct 18446744073709551615
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/type_bit.test b/mysql-test/main/type_bit.test
index 3085d46bab6..2e66c7fb7cd 100644
--- a/mysql-test/main/type_bit.test
+++ b/mysql-test/main/type_bit.test
@@ -507,6 +507,35 @@ EXPLAIN SELECT * FROM t1 WHERE a=200;
EXPLAIN SELECT * FROM t1 WHERE a<=>200;
DROP TABLE t1;
+--echo #
+--echo # MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+--echo #
+
+--vertical_results
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ FOR i IN 1..64
+ DO
+ SELECT '-----', CONCAT('BIT(',i,')') AS Type;
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a BIT(64))','64', i);
+ INSERT IGNORE INTO t1 VALUES (0xFFFFFFFFFFFFFFFF);
+ CREATE TABLE t2 AS SELECT
+ a,
+ FLOOR(a) AS cf,
+ CEILING(a) AS cc,
+ ROUND(a) AS cr,
+ TRUNCATE(a,0) AS ct
+ FROM t1;
+ SHOW CREATE TABLE t2;
+ SELECT CAST(a AS UNSIGNED) AS a, cf, cc, cr, ct FROM t2;
+ DROP TABLE t2;
+ DROP TABLE t1;
+ END FOR;
+END;
+$$
+DELIMITER ;$$
+--horizontal_results
+
--echo #
--echo # End of 10.4 tests
diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result
index aa5d6ccadc1..84301a4b191 100644
--- a/mysql-test/main/type_date.result
+++ b/mysql-test/main/type_date.result
@@ -1089,5 +1089,19 @@ CAST(1012.5 AS DATE) * 1.0
Warnings:
Note 1292 Truncated incorrect date value: '1012.5'
#
+# MDEV-23351 Rounding functions return wrong data types for DATE input
+#
+CREATE TABLE t1 (a date);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `FLOOR(a)` int(8) unsigned DEFAULT NULL,
+ `CEIL(a)` int(8) unsigned DEFAULT NULL,
+ `ROUND(a)` int(8) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2,t1;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_date.test b/mysql-test/main/type_date.test
index c041295f845..33598846504 100644
--- a/mysql-test/main/type_date.test
+++ b/mysql-test/main/type_date.test
@@ -740,6 +740,14 @@ SET sql_mode=DEFAULT;
SELECT NULLIF(CAST(1012.5 AS DATE), 1);
SELECT CAST(1012.5 AS DATE) * 1.0;
+--echo #
+--echo # MDEV-23351 Rounding functions return wrong data types for DATE input
+--echo #
+
+CREATE TABLE t1 (a date);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2,t1;
--echo #
--echo # End of 10.4 tests
diff --git a/mysql-test/main/type_datetime_hires.result b/mysql-test/main/type_datetime_hires.result
index 5211515ea77..02adadd16c5 100644
--- a/mysql-test/main/type_datetime_hires.result
+++ b/mysql-test/main/type_datetime_hires.result
@@ -900,5 +900,170 @@ f
NULL
DROP TABLE t1;
#
+# MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+#
+CREATE TABLE t1 AS SELECT
+FLOOR(TIMESTAMP'2001-01-01 00:00:00.999999'),
+CEILING(TIMESTAMP'2001-01-01 00:00:00.999999');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `FLOOR(TIMESTAMP'2001-01-01 00:00:00.999999')` datetime DEFAULT NULL,
+ `CEILING(TIMESTAMP'2001-01-01 00:00:00.999999')` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.0');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.0');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.0');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.0');
+CREATE FUNCTION FLOOR_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+RETURN
+CASE
+WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ELSE TRUNCATE(a,0)
+END;
+END;
+$$
+CREATE FUNCTION CEILING_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+RETURN
+CASE
+WHEN TRUNCATE(a,0)=TIMESTAMP'9999-12-31 23:59:59' THEN a
+WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ELSE TRUNCATE(a,0)+INTERVAL 1 SECOND
+END;
+END;
+$$
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+a FLOOR(a) FLOOR_SP(a) FLOOR(a)=FLOOR_SP(a)
+0001-12-31 23:59:59.000000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.100000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.900000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.990000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999900 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999990 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.999999 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0999-12-31 23:59:59.000000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.100000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.900000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.990000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999900 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999990 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.999999 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+9999-12-30 23:59:59.000000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.100000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.900000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.990000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999900 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999990 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.999999 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-31 23:59:59.000000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.100000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.900000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.990000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999900 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999990 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999999 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+a CEILING(a) CEILING_SP(a) CEILING(a)=CEILING_SP(a)
+0001-12-31 23:59:59.000000 0001-12-31 23:59:59 0001-12-31 23:59:59 1
+0001-12-31 23:59:59.100000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.900000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.990000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999000 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999900 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999990 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0001-12-31 23:59:59.999999 0002-01-01 00:00:00 0002-01-01 00:00:00 1
+0999-12-31 23:59:59.000000 0999-12-31 23:59:59 0999-12-31 23:59:59 1
+0999-12-31 23:59:59.100000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.900000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.990000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999000 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999900 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999990 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+0999-12-31 23:59:59.999999 1000-01-01 00:00:00 1000-01-01 00:00:00 1
+9999-12-30 23:59:59.000000 9999-12-30 23:59:59 9999-12-30 23:59:59 1
+9999-12-30 23:59:59.100000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.900000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.990000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999000 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999900 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999990 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-30 23:59:59.999999 9999-12-31 00:00:00 9999-12-31 00:00:00 1
+9999-12-31 23:59:59.000000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.100000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.900000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.990000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999000 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999900 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999990 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+9999-12-31 23:59:59.999999 9999-12-31 23:59:59 9999-12-31 23:59:59 1
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('0000-00-00 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-00-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-01-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-00-00 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+a FLOOR(a) CEILING(a)
+0000-00-00 23:59:59.999999 0000-00-00 23:59:59 NULL
+0000-00-01 23:59:59.999999 0000-00-01 23:59:59 NULL
+0000-01-01 23:59:59.999999 0000-01-01 23:59:59 NULL
+0001-00-00 23:59:59.999999 0001-00-00 23:59:59 NULL
+Warnings:
+Warning 1411 Incorrect date value: '0000-00-00' for function round(datetime)
+Warning 1411 Incorrect date value: '0000-00-01' for function round(datetime)
+Warning 1411 Incorrect date value: '0000-01-01' for function round(datetime)
+Warning 1411 Incorrect date value: '0001-00-00' for function round(datetime)
+DROP TABLE t1;
+SET sql_mode=ALLOW_INVALID_DATES;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('2001-02-28 23:59:59.999999');
+INSERT INTO t1 VALUES ('2001-02-29 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+a FLOOR(a) CEILING(a)
+2001-02-28 23:59:59.999999 2001-02-28 23:59:59 2001-03-01 00:00:00
+2001-02-29 23:59:59.999999 2001-02-29 23:59:59 NULL
+Warnings:
+Warning 1411 Incorrect date value: '2001-02-29' for function round(datetime)
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_datetime_hires.test b/mysql-test/main/type_datetime_hires.test
index 7b3b37560a3..6476d7fb182 100644
--- a/mysql-test/main/type_datetime_hires.test
+++ b/mysql-test/main/type_datetime_hires.test
@@ -157,5 +157,103 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+--echo #
+
+CREATE TABLE t1 AS SELECT
+ FLOOR(TIMESTAMP'2001-01-01 00:00:00.999999'),
+ CEILING(TIMESTAMP'2001-01-01 00:00:00.999999');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATETIME(6));
+
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-31 23:59:59.0');
+
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.999');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.99');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.9');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.1');
+INSERT INTO t1 VALUES ('9999-12-30 23:59:59.0');
+
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0999-12-31 23:59:59.0');
+
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.99');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.9');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.1');
+INSERT INTO t1 VALUES ('0001-12-31 23:59:59.0');
+
+
+DELIMITER $$;
+CREATE FUNCTION FLOOR_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+ RETURN
+ CASE
+ WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ ELSE TRUNCATE(a,0)
+ END;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE FUNCTION CEILING_SP(a DATETIME(6)) RETURNS DATETIME
+BEGIN
+ RETURN
+ CASE
+ WHEN TRUNCATE(a,0)=TIMESTAMP'9999-12-31 23:59:59' THEN a
+ WHEN EXTRACT(MICROSECOND FROM a)=0 THEN a
+ ELSE TRUNCATE(a,0)+INTERVAL 1 SECOND
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('0000-00-00 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-00-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0000-01-01 23:59:59.999999');
+INSERT INTO t1 VALUES ('0001-00-00 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+DROP TABLE t1;
+
+SET sql_mode=ALLOW_INVALID_DATES;
+CREATE TABLE t1 (a DATETIME(6));
+INSERT INTO t1 VALUES ('2001-02-28 23:59:59.999999');
+INSERT INTO t1 VALUES ('2001-02-29 23:59:59.999999');
+SELECT a, FLOOR(a), CEILING(a) FROM t1;
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_enum.result b/mysql-test/main/type_enum.result
index ca909e1a2f2..d8b558c7ce0 100644
--- a/mysql-test/main/type_enum.result
+++ b/mysql-test/main/type_enum.result
@@ -2305,3 +2305,24 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP PROCEDURE p1;
DROP TABLE t1;
+#
+# MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+#
+CREATE TABLE t1 (a ENUM('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` enum('999999999999999999999999999999999999999999999999999999999999') DEFAULT NULL,
+ `FLOOR(a)` int(5) unsigned DEFAULT NULL,
+ `CEILING(a)` int(5) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(5) unsigned DEFAULT NULL,
+ `ROUND(a)` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a FLOOR(a) CEILING(a) TRUNCATE(a,0) ROUND(a)
+999999999999999999999999999999999999999999999999999999999999 1 1 1 1
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_enum.test b/mysql-test/main/type_enum.test
index a79335960bc..a36d63f8725 100644
--- a/mysql-test/main/type_enum.test
+++ b/mysql-test/main/type_enum.test
@@ -518,3 +518,16 @@ DELIMITER ;$$
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+--echo #
+
+CREATE TABLE t1 (a ENUM('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+ SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_hex_hybrid.result b/mysql-test/main/type_hex_hybrid.result
index eec24f6e89e..92a7432ae56 100644
--- a/mysql-test/main/type_hex_hybrid.result
+++ b/mysql-test/main/type_hex_hybrid.result
@@ -20,5 +20,163 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <cache>(octet_length(charset('a'))) + `test`.`t1`.`a` <=> <cache>(octet_length(charset(0x61))) + `test`.`t1`.`a`
DROP TABLE t1;
#
+# MDEV-23320 Hex hybrid constants 0xHHHH work badly in rounding functions
+#
+BEGIN NOT ATOMIC
+DECLARE arg TEXT DEFAULT '';
+DECLARE query TEXT DEFAULT
+'CREATE TABLE t1 AS SELECT '
+ '0xFFFFFFFFFFFFFFFF+0 AS c1,'
+ 'FLOOR(0xFFFFFFFFFFFFFFFF) AS c2,'
+ 'CEILING(0xFFFFFFFFFFFFFFFF) AS c3,'
+ 'ROUND(0xFFFFFFFFFFFFFFFF) AS c4,'
+ 'TRUNCATE(0xFFFFFFFFFFFFFFFF,0) AS c5';
+FOR i IN 1..9
+DO
+SET arg= CONCAT('0x',REPEAT('FF',i));
+SELECT i, arg;
+EXECUTE IMMEDIATE REPLACE(query,'0xFFFFFFFFFFFFFFFF', arg);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+END FOR;
+END;
+$$
+i 1
+arg 0xFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` int(4) unsigned NOT NULL,
+ `c2` int(3) unsigned NOT NULL,
+ `c3` int(3) unsigned NOT NULL,
+ `c4` int(3) unsigned NOT NULL,
+ `c5` int(3) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 255
+c2 255
+c3 255
+c4 255
+c5 255
+i 2
+arg 0xFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` int(6) unsigned NOT NULL,
+ `c2` int(5) unsigned NOT NULL,
+ `c3` int(5) unsigned NOT NULL,
+ `c4` int(5) unsigned NOT NULL,
+ `c5` int(5) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 65535
+c2 65535
+c3 65535
+c4 65535
+c5 65535
+i 3
+arg 0xFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` int(9) unsigned NOT NULL,
+ `c2` int(8) unsigned NOT NULL,
+ `c3` int(8) unsigned NOT NULL,
+ `c4` int(8) unsigned NOT NULL,
+ `c5` int(8) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 16777215
+c2 16777215
+c3 16777215
+c4 16777215
+c5 16777215
+i 4
+arg 0xFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(11) unsigned NOT NULL,
+ `c2` bigint(10) unsigned NOT NULL,
+ `c3` bigint(10) unsigned NOT NULL,
+ `c4` bigint(10) unsigned NOT NULL,
+ `c5` bigint(10) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 4294967295
+c2 4294967295
+c3 4294967295
+c4 4294967295
+c5 4294967295
+i 5
+arg 0xFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(14) unsigned NOT NULL,
+ `c2` bigint(13) unsigned NOT NULL,
+ `c3` bigint(13) unsigned NOT NULL,
+ `c4` bigint(13) unsigned NOT NULL,
+ `c5` bigint(13) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 1099511627775
+c2 1099511627775
+c3 1099511627775
+c4 1099511627775
+c5 1099511627775
+i 6
+arg 0xFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(16) unsigned NOT NULL,
+ `c2` bigint(15) unsigned NOT NULL,
+ `c3` bigint(15) unsigned NOT NULL,
+ `c4` bigint(15) unsigned NOT NULL,
+ `c5` bigint(15) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 281474976710655
+c2 281474976710655
+c3 281474976710655
+c4 281474976710655
+c5 281474976710655
+i 7
+arg 0xFFFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(18) unsigned NOT NULL,
+ `c2` bigint(17) unsigned NOT NULL,
+ `c3` bigint(17) unsigned NOT NULL,
+ `c4` bigint(17) unsigned NOT NULL,
+ `c5` bigint(17) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 72057594037927935
+c2 72057594037927935
+c3 72057594037927935
+c4 72057594037927935
+c5 72057594037927935
+i 8
+arg 0xFFFFFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(21) unsigned NOT NULL,
+ `c2` bigint(20) unsigned NOT NULL,
+ `c3` bigint(20) unsigned NOT NULL,
+ `c4` bigint(20) unsigned NOT NULL,
+ `c5` bigint(20) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 18446744073709551615
+c2 18446744073709551615
+c3 18446744073709551615
+c4 18446744073709551615
+c5 18446744073709551615
+i 9
+arg 0xFFFFFFFFFFFFFFFFFF
+Table t1
+Create Table CREATE TABLE `t1` (
+ `c1` bigint(21) unsigned NOT NULL,
+ `c2` bigint(20) unsigned NOT NULL,
+ `c3` bigint(20) unsigned NOT NULL,
+ `c4` bigint(20) unsigned NOT NULL,
+ `c5` bigint(20) unsigned NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+c1 18446744073709551615
+c2 18446744073709551615
+c3 18446744073709551615
+c4 18446744073709551615
+c5 18446744073709551615
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_hex_hybrid.test b/mysql-test/main/type_hex_hybrid.test
index a39750e2635..77afb45cfbf 100644
--- a/mysql-test/main/type_hex_hybrid.test
+++ b/mysql-test/main/type_hex_hybrid.test
@@ -17,5 +17,35 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(CHARSET('a'))+a<=>LENGTH(CHARSET(
DROP TABLE t1;
--echo #
+--echo # MDEV-23320 Hex hybrid constants 0xHHHH work badly in rounding functions
+--echo #
+
+--vertical_results
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE arg TEXT DEFAULT '';
+ DECLARE query TEXT DEFAULT
+ 'CREATE TABLE t1 AS SELECT '
+ '0xFFFFFFFFFFFFFFFF+0 AS c1,'
+ 'FLOOR(0xFFFFFFFFFFFFFFFF) AS c2,'
+ 'CEILING(0xFFFFFFFFFFFFFFFF) AS c3,'
+ 'ROUND(0xFFFFFFFFFFFFFFFF) AS c4,'
+ 'TRUNCATE(0xFFFFFFFFFFFFFFFF,0) AS c5';
+ FOR i IN 1..9
+ DO
+ SET arg= CONCAT('0x',REPEAT('FF',i));
+ SELECT i, arg;
+ EXECUTE IMMEDIATE REPLACE(query,'0xFFFFFFFFFFFFFFFF', arg);
+ SHOW CREATE TABLE t1;
+ SELECT * FROM t1;
+ DROP TABLE t1;
+ END FOR;
+END;
+$$
+DELIMITER ;$$
+--horizontal_results
+
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_int.result b/mysql-test/main/type_int.result
index 855341a2b59..b75a07251a9 100644
--- a/mysql-test/main/type_int.result
+++ b/mysql-test/main/type_int.result
@@ -412,6 +412,222 @@ COUNT(*)
0
DROP TABLE t1;
#
+# MDEV-23337 Rounding functions create a wrong data type for numeric input
+#
+CREATE PROCEDURE p1(t VARCHAR(64))
+BEGIN
+SELECT t AS ``;
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a TYPE)', 'TYPE', t);
+INSERT IGNORE INTO t1 VALUES (-100000000000000000000000000000);
+INSERT IGNORE INTO t1 VALUES (100000000000000000000000000000);
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
+END;
+$$
+CALL p1('tinyint');
+ tinyint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` tinyint(4) DEFAULT NULL,
+ `ROUND(a)` tinyint(4) DEFAULT NULL,
+ `TRUNCATE(a,0)` tinyint(4) DEFAULT NULL,
+ `FLOOR(a)` tinyint(4) DEFAULT NULL,
+ `CEILING(a)` tinyint(4) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -128
+ROUND(a) -128
+TRUNCATE(a,0) -128
+FLOOR(a) -128
+CEILING(a) -128
+a 127
+ROUND(a) 127
+TRUNCATE(a,0) 127
+FLOOR(a) 127
+CEILING(a) 127
+CALL p1('smallint');
+ smallint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` smallint(6) DEFAULT NULL,
+ `ROUND(a)` smallint(6) DEFAULT NULL,
+ `TRUNCATE(a,0)` smallint(6) DEFAULT NULL,
+ `FLOOR(a)` smallint(6) DEFAULT NULL,
+ `CEILING(a)` smallint(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -32768
+ROUND(a) -32768
+TRUNCATE(a,0) -32768
+FLOOR(a) -32768
+CEILING(a) -32768
+a 32767
+ROUND(a) 32767
+TRUNCATE(a,0) 32767
+FLOOR(a) 32767
+CEILING(a) 32767
+CALL p1('mediumint');
+ mediumint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` mediumint(9) DEFAULT NULL,
+ `ROUND(a)` mediumint(9) DEFAULT NULL,
+ `TRUNCATE(a,0)` mediumint(9) DEFAULT NULL,
+ `FLOOR(a)` mediumint(9) DEFAULT NULL,
+ `CEILING(a)` mediumint(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -8388608
+ROUND(a) -8388608
+TRUNCATE(a,0) -8388608
+FLOOR(a) -8388608
+CEILING(a) -8388608
+a 8388607
+ROUND(a) 8388607
+TRUNCATE(a,0) 8388607
+FLOOR(a) 8388607
+CEILING(a) 8388607
+CALL p1('int');
+ int
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `ROUND(a)` int(11) DEFAULT NULL,
+ `TRUNCATE(a,0)` int(11) DEFAULT NULL,
+ `FLOOR(a)` int(11) DEFAULT NULL,
+ `CEILING(a)` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -2147483648
+ROUND(a) -2147483648
+TRUNCATE(a,0) -2147483648
+FLOOR(a) -2147483648
+CEILING(a) -2147483648
+a 2147483647
+ROUND(a) 2147483647
+TRUNCATE(a,0) 2147483647
+FLOOR(a) 2147483647
+CEILING(a) 2147483647
+CALL p1('bigint');
+ bigint
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bigint(20) DEFAULT NULL,
+ `ROUND(a)` bigint(20) DEFAULT NULL,
+ `TRUNCATE(a,0)` bigint(20) DEFAULT NULL,
+ `FLOOR(a)` bigint(20) DEFAULT NULL,
+ `CEILING(a)` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -9223372036854775808
+ROUND(a) -9223372036854775808
+TRUNCATE(a,0) -9223372036854775808
+FLOOR(a) -9223372036854775808
+CEILING(a) -9223372036854775808
+a 9223372036854775807
+ROUND(a) 9223372036854775807
+TRUNCATE(a,0) 9223372036854775807
+FLOOR(a) 9223372036854775807
+CEILING(a) 9223372036854775807
+CALL p1('tinyint unsigned');
+ tinyint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` tinyint(3) unsigned DEFAULT NULL,
+ `ROUND(a)` tinyint(3) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` tinyint(3) unsigned DEFAULT NULL,
+ `FLOOR(a)` tinyint(3) unsigned DEFAULT NULL,
+ `CEILING(a)` tinyint(3) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 255
+ROUND(a) 255
+TRUNCATE(a,0) 255
+FLOOR(a) 255
+CEILING(a) 255
+CALL p1('smallint unsigned');
+ smallint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` smallint(5) unsigned DEFAULT NULL,
+ `ROUND(a)` smallint(5) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` smallint(5) unsigned DEFAULT NULL,
+ `FLOOR(a)` smallint(5) unsigned DEFAULT NULL,
+ `CEILING(a)` smallint(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 65535
+ROUND(a) 65535
+TRUNCATE(a,0) 65535
+FLOOR(a) 65535
+CEILING(a) 65535
+CALL p1('mediumint unsigned');
+ mediumint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` mediumint(8) unsigned DEFAULT NULL,
+ `ROUND(a)` mediumint(8) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` mediumint(8) unsigned DEFAULT NULL,
+ `FLOOR(a)` mediumint(8) unsigned DEFAULT NULL,
+ `CEILING(a)` mediumint(8) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 16777215
+ROUND(a) 16777215
+TRUNCATE(a,0) 16777215
+FLOOR(a) 16777215
+CEILING(a) 16777215
+CALL p1('int unsigned');
+ int unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(10) unsigned DEFAULT NULL,
+ `ROUND(a)` int(10) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(10) unsigned DEFAULT NULL,
+ `FLOOR(a)` int(10) unsigned DEFAULT NULL,
+ `CEILING(a)` int(10) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 4294967295
+ROUND(a) 4294967295
+TRUNCATE(a,0) 4294967295
+FLOOR(a) 4294967295
+CEILING(a) 4294967295
+CALL p1('bigint unsigned');
+ bigint unsigned
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` bigint(20) unsigned DEFAULT NULL,
+ `ROUND(a)` bigint(20) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` bigint(20) unsigned DEFAULT NULL,
+ `FLOOR(a)` bigint(20) unsigned DEFAULT NULL,
+ `CEILING(a)` bigint(20) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0
+ROUND(a) 0
+TRUNCATE(a,0) 0
+FLOOR(a) 0
+CEILING(a) 0
+a 18446744073709551615
+ROUND(a) 18446744073709551615
+TRUNCATE(a,0) 18446744073709551615
+FLOOR(a) 18446744073709551615
+CEILING(a) 18446744073709551615
+DROP PROCEDURE p1;
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/type_int.test b/mysql-test/main/type_int.test
index 5d961724e59..04cb9edf606 100644
--- a/mysql-test/main/type_int.test
+++ b/mysql-test/main/type_int.test
@@ -294,6 +294,41 @@ SELECT COUNT(*) FROM t1 WHERE a XOR a;
DROP TABLE t1;
--echo #
+--echo # MDEV-23337 Rounding functions create a wrong data type for numeric input
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(t VARCHAR(64))
+BEGIN
+ SELECT t AS ``;
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a TYPE)', 'TYPE', t);
+ INSERT IGNORE INTO t1 VALUES (-100000000000000000000000000000);
+ INSERT IGNORE INTO t1 VALUES (100000000000000000000000000000);
+ CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+ SHOW CREATE TABLE t2;
+ SELECT * FROM t2;
+ DROP TABLE t1, t2;
+END;
+$$
+DELIMITER ;$$
+
+--vertical_results
+CALL p1('tinyint');
+CALL p1('smallint');
+CALL p1('mediumint');
+CALL p1('int');
+CALL p1('bigint');
+
+CALL p1('tinyint unsigned');
+CALL p1('smallint unsigned');
+CALL p1('mediumint unsigned');
+CALL p1('int unsigned');
+CALL p1('bigint unsigned');
+--horizontal_results
+
+DROP PROCEDURE p1;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_set.result b/mysql-test/main/type_set.result
index 76a0c343973..5f54521c9dc 100644
--- a/mysql-test/main/type_set.result
+++ b/mysql-test/main/type_set.result
@@ -358,3 +358,24 @@ DROP TABLE t1;
SET NAMES utf8;
CREATE TABLE t1 (a SET('a,bü'));
ERROR 22007: Illegal set 'a,bü' value found during parsing
+#
+# MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+#
+CREATE TABLE t1 (a SET('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` set('999999999999999999999999999999999999999999999999999999999999') DEFAULT NULL,
+ `FLOOR(a)` int(5) unsigned DEFAULT NULL,
+ `CEILING(a)` int(5) unsigned DEFAULT NULL,
+ `TRUNCATE(a,0)` int(5) unsigned DEFAULT NULL,
+ `ROUND(a)` int(5) unsigned DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a FLOOR(a) CEILING(a) TRUNCATE(a,0) ROUND(a)
+999999999999999999999999999999999999999999999999999999999999 1 1 1 1
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_set.test b/mysql-test/main/type_set.test
index 8a81c406c63..2d0c81340ae 100644
--- a/mysql-test/main/type_set.test
+++ b/mysql-test/main/type_set.test
@@ -248,3 +248,16 @@ DROP TABLE t1;
SET NAMES utf8;
--error ER_ILLEGAL_VALUE_FOR_TYPE
CREATE TABLE t1 (a SET('a,bü'));
+
+--echo #
+--echo # MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
+--echo #
+
+CREATE TABLE t1 (a SET('999999999999999999999999999999999999999999999999999999999999'));
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 AS
+ SELECT a, FLOOR(a), CEILING(a), TRUNCATE(a,0), ROUND(a) FROM t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_time_hires.result b/mysql-test/main/type_time_hires.result
index 6122afcfc47..c7fecbef76b 100644
--- a/mysql-test/main/type_time_hires.result
+++ b/mysql-test/main/type_time_hires.result
@@ -670,3 +670,240 @@ a ROUND(a,-6)
838:59:59.999999 838:59:59
DROP TABLE t1;
SET time_zone=DEFAULT;
+#
+# MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+#
+CREATE TABLE t1 AS SELECT
+FLOOR(TIME'00:00:00.999999'),
+CEILING(TIME'00:00:00.999999');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `FLOOR(TIME'00:00:00.999999')` time NOT NULL,
+ `CEILING(TIME'00:00:00.999999')` time NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a TIME(6));
+INSERT INTO t1 VALUES ('838:59:59.999999');
+INSERT INTO t1 VALUES ('838:59:59.99999');
+INSERT INTO t1 VALUES ('838:59:59.9999');
+INSERT INTO t1 VALUES ('838:59:59.999');
+INSERT INTO t1 VALUES ('838:59:59.99');
+INSERT INTO t1 VALUES ('838:59:59.9');
+INSERT INTO t1 VALUES ('838:59:59.1');
+INSERT INTO t1 VALUES ('838:59:59.0');
+INSERT INTO t1 VALUES ('837:59:59.999999');
+INSERT INTO t1 VALUES ('837:59:59.99999');
+INSERT INTO t1 VALUES ('837:59:59.9999');
+INSERT INTO t1 VALUES ('837:59:59.999');
+INSERT INTO t1 VALUES ('837:59:59.99');
+INSERT INTO t1 VALUES ('837:59:59.9');
+INSERT INTO t1 VALUES ('837:59:59.1');
+INSERT INTO t1 VALUES ('837:59:59.0');
+INSERT INTO t1 VALUES ('23:59:59.999999');
+INSERT INTO t1 VALUES ('23:59:59.99999');
+INSERT INTO t1 VALUES ('23:59:59.9999');
+INSERT INTO t1 VALUES ('23:59:59.999');
+INSERT INTO t1 VALUES ('23:59:59.99');
+INSERT INTO t1 VALUES ('23:59:59.9');
+INSERT INTO t1 VALUES ('23:59:59.1');
+INSERT INTO t1 VALUES ('23:59:59.0');
+INSERT INTO t1 VALUES ('00:00:00.999999');
+INSERT INTO t1 VALUES ('00:00:00.99999');
+INSERT INTO t1 VALUES ('00:00:00.9999');
+INSERT INTO t1 VALUES ('00:00:00.999');
+INSERT INTO t1 VALUES ('00:00:00.99');
+INSERT INTO t1 VALUES ('00:00:00.9');
+INSERT INTO t1 VALUES ('00:00:00.1');
+INSERT INTO t1 VALUES ('00:00:00.0');
+INSERT INTO t1 VALUES ('-00:00:00.999999');
+INSERT INTO t1 VALUES ('-00:00:00.99999');
+INSERT INTO t1 VALUES ('-00:00:00.9999');
+INSERT INTO t1 VALUES ('-00:00:00.999');
+INSERT INTO t1 VALUES ('-00:00:00.99');
+INSERT INTO t1 VALUES ('-00:00:00.9');
+INSERT INTO t1 VALUES ('-00:00:00.1');
+INSERT INTO t1 VALUES ('-00:00:00.0');
+INSERT INTO t1 VALUES ('-23:59:59.999999');
+INSERT INTO t1 VALUES ('-23:59:59.99999');
+INSERT INTO t1 VALUES ('-23:59:59.9999');
+INSERT INTO t1 VALUES ('-23:59:59.999');
+INSERT INTO t1 VALUES ('-23:59:59.99');
+INSERT INTO t1 VALUES ('-23:59:59.9');
+INSERT INTO t1 VALUES ('-23:59:59.1');
+INSERT INTO t1 VALUES ('-23:59:59.0');
+INSERT INTO t1 VALUES ('-837:59:59.999999');
+INSERT INTO t1 VALUES ('-837:59:59.99999');
+INSERT INTO t1 VALUES ('-837:59:59.9999');
+INSERT INTO t1 VALUES ('-837:59:59.999');
+INSERT INTO t1 VALUES ('-837:59:59.99');
+INSERT INTO t1 VALUES ('-837:59:59.9');
+INSERT INTO t1 VALUES ('-837:59:59.1');
+INSERT INTO t1 VALUES ('-837:59:59.0');
+INSERT INTO t1 VALUES ('-838:59:59.999999');
+INSERT INTO t1 VALUES ('-838:59:59.99999');
+INSERT INTO t1 VALUES ('-838:59:59.9999');
+INSERT INTO t1 VALUES ('-838:59:59.999');
+INSERT INTO t1 VALUES ('-838:59:59.99');
+INSERT INTO t1 VALUES ('-838:59:59.9');
+INSERT INTO t1 VALUES ('-838:59:59.1');
+INSERT INTO t1 VALUES ('-838:59:59.0');
+CREATE FUNCTION FLOOR_SP(a TIME(6)) RETURNS TIME
+BEGIN
+RETURN
+CASE
+WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+WHEN a<0 THEN TRUNCATE(a,0)-INTERVAL 1 SECOND -- negative values
+WHEN a>0 THEN TRUNCATE(a,0) -- positive values
+END;
+END;
+$$
+CREATE FUNCTION CEILING_SP(a TIME(6)) RETURNS TIME
+BEGIN
+RETURN
+CASE
+WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+WHEN a<0 THEN TRUNCATE(a,0) -- negative values
+WHEN a>0 THEN TRUNCATE(a,0)+INTERVAL 1 SECOND -- positive values
+END;
+END;
+$$
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+a FLOOR(a) FLOOR_SP(a) FLOOR(a)=FLOOR_SP(a)
+-838:59:59.999999 -838:59:59 -838:59:59 1
+-838:59:59.999990 -838:59:59 -838:59:59 1
+-838:59:59.999900 -838:59:59 -838:59:59 1
+-838:59:59.999000 -838:59:59 -838:59:59 1
+-838:59:59.990000 -838:59:59 -838:59:59 1
+-838:59:59.900000 -838:59:59 -838:59:59 1
+-838:59:59.100000 -838:59:59 -838:59:59 1
+-838:59:59.000000 -838:59:59 -838:59:59 1
+-837:59:59.999999 -838:00:00 -838:00:00 1
+-837:59:59.999990 -838:00:00 -838:00:00 1
+-837:59:59.999900 -838:00:00 -838:00:00 1
+-837:59:59.999000 -838:00:00 -838:00:00 1
+-837:59:59.990000 -838:00:00 -838:00:00 1
+-837:59:59.900000 -838:00:00 -838:00:00 1
+-837:59:59.100000 -838:00:00 -838:00:00 1
+-837:59:59.000000 -837:59:59 -837:59:59 1
+-23:59:59.999999 -24:00:00 -24:00:00 1
+-23:59:59.999990 -24:00:00 -24:00:00 1
+-23:59:59.999900 -24:00:00 -24:00:00 1
+-23:59:59.999000 -24:00:00 -24:00:00 1
+-23:59:59.990000 -24:00:00 -24:00:00 1
+-23:59:59.900000 -24:00:00 -24:00:00 1
+-23:59:59.100000 -24:00:00 -24:00:00 1
+-23:59:59.000000 -23:59:59 -23:59:59 1
+-00:00:00.999999 -00:00:01 -00:00:01 1
+-00:00:00.999990 -00:00:01 -00:00:01 1
+-00:00:00.999900 -00:00:01 -00:00:01 1
+-00:00:00.999000 -00:00:01 -00:00:01 1
+-00:00:00.990000 -00:00:01 -00:00:01 1
+-00:00:00.900000 -00:00:01 -00:00:01 1
+-00:00:00.100000 -00:00:01 -00:00:01 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.100000 00:00:00 00:00:00 1
+00:00:00.900000 00:00:00 00:00:00 1
+00:00:00.990000 00:00:00 00:00:00 1
+00:00:00.999000 00:00:00 00:00:00 1
+00:00:00.999900 00:00:00 00:00:00 1
+00:00:00.999990 00:00:00 00:00:00 1
+00:00:00.999999 00:00:00 00:00:00 1
+23:59:59.000000 23:59:59 23:59:59 1
+23:59:59.100000 23:59:59 23:59:59 1
+23:59:59.900000 23:59:59 23:59:59 1
+23:59:59.990000 23:59:59 23:59:59 1
+23:59:59.999000 23:59:59 23:59:59 1
+23:59:59.999900 23:59:59 23:59:59 1
+23:59:59.999990 23:59:59 23:59:59 1
+23:59:59.999999 23:59:59 23:59:59 1
+837:59:59.000000 837:59:59 837:59:59 1
+837:59:59.100000 837:59:59 837:59:59 1
+837:59:59.900000 837:59:59 837:59:59 1
+837:59:59.990000 837:59:59 837:59:59 1
+837:59:59.999000 837:59:59 837:59:59 1
+837:59:59.999900 837:59:59 837:59:59 1
+837:59:59.999990 837:59:59 837:59:59 1
+837:59:59.999999 837:59:59 837:59:59 1
+838:59:59.000000 838:59:59 838:59:59 1
+838:59:59.100000 838:59:59 838:59:59 1
+838:59:59.900000 838:59:59 838:59:59 1
+838:59:59.990000 838:59:59 838:59:59 1
+838:59:59.999000 838:59:59 838:59:59 1
+838:59:59.999900 838:59:59 838:59:59 1
+838:59:59.999990 838:59:59 838:59:59 1
+838:59:59.999999 838:59:59 838:59:59 1
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+a CEILING(a) CEILING_SP(a) CEILING(a)=CEILING_SP(a)
+-838:59:59.999999 -838:59:59 -838:59:59 1
+-838:59:59.999990 -838:59:59 -838:59:59 1
+-838:59:59.999900 -838:59:59 -838:59:59 1
+-838:59:59.999000 -838:59:59 -838:59:59 1
+-838:59:59.990000 -838:59:59 -838:59:59 1
+-838:59:59.900000 -838:59:59 -838:59:59 1
+-838:59:59.100000 -838:59:59 -838:59:59 1
+-838:59:59.000000 -838:59:59 -838:59:59 1
+-837:59:59.999999 -837:59:59 -837:59:59 1
+-837:59:59.999990 -837:59:59 -837:59:59 1
+-837:59:59.999900 -837:59:59 -837:59:59 1
+-837:59:59.999000 -837:59:59 -837:59:59 1
+-837:59:59.990000 -837:59:59 -837:59:59 1
+-837:59:59.900000 -837:59:59 -837:59:59 1
+-837:59:59.100000 -837:59:59 -837:59:59 1
+-837:59:59.000000 -837:59:59 -837:59:59 1
+-23:59:59.999999 -23:59:59 -23:59:59 1
+-23:59:59.999990 -23:59:59 -23:59:59 1
+-23:59:59.999900 -23:59:59 -23:59:59 1
+-23:59:59.999000 -23:59:59 -23:59:59 1
+-23:59:59.990000 -23:59:59 -23:59:59 1
+-23:59:59.900000 -23:59:59 -23:59:59 1
+-23:59:59.100000 -23:59:59 -23:59:59 1
+-23:59:59.000000 -23:59:59 -23:59:59 1
+-00:00:00.999999 00:00:00 00:00:00 1
+-00:00:00.999990 00:00:00 00:00:00 1
+-00:00:00.999900 00:00:00 00:00:00 1
+-00:00:00.999000 00:00:00 00:00:00 1
+-00:00:00.990000 00:00:00 00:00:00 1
+-00:00:00.900000 00:00:00 00:00:00 1
+-00:00:00.100000 00:00:00 00:00:00 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.000000 00:00:00 00:00:00 1
+00:00:00.100000 00:00:01 00:00:01 1
+00:00:00.900000 00:00:01 00:00:01 1
+00:00:00.990000 00:00:01 00:00:01 1
+00:00:00.999000 00:00:01 00:00:01 1
+00:00:00.999900 00:00:01 00:00:01 1
+00:00:00.999990 00:00:01 00:00:01 1
+00:00:00.999999 00:00:01 00:00:01 1
+23:59:59.000000 23:59:59 23:59:59 1
+23:59:59.100000 24:00:00 24:00:00 1
+23:59:59.900000 24:00:00 24:00:00 1
+23:59:59.990000 24:00:00 24:00:00 1
+23:59:59.999000 24:00:00 24:00:00 1
+23:59:59.999900 24:00:00 24:00:00 1
+23:59:59.999990 24:00:00 24:00:00 1
+23:59:59.999999 24:00:00 24:00:00 1
+837:59:59.000000 837:59:59 837:59:59 1
+837:59:59.100000 838:00:00 838:00:00 1
+837:59:59.900000 838:00:00 838:00:00 1
+837:59:59.990000 838:00:00 838:00:00 1
+837:59:59.999000 838:00:00 838:00:00 1
+837:59:59.999900 838:00:00 838:00:00 1
+837:59:59.999990 838:00:00 838:00:00 1
+837:59:59.999999 838:00:00 838:00:00 1
+838:59:59.000000 838:59:59 838:59:59 1
+838:59:59.100000 838:59:59 838:59:59 1
+838:59:59.900000 838:59:59 838:59:59 1
+838:59:59.990000 838:59:59 838:59:59 1
+838:59:59.999000 838:59:59 838:59:59 1
+838:59:59.999900 838:59:59 838:59:59 1
+838:59:59.999990 838:59:59 838:59:59 1
+838:59:59.999999 838:59:59 838:59:59 1
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+DROP TABLE t1;
diff --git a/mysql-test/main/type_time_hires.test b/mysql-test/main/type_time_hires.test
index 0949738e949..f9b4a5a9f27 100644
--- a/mysql-test/main/type_time_hires.test
+++ b/mysql-test/main/type_time_hires.test
@@ -73,3 +73,126 @@ SELECT a, ROUND(a,-6) FROM t1;
DROP TABLE t1;
SET time_zone=DEFAULT;
+
+
+--echo #
+--echo # MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+--echo #
+
+CREATE TABLE t1 AS SELECT
+ FLOOR(TIME'00:00:00.999999'),
+ CEILING(TIME'00:00:00.999999');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TIME(6));
+
+INSERT INTO t1 VALUES ('838:59:59.999999');
+INSERT INTO t1 VALUES ('838:59:59.99999');
+INSERT INTO t1 VALUES ('838:59:59.9999');
+INSERT INTO t1 VALUES ('838:59:59.999');
+INSERT INTO t1 VALUES ('838:59:59.99');
+INSERT INTO t1 VALUES ('838:59:59.9');
+INSERT INTO t1 VALUES ('838:59:59.1');
+INSERT INTO t1 VALUES ('838:59:59.0');
+
+INSERT INTO t1 VALUES ('837:59:59.999999');
+INSERT INTO t1 VALUES ('837:59:59.99999');
+INSERT INTO t1 VALUES ('837:59:59.9999');
+INSERT INTO t1 VALUES ('837:59:59.999');
+INSERT INTO t1 VALUES ('837:59:59.99');
+INSERT INTO t1 VALUES ('837:59:59.9');
+INSERT INTO t1 VALUES ('837:59:59.1');
+INSERT INTO t1 VALUES ('837:59:59.0');
+
+INSERT INTO t1 VALUES ('23:59:59.999999');
+INSERT INTO t1 VALUES ('23:59:59.99999');
+INSERT INTO t1 VALUES ('23:59:59.9999');
+INSERT INTO t1 VALUES ('23:59:59.999');
+INSERT INTO t1 VALUES ('23:59:59.99');
+INSERT INTO t1 VALUES ('23:59:59.9');
+INSERT INTO t1 VALUES ('23:59:59.1');
+INSERT INTO t1 VALUES ('23:59:59.0');
+
+INSERT INTO t1 VALUES ('00:00:00.999999');
+INSERT INTO t1 VALUES ('00:00:00.99999');
+INSERT INTO t1 VALUES ('00:00:00.9999');
+INSERT INTO t1 VALUES ('00:00:00.999');
+INSERT INTO t1 VALUES ('00:00:00.99');
+INSERT INTO t1 VALUES ('00:00:00.9');
+INSERT INTO t1 VALUES ('00:00:00.1');
+INSERT INTO t1 VALUES ('00:00:00.0');
+
+INSERT INTO t1 VALUES ('-00:00:00.999999');
+INSERT INTO t1 VALUES ('-00:00:00.99999');
+INSERT INTO t1 VALUES ('-00:00:00.9999');
+INSERT INTO t1 VALUES ('-00:00:00.999');
+INSERT INTO t1 VALUES ('-00:00:00.99');
+INSERT INTO t1 VALUES ('-00:00:00.9');
+INSERT INTO t1 VALUES ('-00:00:00.1');
+INSERT INTO t1 VALUES ('-00:00:00.0');
+
+INSERT INTO t1 VALUES ('-23:59:59.999999');
+INSERT INTO t1 VALUES ('-23:59:59.99999');
+INSERT INTO t1 VALUES ('-23:59:59.9999');
+INSERT INTO t1 VALUES ('-23:59:59.999');
+INSERT INTO t1 VALUES ('-23:59:59.99');
+INSERT INTO t1 VALUES ('-23:59:59.9');
+INSERT INTO t1 VALUES ('-23:59:59.1');
+INSERT INTO t1 VALUES ('-23:59:59.0');
+
+INSERT INTO t1 VALUES ('-837:59:59.999999');
+INSERT INTO t1 VALUES ('-837:59:59.99999');
+INSERT INTO t1 VALUES ('-837:59:59.9999');
+INSERT INTO t1 VALUES ('-837:59:59.999');
+INSERT INTO t1 VALUES ('-837:59:59.99');
+INSERT INTO t1 VALUES ('-837:59:59.9');
+INSERT INTO t1 VALUES ('-837:59:59.1');
+INSERT INTO t1 VALUES ('-837:59:59.0');
+
+INSERT INTO t1 VALUES ('-838:59:59.999999');
+INSERT INTO t1 VALUES ('-838:59:59.99999');
+INSERT INTO t1 VALUES ('-838:59:59.9999');
+INSERT INTO t1 VALUES ('-838:59:59.999');
+INSERT INTO t1 VALUES ('-838:59:59.99');
+INSERT INTO t1 VALUES ('-838:59:59.9');
+INSERT INTO t1 VALUES ('-838:59:59.1');
+INSERT INTO t1 VALUES ('-838:59:59.0');
+
+DELIMITER $$;
+CREATE FUNCTION FLOOR_SP(a TIME(6)) RETURNS TIME
+BEGIN
+ RETURN
+ CASE
+ WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+ WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+ WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+ WHEN a<0 THEN TRUNCATE(a,0)-INTERVAL 1 SECOND -- negative values
+ WHEN a>0 THEN TRUNCATE(a,0) -- positive values
+ END;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE FUNCTION CEILING_SP(a TIME(6)) RETURNS TIME
+BEGIN
+ RETURN
+ CASE
+ WHEN TRUNCATE(a,0)=TIME'838:59:59' THEN a
+ WHEN TRUNCATE(a,0)=TIME'-838:59:59' THEN a
+ WHEN a=TRUNCATE(a,0) THEN a -- no fractional digits
+ WHEN a<0 THEN TRUNCATE(a,0) -- negative values
+ WHEN a>0 THEN TRUNCATE(a,0)+INTERVAL 1 SECOND -- positive values
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SELECT a, FLOOR(a), FLOOR_SP(a), FLOOR(a)=FLOOR_SP(a) FROM t1 ORDER BY a;
+SELECT a, CEILING(a), CEILING_SP(a), CEILING(a)=CEILING_SP(a) FROM t1 ORDER BY a;
+
+DROP FUNCTION FLOOR_SP;
+DROP FUNCTION CEILING_SP;
+
+DROP TABLE t1;
diff --git a/mysql-test/main/type_timestamp_hires.result b/mysql-test/main/type_timestamp_hires.result
index dc69aa36b0f..64675ff9973 100644
--- a/mysql-test/main/type_timestamp_hires.result
+++ b/mysql-test/main/type_timestamp_hires.result
@@ -626,5 +626,17 @@ a ROUND(a,-6)
DROP TABLE t1;
SET time_zone=DEFAULT;
#
+# MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+#
+CREATE TABLE t1 (a TIMESTAMP NOT NULL);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEILING(a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `FLOOR(a)` datetime DEFAULT NULL,
+ `CEILING(a)` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_timestamp_hires.test b/mysql-test/main/type_timestamp_hires.test
index f2e765d09fe..27aed16d6be 100644
--- a/mysql-test/main/type_timestamp_hires.test
+++ b/mysql-test/main/type_timestamp_hires.test
@@ -107,6 +107,16 @@ DROP TABLE t1;
SET time_zone=DEFAULT;
+
+--echo #
+--echo # MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE()
+--echo #
+
+CREATE TABLE t1 (a TIMESTAMP NOT NULL);
+CREATE TABLE t2 AS SELECT FLOOR(a), CEILING(a) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t1, t2;
+
--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_year.result b/mysql-test/main/type_year.result
index 1792cd5b7d4..4fb38bdf798 100644
--- a/mysql-test/main/type_year.result
+++ b/mysql-test/main/type_year.result
@@ -585,6 +585,33 @@ COALESCE(a) DATE(COALESCE(a))
NULL NULL
DROP TABLE t1;
#
+# MDEV-23337 Rounding functions create a wrong data type for numeric input
+#
+CREATE TABLE t1 (a YEAR(2));
+Warnings:
+Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+Warnings:
+Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+DESC t2;
+Field Type Null Key Default Extra
+a year(2) YES NULL
+ROUND(a) int(2) unsigned YES NULL
+TRUNCATE(a,0) int(2) unsigned YES NULL
+FLOOR(a) int(2) unsigned YES NULL
+CEILING(a) int(2) unsigned YES NULL
+DROP TABLE t2,t1;
+CREATE TABLE t1 (a YEAR(4));
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+DESC t2;
+Field Type Null Key Default Extra
+a year(4) YES NULL
+ROUND(a) int(4) unsigned YES NULL
+TRUNCATE(a,0) int(4) unsigned YES NULL
+FLOOR(a) int(4) unsigned YES NULL
+CEILING(a) int(4) unsigned YES NULL
+DROP TABLE t2,t1;
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/type_year.test b/mysql-test/main/type_year.test
index 6f16610c06f..1eb528d7af3 100644
--- a/mysql-test/main/type_year.test
+++ b/mysql-test/main/type_year.test
@@ -327,6 +327,21 @@ SELECT COALESCE(a), DATE(COALESCE(a)) FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-23337 Rounding functions create a wrong data type for numeric input
+--echo #
+
+CREATE TABLE t1 (a YEAR(2));
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+DESC t2;
+DROP TABLE t2,t1;
+
+CREATE TABLE t1 (a YEAR(4));
+CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
+DESC t2;
+DROP TABLE t2,t1;
+
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/upgrade_MDEV-19650.result b/mysql-test/main/upgrade_MDEV-19650.result
index 386c15ae83e..7e8610683e2 100644
--- a/mysql-test/main/upgrade_MDEV-19650.result
+++ b/mysql-test/main/upgrade_MDEV-19650.result
@@ -165,7 +165,6 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'";
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
# check non root
CREATE USER 'not_root'@'localhost';
diff --git a/mysql-test/main/user_var-binlog.result b/mysql-test/main/user_var-binlog.result
index 9021fcc9628..20d1d8e7da8 100644
--- a/mysql-test/main/user_var-binlog.result
+++ b/mysql-test/main/user_var-binlog.result
@@ -23,7 +23,7 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`a b`:=_latin1 X'68656C6C6F' COLLATE `latin1_swedish_ci`/*!*/;
use `test`/*!*/;
@@ -41,7 +41,7 @@ INSERT INTO t1 VALUES(@`a b`)
SET TIMESTAMP=10000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`var1`:=_latin1 X'273B616161' COLLATE `latin1_swedish_ci`/*!*/;
SET @`var2`:=_binary X'61' COLLATE `binary`/*!*/;
diff --git a/mysql-test/main/view_grant.result b/mysql-test/main/view_grant.result
index 0f76aa974cd..f091d4de2d1 100644
--- a/mysql-test/main/view_grant.result
+++ b/mysql-test/main/view_grant.result
@@ -1361,7 +1361,6 @@ connection default;
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mariadb.sys'@'localhost' def mysql global_priv SELECT NO
-'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO
'mariadb.sys'@'localhost' def mysql global_priv DELETE NO
End of 5.0 tests.
connection default;
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index f52f7bed5a6..441852fb362 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3844,6 +3844,13 @@ ROW_NUMBER() OVER w2
5
DROP TABLE t1;
#
+# MDEV-18916: crash in Window_spec::print_partition() with decimals
+#
+SELECT cast((rank() over w1) as decimal (53,56));
+ERROR 42000: Too big scale 56 specified for 'rank() over w1'. Maximum is 38
+SELECT cast((rank() over w1) as decimal (53,30));
+ERROR HY000: Window specification with name 'w1' is not defined
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index dcf0dd04ae1..4b442c03ad6 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2497,6 +2497,15 @@ SELECT ROW_NUMBER() OVER w2 FROM t1 WINDOW w2 AS (PARTITION BY -1,0,1,2,3,4,5,6)
DROP TABLE t1;
--echo #
+--echo # MDEV-18916: crash in Window_spec::print_partition() with decimals
+--echo #
+
+--error ER_TOO_BIG_SCALE
+SELECT cast((rank() over w1) as decimal (53,56));
+--error ER_WRONG_WINDOW_SPEC_NAME
+SELECT cast((rank() over w1) as decimal (53,30));
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/win_ntile.result b/mysql-test/main/win_ntile.result
index 41cb1a594bf..4d02a230e13 100644
--- a/mysql-test/main/win_ntile.result
+++ b/mysql-test/main/win_ntile.result
@@ -433,3 +433,81 @@ ntile((select a from t1)) over (partition by b order by pk)
from t1;
ERROR 21000: Subquery returns more than 1 row
drop table t1;
+#
+# MDEV-9911 NTILE must return an error when parameter is not stable
+#
+create table t1 (
+pk int primary key,
+c1 nvarchar(10),
+c2 nvarchar(10),
+c3 int
+);
+insert into t1 values
+(1, 'Mark', 'Male', 5),
+(2, 'John', 'Male', 5),
+(3, 'Pam', 'Female', 6),
+(4, 'Sara', 'Female', 6),
+(5, 'Todd', 'Male', 5),
+(6, 'Mary', 'Female', 6),
+(7, 'Ben', 'Male', 5),
+(8, 'Jodi', 'Female', 6),
+(9, 'Tom', 'Male', 5),
+(10, 'Lucky', 'Male', 5),
+(11, 'Mark', 'Male', 5),
+(12, 'John', 'Male', 5),
+(13, 'Pam', 'Female', 6),
+(14, 'Sara', 'Female', 6),
+(15, 'Todd', 'Male', 5),
+(16, 'Mary', 'Female', 6),
+(17, 'Ben', 'Male', 5),
+(18, 'Jodi', 'Female', 6),
+(19, 'Tom', 'Male', 5),
+(20, 'Lucky', 'Male', 5);
+select c1, c2, c3, ntile(6) over (partition by c2 order by pk) from t1;
+c1 c2 c3 ntile(6) over (partition by c2 order by pk)
+Pam Female 6 1
+Sara Female 6 1
+Mary Female 6 2
+Jodi Female 6 2
+Pam Female 6 3
+Sara Female 6 4
+Mary Female 6 5
+Jodi Female 6 6
+Mark Male 5 1
+John Male 5 1
+Todd Male 5 2
+Ben Male 5 2
+Tom Male 5 3
+Lucky Male 5 3
+Mark Male 5 4
+John Male 5 4
+Todd Male 5 5
+Ben Male 5 5
+Tom Male 5 6
+Lucky Male 5 6
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+c1 c2 c3 ntile(c3) over (partition by c2 order by pk)
+Pam Female 6 1
+Sara Female 6 1
+Mary Female 6 2
+Jodi Female 6 2
+Pam Female 6 3
+Sara Female 6 4
+Mary Female 6 5
+Jodi Female 6 6
+Mark Male 5 1
+John Male 5 1
+Todd Male 5 1
+Ben Male 5 2
+Tom Male 5 2
+Lucky Male 5 2
+Mark Male 5 3
+John Male 5 3
+Todd Male 5 4
+Ben Male 5 4
+Tom Male 5 5
+Lucky Male 5 5
+update t1 set c3= 1 where pk = 1;
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+ERROR HY000: Argument of NTILE must be greater than 0
+drop table t1;
diff --git a/mysql-test/main/win_ntile.test b/mysql-test/main/win_ntile.test
index 6f12e1f4005..c65ba7e1521 100644
--- a/mysql-test/main/win_ntile.test
+++ b/mysql-test/main/win_ntile.test
@@ -169,3 +169,46 @@ from t1;
drop table t1;
+
+--echo #
+--echo # MDEV-9911 NTILE must return an error when parameter is not stable
+--echo #
+
+create table t1 (
+ pk int primary key,
+ c1 nvarchar(10),
+ c2 nvarchar(10),
+ c3 int
+);
+
+insert into t1 values
+ (1, 'Mark', 'Male', 5),
+ (2, 'John', 'Male', 5),
+ (3, 'Pam', 'Female', 6),
+ (4, 'Sara', 'Female', 6),
+ (5, 'Todd', 'Male', 5),
+ (6, 'Mary', 'Female', 6),
+ (7, 'Ben', 'Male', 5),
+ (8, 'Jodi', 'Female', 6),
+ (9, 'Tom', 'Male', 5),
+ (10, 'Lucky', 'Male', 5),
+ (11, 'Mark', 'Male', 5),
+ (12, 'John', 'Male', 5),
+ (13, 'Pam', 'Female', 6),
+ (14, 'Sara', 'Female', 6),
+ (15, 'Todd', 'Male', 5),
+ (16, 'Mary', 'Female', 6),
+ (17, 'Ben', 'Male', 5),
+ (18, 'Jodi', 'Female', 6),
+ (19, 'Tom', 'Male', 5),
+ (20, 'Lucky', 'Male', 5);
+# Correct usage of NTILE with a fix argument NTILE(6).
+select c1, c2, c3, ntile(6) over (partition by c2 order by pk) from t1;
+# Correct usage - constant NTILE (argument) in each partition.
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+
+update t1 set c3= 1 where pk = 1;
+--error ER_INVALID_NTILE_ARGUMENT
+select c1, c2, c3, ntile(c3) over (partition by c2 order by pk) from t1;
+
+drop table t1;
diff --git a/mysql-test/std_data/wsrep_notify.sh b/mysql-test/std_data/wsrep_notify.sh
index 7036f603c84..48edad4306f 100755
--- a/mysql-test/std_data/wsrep_notify.sh
+++ b/mysql-test/std_data/wsrep_notify.sh
@@ -56,7 +56,7 @@ configuration_change()
status_update()
{
- echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;"
+ echo "$BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
}
COM=status_update # not a configuration change by default
@@ -89,11 +89,11 @@ do
shift
done
-# Undefined means node is shutting down
-if [ "$STATUS" != "Undefined" ]
-then
- $COM | mysql -B -u$USER -h$HOST -P$PORT
-fi
-
-exit 0
-#
+case $STATUS in
+ "joined" | "donor" | "synced")
+ $COM | mysql -B -u$USER -h$HOST -P$PORT
+ ;;
+ *)
+ exit 0
+ ;;
+esac
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
index a6378f4e094..1d6e94249dc 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
@@ -34,7 +34,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -43,7 +43,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -52,7 +52,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -61,7 +61,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -70,7 +70,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -91,7 +91,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -109,7 +109,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -118,7 +118,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -127,7 +127,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -136,7 +136,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -157,7 +157,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -175,7 +175,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -184,7 +184,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -217,7 +217,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -226,7 +226,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -247,7 +247,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -274,7 +274,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -292,7 +292,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -301,7 +301,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -334,7 +334,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -343,7 +343,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -377,7 +377,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -386,7 +386,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -395,7 +395,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -404,7 +404,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -413,7 +413,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -424,7 +424,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -454,7 +454,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -472,7 +472,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -481,7 +481,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -490,7 +490,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -499,7 +499,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -510,7 +510,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -540,7 +540,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -558,7 +558,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -567,7 +567,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -578,7 +578,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -620,7 +620,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -629,7 +629,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -638,7 +638,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -647,7 +647,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -656,7 +656,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -667,7 +667,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
DELIMITER ;
# End of log file
@@ -681,7 +681,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -699,7 +699,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -708,7 +708,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -719,7 +719,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -761,7 +761,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -770,7 +770,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -803,7 +803,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -812,7 +812,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -821,7 +821,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -830,7 +830,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -839,7 +839,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -860,7 +860,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -878,7 +878,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -887,7 +887,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -896,7 +896,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -905,7 +905,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -925,7 +925,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -943,7 +943,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -952,7 +952,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -985,7 +985,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -994,7 +994,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1014,7 +1014,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1041,7 +1041,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1059,7 +1059,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1068,7 +1068,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1101,7 +1101,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1110,7 +1110,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1143,7 +1143,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1152,7 +1152,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1161,7 +1161,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1170,7 +1170,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1179,7 +1179,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1190,7 +1190,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1220,7 +1220,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
use `test`/*!*/;
@@ -1238,7 +1238,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1247,7 +1247,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1256,7 +1256,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1265,7 +1265,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1276,7 +1276,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1305,7 +1305,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1323,7 +1323,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1332,7 +1332,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1343,7 +1343,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1385,7 +1385,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1394,7 +1394,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1403,7 +1403,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1412,7 +1412,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1421,7 +1421,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1444,7 +1444,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
use `test`/*!*/;
@@ -1462,7 +1462,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1471,7 +1471,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1482,7 +1482,7 @@ COMMIT
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
use `test`/*!*/;
@@ -1524,7 +1524,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1533,7 +1533,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1566,7 +1566,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1575,7 +1575,7 @@ insert into t1 values(null, "a")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1773142/*!*/;
@@ -1584,7 +1584,7 @@ insert into t1 values(null, "b")
SET TIMESTAMP=1773142/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1773144/*!*/;
@@ -1593,7 +1593,7 @@ insert into t1 values(null, "c")
SET TIMESTAMP=1773144/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1602,7 +1602,7 @@ insert into t1 values(null, "d")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1773146/*!*/;
@@ -1611,7 +1611,7 @@ insert into t1 values(null, "e")
SET TIMESTAMP=1773146/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET INSERT_ID=6/*!*/;
SET TIMESTAMP=1773143/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 20c62920566..1229ef885b4 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -383,7 +383,7 @@ CREATE TABLE t1 (c01 BIT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -404,7 +404,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -441,7 +441,7 @@ CREATE TABLE t1 (c01 BIT(7))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -462,7 +462,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -483,7 +483,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -504,7 +504,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -525,7 +525,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -546,7 +546,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-11
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -567,7 +567,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -588,7 +588,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-13
/*!100001 SET @@session.gtid_seq_no=13*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -609,7 +609,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-14
/*!100001 SET @@session.gtid_seq_no=14*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -630,7 +630,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-15
/*!100001 SET @@session.gtid_seq_no=15*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -669,7 +669,7 @@ CREATE TABLE t1 (a BIT(20), b CHAR(2))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-18
/*!100001 SET @@session.gtid_seq_no=18*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -707,7 +707,7 @@ CREATE TABLE t1 (c02 BIT(64))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-21
/*!100001 SET @@session.gtid_seq_no=21*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -728,7 +728,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-22
/*!100001 SET @@session.gtid_seq_no=22*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -749,7 +749,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-23
/*!100001 SET @@session.gtid_seq_no=23*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -770,7 +770,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-24
/*!100001 SET @@session.gtid_seq_no=24*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -807,7 +807,7 @@ CREATE TABLE t1 (c03 TINYINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-27
/*!100001 SET @@session.gtid_seq_no=27*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -834,7 +834,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-28
/*!100001 SET @@session.gtid_seq_no=28*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -855,7 +855,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-29
/*!100001 SET @@session.gtid_seq_no=29*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -878,7 +878,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-30
/*!100001 SET @@session.gtid_seq_no=30*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -915,7 +915,7 @@ CREATE TABLE t1 (c04 TINYINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-33
/*!100001 SET @@session.gtid_seq_no=33*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -939,7 +939,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-34
/*!100001 SET @@session.gtid_seq_no=34*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -976,7 +976,7 @@ CREATE TABLE t1 (c06 BOOL)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-37
/*!100001 SET @@session.gtid_seq_no=37*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -997,7 +997,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-38
/*!100001 SET @@session.gtid_seq_no=38*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1034,7 +1034,7 @@ CREATE TABLE t1 (c07 SMALLINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-41
/*!100001 SET @@session.gtid_seq_no=41*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1055,7 +1055,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-42
/*!100001 SET @@session.gtid_seq_no=42*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1092,7 +1092,7 @@ CREATE TABLE t1 (c08 SMALLINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-45
/*!100001 SET @@session.gtid_seq_no=45*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1116,7 +1116,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-46
/*!100001 SET @@session.gtid_seq_no=46*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1139,7 +1139,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-47
/*!100001 SET @@session.gtid_seq_no=47*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1176,7 +1176,7 @@ CREATE TABLE t1 (c10 MEDIUMINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-50
/*!100001 SET @@session.gtid_seq_no=50*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1197,7 +1197,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-51
/*!100001 SET @@session.gtid_seq_no=51*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1234,7 +1234,7 @@ CREATE TABLE t1 (c11 MEDIUMINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-54
/*!100001 SET @@session.gtid_seq_no=54*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1258,7 +1258,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-55
/*!100001 SET @@session.gtid_seq_no=55*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1281,7 +1281,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-56
/*!100001 SET @@session.gtid_seq_no=56*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1318,7 +1318,7 @@ CREATE TABLE t1 (c13 INT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-59
/*!100001 SET @@session.gtid_seq_no=59*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1339,7 +1339,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-60
/*!100001 SET @@session.gtid_seq_no=60*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1376,7 +1376,7 @@ CREATE TABLE t1 (c14 INT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-63
/*!100001 SET @@session.gtid_seq_no=63*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1400,7 +1400,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-64
/*!100001 SET @@session.gtid_seq_no=64*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1423,7 +1423,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-65
/*!100001 SET @@session.gtid_seq_no=65*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1460,7 +1460,7 @@ CREATE TABLE t1 (c16 BIGINT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-68
/*!100001 SET @@session.gtid_seq_no=68*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1481,7 +1481,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-69
/*!100001 SET @@session.gtid_seq_no=69*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1518,7 +1518,7 @@ CREATE TABLE t1 (c17 BIGINT UNSIGNED)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-72
/*!100001 SET @@session.gtid_seq_no=72*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1542,7 +1542,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-73
/*!100001 SET @@session.gtid_seq_no=73*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1565,7 +1565,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-74
/*!100001 SET @@session.gtid_seq_no=74*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1602,7 +1602,7 @@ CREATE TABLE t1 (c19 FLOAT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-77
/*!100001 SET @@session.gtid_seq_no=77*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1623,7 +1623,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-78
/*!100001 SET @@session.gtid_seq_no=78*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1660,7 +1660,7 @@ CREATE TABLE t1 (c22 DOUBLE)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-81
/*!100001 SET @@session.gtid_seq_no=81*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1681,7 +1681,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-82
/*!100001 SET @@session.gtid_seq_no=82*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1718,7 +1718,7 @@ CREATE TABLE t1 (c25 DECIMAL(10,5))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-85
/*!100001 SET @@session.gtid_seq_no=85*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1739,7 +1739,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-86
/*!100001 SET @@session.gtid_seq_no=86*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1760,7 +1760,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-87
/*!100001 SET @@session.gtid_seq_no=87*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1797,7 +1797,7 @@ CREATE TABLE t1 (c28 DATE)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-90
/*!100001 SET @@session.gtid_seq_no=90*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1818,7 +1818,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-91
/*!100001 SET @@session.gtid_seq_no=91*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1855,7 +1855,7 @@ CREATE TABLE t1 (c29 DATETIME)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-94
/*!100001 SET @@session.gtid_seq_no=94*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1876,7 +1876,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-95
/*!100001 SET @@session.gtid_seq_no=95*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1913,7 +1913,7 @@ CREATE TABLE t1 (c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURR
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-98
/*!100001 SET @@session.gtid_seq_no=98*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1935,7 +1935,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-99
/*!100001 SET @@session.gtid_seq_no=99*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1972,7 +1972,7 @@ CREATE TABLE t1 (c31 TIME)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-102
/*!100001 SET @@session.gtid_seq_no=102*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1993,7 +1993,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-103
/*!100001 SET @@session.gtid_seq_no=103*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2030,7 +2030,7 @@ CREATE TABLE t1 (c32 YEAR)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-106
/*!100001 SET @@session.gtid_seq_no=106*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2051,7 +2051,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-107
/*!100001 SET @@session.gtid_seq_no=107*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2088,7 +2088,7 @@ CREATE TABLE t1 (c33 CHAR)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-110
/*!100001 SET @@session.gtid_seq_no=110*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2109,7 +2109,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-111
/*!100001 SET @@session.gtid_seq_no=111*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2146,7 +2146,7 @@ CREATE TABLE t1 (c34 CHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-114
/*!100001 SET @@session.gtid_seq_no=114*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2167,7 +2167,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-115
/*!100001 SET @@session.gtid_seq_no=115*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2204,7 +2204,7 @@ CREATE TABLE t1 (c35 CHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-118
/*!100001 SET @@session.gtid_seq_no=118*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2225,7 +2225,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-119
/*!100001 SET @@session.gtid_seq_no=119*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2262,7 +2262,7 @@ CREATE TABLE t1 (c36 CHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-122
/*!100001 SET @@session.gtid_seq_no=122*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2283,7 +2283,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-123
/*!100001 SET @@session.gtid_seq_no=123*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2320,7 +2320,7 @@ CREATE TABLE t1 (c37 NATIONAL CHAR)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-126
/*!100001 SET @@session.gtid_seq_no=126*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2341,7 +2341,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-127
/*!100001 SET @@session.gtid_seq_no=127*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2378,7 +2378,7 @@ CREATE TABLE t1 (c38 NATIONAL CHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-130
/*!100001 SET @@session.gtid_seq_no=130*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2399,7 +2399,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-131
/*!100001 SET @@session.gtid_seq_no=131*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2436,7 +2436,7 @@ CREATE TABLE t1 (c39 NATIONAL CHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-134
/*!100001 SET @@session.gtid_seq_no=134*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2457,7 +2457,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-135
/*!100001 SET @@session.gtid_seq_no=135*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2494,7 +2494,7 @@ CREATE TABLE t1 (c40 NATIONAL CHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-138
/*!100001 SET @@session.gtid_seq_no=138*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2515,7 +2515,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-139
/*!100001 SET @@session.gtid_seq_no=139*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2536,7 +2536,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-140
/*!100001 SET @@session.gtid_seq_no=140*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2576,7 +2576,7 @@ CREATE TABLE t1 (c41 CHAR CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-143
/*!100001 SET @@session.gtid_seq_no=143*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2597,7 +2597,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-144
/*!100001 SET @@session.gtid_seq_no=144*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2634,7 +2634,7 @@ CREATE TABLE t1 (c42 CHAR(0) CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-147
/*!100001 SET @@session.gtid_seq_no=147*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2655,7 +2655,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-148
/*!100001 SET @@session.gtid_seq_no=148*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2692,7 +2692,7 @@ CREATE TABLE t1 (c43 CHAR(1) CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-151
/*!100001 SET @@session.gtid_seq_no=151*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2713,7 +2713,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-152
/*!100001 SET @@session.gtid_seq_no=152*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2750,7 +2750,7 @@ CREATE TABLE t1 (c44 CHAR(255) CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-155
/*!100001 SET @@session.gtid_seq_no=155*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2771,7 +2771,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-156
/*!100001 SET @@session.gtid_seq_no=156*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2792,7 +2792,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-157
/*!100001 SET @@session.gtid_seq_no=157*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2832,7 +2832,7 @@ CREATE TABLE t1 (c45 VARCHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-160
/*!100001 SET @@session.gtid_seq_no=160*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2853,7 +2853,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-161
/*!100001 SET @@session.gtid_seq_no=161*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2890,7 +2890,7 @@ CREATE TABLE t1 (c46 VARCHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-164
/*!100001 SET @@session.gtid_seq_no=164*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2911,7 +2911,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-165
/*!100001 SET @@session.gtid_seq_no=165*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2948,7 +2948,7 @@ CREATE TABLE t1 (c47 VARCHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-168
/*!100001 SET @@session.gtid_seq_no=168*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2969,7 +2969,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-169
/*!100001 SET @@session.gtid_seq_no=169*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3006,7 +3006,7 @@ CREATE TABLE t1 (c48 VARCHAR(261))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-172
/*!100001 SET @@session.gtid_seq_no=172*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3027,7 +3027,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-173
/*!100001 SET @@session.gtid_seq_no=173*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3064,7 +3064,7 @@ CREATE TABLE t1 (c49 NATIONAL VARCHAR(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-176
/*!100001 SET @@session.gtid_seq_no=176*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3085,7 +3085,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-177
/*!100001 SET @@session.gtid_seq_no=177*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3122,7 +3122,7 @@ CREATE TABLE t1 (c50 NATIONAL VARCHAR(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-180
/*!100001 SET @@session.gtid_seq_no=180*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3143,7 +3143,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-181
/*!100001 SET @@session.gtid_seq_no=181*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3180,7 +3180,7 @@ CREATE TABLE t1 (c51 NATIONAL VARCHAR(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-184
/*!100001 SET @@session.gtid_seq_no=184*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3201,7 +3201,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-185
/*!100001 SET @@session.gtid_seq_no=185*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3222,7 +3222,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-186
/*!100001 SET @@session.gtid_seq_no=186*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3262,7 +3262,7 @@ CREATE TABLE t1 (c52 NATIONAL VARCHAR(261))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-189
/*!100001 SET @@session.gtid_seq_no=189*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3283,7 +3283,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-190
/*!100001 SET @@session.gtid_seq_no=190*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3304,7 +3304,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-191
/*!100001 SET @@session.gtid_seq_no=191*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3344,7 +3344,7 @@ CREATE TABLE t1 (c53 VARCHAR(0) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-194
/*!100001 SET @@session.gtid_seq_no=194*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3365,7 +3365,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-195
/*!100001 SET @@session.gtid_seq_no=195*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3402,7 +3402,7 @@ CREATE TABLE t1 (c54 VARCHAR(1) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-198
/*!100001 SET @@session.gtid_seq_no=198*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3423,7 +3423,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-199
/*!100001 SET @@session.gtid_seq_no=199*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3460,7 +3460,7 @@ CREATE TABLE t1 (c55 VARCHAR(255) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-202
/*!100001 SET @@session.gtid_seq_no=202*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3481,7 +3481,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-203
/*!100001 SET @@session.gtid_seq_no=203*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3518,7 +3518,7 @@ CREATE TABLE t1 (c56 VARCHAR(261) CHARACTER SET ucs2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-206
/*!100001 SET @@session.gtid_seq_no=206*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3539,7 +3539,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-207
/*!100001 SET @@session.gtid_seq_no=207*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3576,7 +3576,7 @@ CREATE TABLE t1 (c57 BINARY)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-210
/*!100001 SET @@session.gtid_seq_no=210*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3597,7 +3597,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-211
/*!100001 SET @@session.gtid_seq_no=211*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3618,7 +3618,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-212
/*!100001 SET @@session.gtid_seq_no=212*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3639,7 +3639,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-213
/*!100001 SET @@session.gtid_seq_no=213*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3676,7 +3676,7 @@ CREATE TABLE t1 (c58 BINARY(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-216
/*!100001 SET @@session.gtid_seq_no=216*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3697,7 +3697,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-217
/*!100001 SET @@session.gtid_seq_no=217*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3734,7 +3734,7 @@ CREATE TABLE t1 (c59 BINARY(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-220
/*!100001 SET @@session.gtid_seq_no=220*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3755,7 +3755,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-221
/*!100001 SET @@session.gtid_seq_no=221*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3776,7 +3776,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-222
/*!100001 SET @@session.gtid_seq_no=222*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3797,7 +3797,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-223
/*!100001 SET @@session.gtid_seq_no=223*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3834,7 +3834,7 @@ CREATE TABLE t1 (c60 BINARY(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-226
/*!100001 SET @@session.gtid_seq_no=226*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3855,7 +3855,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-227
/*!100001 SET @@session.gtid_seq_no=227*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3876,7 +3876,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-228
/*!100001 SET @@session.gtid_seq_no=228*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3897,7 +3897,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-229
/*!100001 SET @@session.gtid_seq_no=229*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3934,7 +3934,7 @@ CREATE TABLE t1 (c61 VARBINARY(0))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-232
/*!100001 SET @@session.gtid_seq_no=232*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3955,7 +3955,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-233
/*!100001 SET @@session.gtid_seq_no=233*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3992,7 +3992,7 @@ CREATE TABLE t1 (c62 VARBINARY(1))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-236
/*!100001 SET @@session.gtid_seq_no=236*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4013,7 +4013,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-237
/*!100001 SET @@session.gtid_seq_no=237*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4034,7 +4034,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-238
/*!100001 SET @@session.gtid_seq_no=238*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4055,7 +4055,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-239
/*!100001 SET @@session.gtid_seq_no=239*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4092,7 +4092,7 @@ CREATE TABLE t1 (c63 VARBINARY(255))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-242
/*!100001 SET @@session.gtid_seq_no=242*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4113,7 +4113,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-243
/*!100001 SET @@session.gtid_seq_no=243*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4134,7 +4134,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-244
/*!100001 SET @@session.gtid_seq_no=244*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4155,7 +4155,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-245
/*!100001 SET @@session.gtid_seq_no=245*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4192,7 +4192,7 @@ CREATE TABLE t1 (c65 TINYBLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-248
/*!100001 SET @@session.gtid_seq_no=248*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4213,7 +4213,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-249
/*!100001 SET @@session.gtid_seq_no=249*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4250,7 +4250,7 @@ CREATE TABLE t1 (c68 BLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-252
/*!100001 SET @@session.gtid_seq_no=252*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4271,7 +4271,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-253
/*!100001 SET @@session.gtid_seq_no=253*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4308,7 +4308,7 @@ CREATE TABLE t1 (c71 MEDIUMBLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-256
/*!100001 SET @@session.gtid_seq_no=256*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4329,7 +4329,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-257
/*!100001 SET @@session.gtid_seq_no=257*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4366,7 +4366,7 @@ CREATE TABLE t1 (c74 LONGBLOB)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-260
/*!100001 SET @@session.gtid_seq_no=260*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4387,7 +4387,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-261
/*!100001 SET @@session.gtid_seq_no=261*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4424,7 +4424,7 @@ CREATE TABLE t1 (c66 TINYTEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-264
/*!100001 SET @@session.gtid_seq_no=264*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4445,7 +4445,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-265
/*!100001 SET @@session.gtid_seq_no=265*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4482,7 +4482,7 @@ CREATE TABLE t1 (c69 TEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-268
/*!100001 SET @@session.gtid_seq_no=268*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4503,7 +4503,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-269
/*!100001 SET @@session.gtid_seq_no=269*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4540,7 +4540,7 @@ CREATE TABLE t1 (c72 MEDIUMTEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-272
/*!100001 SET @@session.gtid_seq_no=272*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4561,7 +4561,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-273
/*!100001 SET @@session.gtid_seq_no=273*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4598,7 +4598,7 @@ CREATE TABLE t1 (c75 LONGTEXT)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-276
/*!100001 SET @@session.gtid_seq_no=276*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4619,7 +4619,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-277
/*!100001 SET @@session.gtid_seq_no=277*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4656,7 +4656,7 @@ CREATE TABLE t1 (c67 TINYTEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-280
/*!100001 SET @@session.gtid_seq_no=280*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4677,7 +4677,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-281
/*!100001 SET @@session.gtid_seq_no=281*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4714,7 +4714,7 @@ CREATE TABLE t1 (c70 TEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-284
/*!100001 SET @@session.gtid_seq_no=284*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4735,7 +4735,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-285
/*!100001 SET @@session.gtid_seq_no=285*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4772,7 +4772,7 @@ CREATE TABLE t1 (c73 MEDIUMTEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-288
/*!100001 SET @@session.gtid_seq_no=288*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4793,7 +4793,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-289
/*!100001 SET @@session.gtid_seq_no=289*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4830,7 +4830,7 @@ CREATE TABLE t1 (c76 LONGTEXT CHARACTER SET UCS2)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-292
/*!100001 SET @@session.gtid_seq_no=292*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4851,7 +4851,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-293
/*!100001 SET @@session.gtid_seq_no=293*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4888,7 +4888,7 @@ CREATE TABLE t1 (c77 ENUM('a','b','c'))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-296
/*!100001 SET @@session.gtid_seq_no=296*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4909,7 +4909,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-297
/*!100001 SET @@session.gtid_seq_no=297*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4946,7 +4946,7 @@ CREATE TABLE t1 (c78 SET('a','b','c','d','e','f'))
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-300
/*!100001 SET @@session.gtid_seq_no=300*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4967,7 +4967,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-301
/*!100001 SET @@session.gtid_seq_no=301*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4988,7 +4988,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-302
/*!100001 SET @@session.gtid_seq_no=302*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5009,7 +5009,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-303
/*!100001 SET @@session.gtid_seq_no=303*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5030,7 +5030,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-304
/*!100001 SET @@session.gtid_seq_no=304*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5051,7 +5051,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-305
/*!100001 SET @@session.gtid_seq_no=305*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5072,7 +5072,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-306
/*!100001 SET @@session.gtid_seq_no=306*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5093,7 +5093,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-307
/*!100001 SET @@session.gtid_seq_no=307*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5138,7 +5138,7 @@ CREATE TABLE t2 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-311
/*!100001 SET @@session.gtid_seq_no=311*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5160,7 +5160,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-312
/*!100001 SET @@session.gtid_seq_no=312*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5182,7 +5182,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-313
/*!100001 SET @@session.gtid_seq_no=313*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5204,7 +5204,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-314
/*!100001 SET @@session.gtid_seq_no=314*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5226,7 +5226,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-315
/*!100001 SET @@session.gtid_seq_no=315*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5294,7 +5294,7 @@ c_text_utf8 blob )
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-318
/*!100001 SET @@session.gtid_seq_no=318*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5347,7 +5347,7 @@ DELIMITER /*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=320*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 89757605a95..5fce079ef24 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2368,7 +2368,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2550,7 +2550,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2732,7 +2732,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3080,7 +3080,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3420,7 +3420,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3765,7 +3765,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4108,7 +4108,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8 trans
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4454,7 +4454,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4634,7 +4634,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-10 trans
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4811,7 +4811,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-11 trans
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4991,7 +4991,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12 trans
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5293,7 +5293,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5363,7 +5363,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5442,7 +5442,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5717,7 +5717,7 @@ c_3_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5787,7 +5787,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5857,7 +5857,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5927,7 +5927,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6117,7 +6117,7 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8 trans
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6331,7 +6331,7 @@ c3 VARCHAR(60)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index a7b5989ed9d..47b366fc61b 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2368,7 +2368,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2553,7 +2553,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -2737,7 +2737,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3087,7 +3087,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3429,7 +3429,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -3776,7 +3776,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4121,7 +4121,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4469,7 +4469,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4651,7 +4651,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -4830,7 +4830,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-11
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5012,7 +5012,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5316,7 +5316,7 @@ crn INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5388,7 +5388,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5469,7 +5469,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5746,7 +5746,7 @@ c_3_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5818,7 +5818,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5890,7 +5890,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -5962,7 +5962,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6154,7 +6154,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -6370,7 +6370,7 @@ c3 VARCHAR(60)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index 1d025cf38bc..349dc8b7610 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -172,7 +172,7 @@ c2 VARCHAR(20)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -257,7 +257,7 @@ TRUNCATE TABLE t1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -287,7 +287,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -326,7 +326,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -348,7 +348,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -433,7 +433,7 @@ TRUNCATE TABLE t2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-12
/*!100001 SET @@session.gtid_seq_no=12*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -463,7 +463,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-13
/*!100001 SET @@session.gtid_seq_no=13*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -502,7 +502,7 @@ COMMIT
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-14
/*!100001 SET @@session.gtid_seq_no=14*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
index c4a1ba9b83b..bca96dd5fd0 100644
--- a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
+++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_row.result
@@ -38,13 +38,13 @@ disconnect tmp_con;
connection default;
FLUSH LOGS;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (1,0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (2,0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
@@ -52,13 +52,13 @@ COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ ALTER TABLE t1 ADD c INT
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (3,0,0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Update_rows: table id # flags: STMT_END_F
@@ -70,7 +70,7 @@ BEGIN
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ DELETE FROM t1 WHERE a=5
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Delete_rows: table id # flags: STMT_END_F
@@ -82,25 +82,25 @@ BEGIN
# server id 1 end_log_pos # CRC32 0x######## Update_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (8, 5, 0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (9, 5, 1)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (10, 6, 0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
#Q> /* GTID */ INSERT INTO t1 VALUES (11, 7, 0)
# server id 1 end_log_pos # CRC32 0x######## Table_map: `test`.`t1` mapped to number #
# server id 1 end_log_pos # CRC32 0x######## Write_rows: table id # flags: STMT_END_F
diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
index c56dff9c8a0..4a6cd6f4ac0 100644
--- a/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
+++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_marks_stm_mix.result
@@ -38,21 +38,21 @@ disconnect tmp_con;
connection default;
FLUSH LOGS;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (1,0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (2,0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ ALTER TABLE t1 ADD c INT
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (3,0,0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
-BEGIN
+START TRANSACTION
/* GTID */ UPDATE t1 SET b=1, c=1 WHERE a=2
/* GTID */ CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
/* GTID */ INSERT INTO t2 VALUES (4,10), (5,20)
@@ -63,7 +63,7 @@ COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY) ENGINE=InnoDB
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
-BEGIN
+START TRANSACTION
/* GTID */ DELETE FROM t1 WHERE a=5
/* GTID */ INSERT INTO t3 VALUES (7)
/* GTID */ INSERT INTO t1 SELECT a, 4, 0 FROM t3
@@ -73,21 +73,21 @@ COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (8, 5, 0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
/* GTID */ ALTER TABLE t4 ADD b INT
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (9, 5, 1)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# trans
-BEGIN
+START TRANSACTION
/* GTID */ INSERT INTO t1 VALUES (10, 6, 0)
COMMIT/*!*/;
# server id 1 end_log_pos # CRC32 0x######## GTID #-#-# ddl
-BEGIN
+START TRANSACTION
/* GTID */ CREATE TEMPORARY TABLE t5 (a INT PRIMARY KEY) ENGINE=InnoDB
/* GTID */ INSERT INTO t1 VALUES (11, 7, 0)
COMMIT/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index ecd55142241..5d70f7871ab 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -144,7 +144,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -171,7 +171,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -198,7 +198,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -225,7 +225,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -267,7 +267,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -294,7 +294,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -374,7 +374,7 @@ CREATE DATABASE test1
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -401,7 +401,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -414,7 +414,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -427,7 +427,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -458,7 +458,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -471,7 +471,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -542,7 +542,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -567,7 +567,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -592,7 +592,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -617,7 +617,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -655,7 +655,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -680,7 +680,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -768,7 +768,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -795,7 +795,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -822,7 +822,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -849,7 +849,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -891,7 +891,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -918,7 +918,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -998,7 +998,7 @@ CREATE DATABASE test1
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1025,7 +1025,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1038,7 +1038,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1051,7 +1051,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1082,7 +1082,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1095,7 +1095,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -1166,7 +1166,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -1190,7 +1190,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -1214,7 +1214,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
@@ -1238,7 +1238,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -1275,7 +1275,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -1299,7 +1299,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index 194dc28cf3e..fc07aed7123 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -16,7 +16,7 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# Annotate_rows:
#Q> insert into t2 values (@v)
@@ -104,7 +104,7 @@ CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -125,7 +125,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -146,7 +146,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -167,7 +167,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -188,7 +188,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -209,7 +209,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index a30d7efab95..8fc90fd968c 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -62,7 +62,7 @@ CREATE TABLE t1 (a INT, b INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -97,7 +97,7 @@ CREATE TABLE t2 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -121,7 +121,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -152,7 +152,7 @@ CREATE TABLE t3 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -176,7 +176,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -198,7 +198,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -237,7 +237,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -303,7 +303,7 @@ CREATE TABLE t1 (a INT, b INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-2
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -338,7 +338,7 @@ CREATE TABLE t2 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -362,7 +362,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -393,7 +393,7 @@ CREATE TABLE t3 (a INT)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -417,7 +417,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -439,7 +439,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -478,7 +478,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-10
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index f15159c68b3..f7bc552c4e5 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -15,7 +15,7 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`v`:=_ucs2 X'006100620063' COLLATE `ucs2_general_ci`/*!*/;
use `test`/*!*/;
@@ -106,7 +106,7 @@ CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -121,7 +121,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -136,7 +136,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -151,7 +151,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -166,7 +166,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
@@ -181,7 +181,7 @@ COMMIT
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX GTID #-#-#
/*!100001 SET @@session.gtid_seq_no=#*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index 5ac6e31c080..da1ef1f40dd 100644
--- a/mysql-test/suite/binlog/r/flashback.result
+++ b/mysql-test/suite/binlog/r/flashback.result
@@ -81,7 +81,7 @@ c08 TEXT
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -107,7 +107,7 @@ COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -133,7 +133,7 @@ COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -159,7 +159,7 @@ COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -213,7 +213,7 @@ COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -296,7 +296,7 @@ ROLLBACK/*!*/;
# Number of rows: 3
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
@@ -331,7 +331,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
@@ -374,7 +374,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -389,7 +389,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
@@ -404,7 +404,7 @@ BEGIN/*!*/;
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
-BEGIN/*!*/;
+START TRANSACTION/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
index 0cb4305d78b..b5e6721ace1 100644
--- a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
@@ -148,7 +148,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -175,7 +175,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -202,7 +202,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -229,7 +229,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -271,7 +271,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -298,7 +298,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -381,7 +381,7 @@ CREATE DATABASE test1
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -408,7 +408,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -421,7 +421,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -434,7 +434,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -465,7 +465,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -478,7 +478,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -552,7 +552,7 @@ CREATE DATABASE test3
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-4
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -576,7 +576,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-5
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -600,7 +600,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-6
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
@@ -624,7 +624,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-7
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
@@ -661,7 +661,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-8
/*!100001 SET @@session.gtid_seq_no=8*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
@@ -685,7 +685,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # GTID 0-1-9
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
diff --git a/mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result b/mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result
new file mode 100644
index 00000000000..0656a685976
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/binlog_ptr_mysqlbinlog.result
@@ -0,0 +1,100 @@
+SET @@SQL_MODE = 'ORACLE';
+##########################################################################
+# Test verifies Gtid_log_event/Xid_log_event specific print #
+##########################################################################
+CREATE TABLE tm (f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+CREATE OR REPLACE PROCEDURE simpleproc (param1 OUT INT) AS
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t;
+END;
+/
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+RETURN 10;
+END;
+/
+FLUSH LOGS;
+##########################################################################
+# Delete data from master so that it can be restored from binlog #
+##########################################################################
+DROP FUNCTION f1;
+DROP PROCEDURE simpleproc;
+DROP TABLE tm;
+DROP TABLE t;
+##########################################################################
+# Post recovery using mysqlbinlog #
+##########################################################################
+SHOW TABLES;
+Tables_in_test
+t
+tm
+SELECT * FROM tm;
+f
+10
+SELECT * FROM t;
+f
+10
+SELECT f1();
+f1()
+10
+CALL simpleproc(@a);
+SELECT @a;
+@a
+1
+"***** Clean Up *****"
+DROP TABLE t,tm;
+DROP PROCEDURE simpleproc;
+DROP FUNCTION f1;
+RESET MASTER;
+##########################################################################
+# Test verifies Gtid_log_event/Xid_log_event/Qery_log_event #
+# specific print along with flashback option #
+##########################################################################
+CREATE TABLE tm(f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+INSERT INTO tm VALUES (20);
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+INSERT INTO t VALUES (20);
+##########################################################################
+# Initial data #
+##########################################################################
+SELECT * FROM tm;
+f
+10
+20
+SELECT * FROM t;
+f
+10
+20
+FLUSH LOGS;
+DELETE FROM tm WHERE f=20;
+DELETE FROM t WHERE f=20;
+FLUSH LOGS;
+##########################################################################
+# Data after deletion #
+##########################################################################
+SELECT * FROM tm;
+f
+10
+SELECT * FROM t;
+f
+10
+FOUND 2 /START TRANSACTION/ in test.sql
+##########################################################################
+# Data after recovery using flashback #
+##########################################################################
+SELECT * FROM tm;
+f
+10
+20
+SELECT * FROM t;
+f
+10
+20
+"***** Clean Up *****"
+DROP TABLE t,tm;
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
index a60bbc38883..31d794c9f61 100644
--- a/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
@@ -1045,7 +1045,7 @@ NULL;
END LOOP;
END;
$$
-ERROR 42000: Undefined CURSOR: c2
+ERROR 42000: Undeclared variable: c2
# Make sure "rec" shadows other declarations outside the loop
CREATE TABLE t1 (a INT, b VARCHAR(10));
INSERT INTO t1 VALUES (10, 'b0');
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result
index e62ce1df9e5..5e2ea82fbc3 100644
--- a/mysql-test/suite/compat/oracle/r/sp.result
+++ b/mysql-test/suite/compat/oracle/r/sp.result
@@ -1019,7 +1019,7 @@ LOOP
EXIT WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
CREATE PROCEDURE p1
AS
BEGIN
@@ -1028,7 +1028,7 @@ LOOP
EXIT label WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
CREATE PROCEDURE p1
AS
BEGIN
@@ -1036,7 +1036,7 @@ LOOP
CONTINUE WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
CREATE PROCEDURE p1
AS
BEGIN
@@ -1045,7 +1045,7 @@ LOOP
CONTINUE label WHEN unknown_ident IS NULL;
END LOOP;
END$$
-ERROR 42S22: Unknown column 'unknown_ident' in 'field list'
+ERROR 42000: Undeclared variable: unknown_ident
#
# MDEV-10583 sql_mode=ORACLE: SQL%ROWCOUNT
#
diff --git a/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt
new file mode 100644
index 00000000000..8f0cc182f51
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog-master.opt
@@ -0,0 +1 @@
+--flashback
diff --git a/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test
new file mode 100644
index 00000000000..bda32af5d4e
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/binlog_ptr_mysqlbinlog.test
@@ -0,0 +1,117 @@
+# ==== Purpose ====
+#
+# Test verifies that point in time recovery of binary log works when
+# sql_mode='ORACLE'.
+#
+# BEGIN statement is printed in three places
+# 1) "Gtid_log_event::print"
+# 2) "Xid_log_event::print" if flashback is enabled
+# 3) "Query_log_event::print" if flashback is enabled and engine is
+# non-transacional.
+#
+# Test verifies all these cases.
+#
+# ==== References ====
+#
+# MDEV-23108: Point in time recovery of binary log fails when sql_mode=ORACLE
+#
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+SET @@SQL_MODE = 'ORACLE';
+
+--echo ##########################################################################
+--echo # Test verifies Gtid_log_event/Xid_log_event specific print #
+--echo ##########################################################################
+CREATE TABLE tm (f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+
+DELIMITER /;
+CREATE OR REPLACE PROCEDURE simpleproc (param1 OUT INT) AS
+ BEGIN
+ SELECT COUNT(*) INTO param1 FROM t;
+ END;
+/
+CREATE FUNCTION f1 RETURN INT
+AS
+BEGIN
+ RETURN 10;
+END;
+/
+DELIMITER ;/
+
+FLUSH LOGS;
+--echo ##########################################################################
+--echo # Delete data from master so that it can be restored from binlog #
+--echo ##########################################################################
+DROP FUNCTION f1;
+DROP PROCEDURE simpleproc;
+DROP TABLE tm;
+DROP TABLE t;
+
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/test.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/test.sql
+
+--echo ##########################################################################
+--echo # Post recovery using mysqlbinlog #
+--echo ##########################################################################
+SHOW TABLES;
+SELECT * FROM tm;
+SELECT * FROM t;
+--horizontal_results
+SELECT f1();
+CALL simpleproc(@a);
+SELECT @a;
+
+--echo "***** Clean Up *****"
+DROP TABLE t,tm;
+DROP PROCEDURE simpleproc;
+DROP FUNCTION f1;
+--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
+RESET MASTER;
+
+--echo ##########################################################################
+--echo # Test verifies Gtid_log_event/Xid_log_event/Qery_log_event #
+--echo # specific print along with flashback option #
+--echo ##########################################################################
+CREATE TABLE tm(f INT) ENGINE=MYISAM;
+INSERT INTO tm VALUES (10);
+INSERT INTO tm VALUES (20);
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+INSERT INTO t VALUES (20);
+--echo ##########################################################################
+--echo # Initial data #
+--echo ##########################################################################
+SELECT * FROM tm;
+SELECT * FROM t;
+FLUSH LOGS;
+DELETE FROM tm WHERE f=20;
+DELETE FROM t WHERE f=20;
+FLUSH LOGS;
+
+--echo ##########################################################################
+--echo # Data after deletion #
+--echo ##########################################################################
+SELECT * FROM tm;
+SELECT * FROM t;
+--exec $MYSQL_BINLOG --flashback $MYSQLD_DATADIR/master-bin.000002 > $MYSQLTEST_VARDIR/tmp/test.sql
+
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/test.sql
+--let SEARCH_PATTERN=START TRANSACTION
+--source include/search_pattern_in_file.inc
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/test.sql
+
+--echo ##########################################################################
+--echo # Data after recovery using flashback #
+--echo ##########################################################################
+SELECT * FROM tm;
+SELECT * FROM t;
+
+--echo "***** Clean Up *****"
+DROP TABLE t,tm;
+--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
diff --git a/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test b/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
index ba0ca9b6a60..78a38c5f4c6 100644
--- a/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
+++ b/mysql-test/suite/compat/oracle/t/sp-cursor-rowtype.test
@@ -1128,7 +1128,7 @@ DELIMITER ;$$
--echo # IN followed by an unknown cursor name
DELIMITER $$;
---error ER_SP_CURSOR_MISMATCH
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1 AS
CURSOR c1 IS SELECT 'test' AS a FROM DUAL;
BEGIN
diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test
index 1c977e40f34..99bdc7166e0 100644
--- a/mysql-test/suite/compat/oracle/t/sp.test
+++ b/mysql-test/suite/compat/oracle/t/sp.test
@@ -1094,7 +1094,7 @@ DROP FUNCTION f1;
--echo #
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
@@ -1106,7 +1106,7 @@ DELIMITER ;$$
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
@@ -1119,7 +1119,7 @@ DELIMITER ;$$
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
@@ -1131,7 +1131,7 @@ DELIMITER ;$$
DELIMITER $$;
---error ER_BAD_FIELD_ERROR
+--error ER_SP_UNDECLARED_VAR
CREATE PROCEDURE p1
AS
BEGIN
diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result b/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
index 9a291ae1354..541680ae862 100644
--- a/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
+++ b/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
@@ -9,6 +9,9 @@ INSERT INTO t2 (f1,f2,f3) SELECT '', '', '' FROM seq_1_to_8192;
SELECT COUNT(*) FROM t1;
COUNT(*)
8192
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+8192
SELECT variable_value > @old_encrypted FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
variable_value > @old_encrypted
diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test b/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
index 779e77a4540..d99a55b9b44 100644
--- a/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
+++ b/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
@@ -15,6 +15,8 @@ CREATE TEMPORARY TABLE t2(f1 CHAR(100), f2 CHAR(200), f3 CHAR(200))ENGINE=InnoDB
INSERT INTO t2 (f1,f2,f3) SELECT '', '', '' FROM seq_1_to_8192;
SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
SELECT variable_value > @old_encrypted FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result
index d4f0de131d1..d7065b54788 100644
--- a/mysql-test/suite/funcs_1/r/is_table_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result
@@ -56,7 +56,6 @@ SELECT table_catalog, table_schema, table_name, privilege_type
FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL;
table_catalog table_schema table_name privilege_type
def mysql global_priv SELECT
-def mysql global_priv UPDATE
def mysql global_priv DELETE
######################################################################
# Testcase 3.2.11.2+3.2.11.3+3.2.11.4:
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index e4244c63297..cfab7ce3472 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -18,13 +18,11 @@ MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently
MW-329 : MDEV-19962 Galera test failure on MW-329
galera.galera_defaults : MDEV-21494 Galera test sporadic failure on galera.galera_defaults
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
-galera_autoinc_sst_mariabackup : Known issue, may require porting MDEV-17458 from later versions
galera_bf_abort_group_commit : MDEV-18282 Galera test failure on galera.galera_bf_abort_group_commit
galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files
galera_ftwrl : MDEV-21525 galera.galera_ftwrl
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
-galera_ist_progress : MDEV-15236 fails when trying to read transfer status
galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges
galera_kill_nochanges : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges
galera_load_data : MDEV-19968 galera.galera_load_data
@@ -43,7 +41,6 @@ galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_reject_queries : assertion in inline_mysql_socket_send
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
galera_wan : MDEV-17259 Test failure on galera.galera_wan
-mysql-wsrep#198 : MDEV-18935 Galera test mysql-wsrep#198 sporaric assertion transaction.cpp:362: int wsrep::transaction::before_commit(): Assertion `state() == s_executing || state() == s_committing || state() == s_must_abort || state() == s_replaying' failed.
lp1376747-4 : MDEV-21911 Galera test failure on lp1376747-4
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache
diff --git a/mysql-test/suite/galera/include/galera_st_clean_slave.inc b/mysql-test/suite/galera/include/galera_st_clean_slave.inc
index 3a49f4f6ad2..44cbf67fd12 100644
--- a/mysql-test/suite/galera/include/galera_st_clean_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_clean_slave.inc
@@ -102,12 +102,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
index d6d7552f7b6..3ac52deb284 100644
--- a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc
@@ -100,12 +100,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-test/suite/galera/include/galera_st_kill_slave.inc
index 0b96de55a32..a4d9e91e8be 100644
--- a/mysql-test/suite/galera/include/galera_st_kill_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_kill_slave.inc
@@ -96,12 +96,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
index 44a1513fa6e..bb8c68bd181 100644
--- a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
+++ b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc
@@ -110,6 +110,9 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
@@ -117,6 +120,8 @@ COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
diff --git a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
index 207282c8237..eeb6a15e0a3 100644
--- a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
+++ b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc
@@ -97,12 +97,18 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
ROLLBACK;
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_1
+--let $wait_condition = SELECT COUNT(*)=35 FROM t1
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 35 FROM t1;
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MDEV-22458.result b/mysql-test/suite/galera/r/MDEV-22458.result
new file mode 100644
index 00000000000..d1f9d94bd1c
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-22458.result
@@ -0,0 +1,10 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t1 (a INT);
+connect con1,localhost,root,,test;
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+SHOW EXPLAIN FOR $con1;
+ERROR HY000: Target is not running an EXPLAINable command
+connection con1;
+INSERT INTO t1 VALUES (5),(6),(7),(8);
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-328A.result b/mysql-test/suite/galera/r/MW-328A.result
index 448e927f09d..f256558644e 100644
--- a/mysql-test/suite/galera/r/MW-328A.result
+++ b/mysql-test/suite/galera/r/MW-328A.result
@@ -14,7 +14,10 @@ END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
+connection node_1;
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
connection node_2;
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
SET SESSION wsrep_retry_autocommit = 0;
connection node_1;
connection node_1X;
diff --git a/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
index 3eb56d1a48d..758c34ee62e 100644
--- a/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
+++ b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result
@@ -1,27 +1,30 @@
connection node_2;
connection node_1;
-connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
connection node_1;
-CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SET GLOBAL innodb_disallow_writes=ON;
-INSERT INTO t1 VALUES (1);;
+INSERT INTO t1 (f2) SELECT 'abcde ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
+connection node_2;
+INSERT INTO t1 (f2) SELECT 'fghij ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SELECT COUNT(*) AS EXPECT_10000 FROM t1;
+EXPECT_10000
+10000
connection node_1a;
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
-EXPECT_0
-0
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
-EXPECT_0
-0
SET GLOBAL innodb_disallow_writes=OFF;
connection node_1;
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
-EXPECT_1
-1
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
+EXPECT_20000
+20000
+connection node_2;
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
+EXPECT_20000
+20000
+connection node_1;
connection node_2;
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
-EXPECT_1
-1
DROP TABLE t1;
+DROP TABLE ten;
disconnect node_1a;
diff --git a/mysql-test/suite/galera/r/galera_var_notify_cmd.result b/mysql-test/suite/galera/r/galera_var_notify_cmd.result
index 823407fbba7..432d6c0adbd 100644
--- a/mysql-test/suite/galera/r/galera_var_notify_cmd.result
+++ b/mysql-test/suite/galera/r/galera_var_notify_cmd.result
@@ -1,3 +1,5 @@
+connection node_2;
+connection node_1;
connection node_1;
SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
EXPECT_2
diff --git a/mysql-test/suite/galera/r/mdev_21718.result b/mysql-test/suite/galera/r/mdev_21718.result
new file mode 100644
index 00000000000..ce938614854
--- /dev/null
+++ b/mysql-test/suite/galera/r/mdev_21718.result
@@ -0,0 +1,16 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+connection node_1;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL reached WAIT_FOR continue";
+COMMIT;
+connection node_1_ctrl;
+SET DEBUG_SYNC = "now WAIT_FOR reached";
+connection node_2;
+INSERT INTO t1 VALUES (1);
+connection node_1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
index 671fd1688c9..c0b2da5f349 100644
--- a/mysql-test/suite/galera/suite.pm
+++ b/mysql-test/suite/galera/suite.pm
@@ -64,6 +64,7 @@ push @::global_suppressions,
qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|,
qr|WSREP: Trying to continue unpaused monitor|,
+ qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|,
);
sub skip_combinations {
diff --git a/mysql-test/suite/galera/t/MDEV-22458.test b/mysql-test/suite/galera/t/MDEV-22458.test
new file mode 100644
index 00000000000..8f9ba1bb107
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-22458.test
@@ -0,0 +1,21 @@
+# MDEV-22458
+#
+# When running SHOW command, thread lock `LOCK_thd_data` should not be taken.
+# Lock will be taken only when we are killing thread
+#
+
+--source include/galera_cluster.inc
+CREATE TABLE t1 (a INT);
+
+--connect (con1,localhost,root,,test)
+--let $con1 = `SELECT CONNECTION_ID()`
+
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+
+--error ER_TARGET_NOT_EXPLAINABLE
+EVALP SHOW EXPLAIN FOR $con1;
+
+--connection con1
+INSERT INTO t1 VALUES (5),(6),(7),(8);
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test
index a547823ced0..2435a9e2c2e 100644
--- a/mysql-test/suite/galera/t/MW-328A.test
+++ b/mysql-test/suite/galera/t/MW-328A.test
@@ -16,7 +16,11 @@
--source include/force_restart.inc
--source suite/galera/t/MW-328-header.inc
+--connection node_1
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
+
--connection node_2
+call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
--let $count = 100
--let $successes = 0
--let $deadlocks = 0
diff --git a/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
index 37469d8a5fb..10f3815e135 100644
--- a/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
+++ b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test
@@ -11,40 +11,62 @@
#
--source include/galera_cluster.inc
+--source include/have_innodb.inc
--source include/have_log_bin.inc
+--let $datadir= `SELECT @@datadir`
+
+
# Open a separate connection to be used to run SHOW PROCESSLIST
---connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
--connection node_1a
SET SESSION wsrep_sync_wait = 0;
--connection node_1
-CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
SET GLOBAL innodb_disallow_writes=ON;
---send INSERT INTO t1 VALUES (1);
+--exec find $datadir -type f-exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_before
+
+#
+# This insert has no effect before innodb_disallow_writes is OFF
+#
+--send INSERT INTO t1 (f2) SELECT 'abcde ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_2
+INSERT INTO t1 (f2) SELECT 'fghij ' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SELECT COUNT(*) AS EXPECT_10000 FROM t1;
--connection node_1a
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
---source include/wait_condition.inc
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
-let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'INSERT INTO t1 VALUES (1)';
---source include/wait_condition.inc
-SELECT COUNT(*) AS EXPECT_0 FROM t1;
+--sleep 5
+
+--exec find $datadir -type f-exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_after
SET GLOBAL innodb_disallow_writes=OFF;
--connection node_1
--reap
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
--connection node_2
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
---source include/wait_condition.inc
---let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
--source include/wait_condition.inc
-SELECT COUNT(*) AS EXPECT_1 FROM t1;
+SELECT COUNT(*) AS EXPECT_20000 FROM t1;
+
+--connection node_1
+--diff_files $MYSQLTEST_VARDIR/tmp/innodb_before $MYSQLTEST_VARDIR/tmp/innodb_after
+
+--connection node_2
DROP TABLE t1;
+DROP TABLE ten;
--disconnect node_1a
diff --git a/mysql-test/suite/galera/t/mdev_21718.cnf b/mysql-test/suite/galera/t/mdev_21718.cnf
new file mode 100644
index 00000000000..9e066597a13
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev_21718.cnf
@@ -0,0 +1,4 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+thread-handling=pool-of-threads
diff --git a/mysql-test/suite/galera/t/mdev_21718.test b/mysql-test/suite/galera/t/mdev_21718.test
new file mode 100644
index 00000000000..3fbc4e773d5
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev_21718.test
@@ -0,0 +1,35 @@
+#
+# MDEV-21718 Reproduce a case where BF abort after
+# client session acquires the ownership but before calls
+# before_command() causes an assertion in wsrep-lib.
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+
+--let $galera_connection_name = node_1_ctrl
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL reached WAIT_FOR continue";
+--send COMMIT
+
+--connection node_1_ctrl
+SET DEBUG_SYNC = "now WAIT_FOR reached";
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+
+# BF abort wakes up node_1 from sync wait.
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+DROP TABLE t1;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm
index b808db6a50a..da02d4a9020 100644
--- a/mysql-test/suite/galera_3nodes/suite.pm
+++ b/mysql-test/suite/galera_3nodes/suite.pm
@@ -39,6 +39,13 @@ push @::global_suppressions,
qr(WSREP: Action message in non-primary configuration from member [0-9]*),
qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on),
qr(WSREP: JOIN message from member .* in non-primary configuration. Ignored.),
+ qr|Query apply failed:*|,
+ qr(WSREP: Ignoring error*),
+ qr(WSREP: Failed to remove page file .*),
+ qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
+ qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|,
+ qr|WSREP: Trying to continue unpaused monitor|,
+ qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|,
);
bless { };
diff --git a/mysql-test/suite/galera_sr/suite.pm b/mysql-test/suite/galera_sr/suite.pm
index cc13421d66d..a9665b5252c 100644
--- a/mysql-test/suite/galera_sr/suite.pm
+++ b/mysql-test/suite/galera_sr/suite.pm
@@ -62,6 +62,9 @@ push @::global_suppressions,
qr(WSREP: Ignoring error*),
qr(WSREP: Failed to remove page file .*),
qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
+ qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|,
+ qr|WSREP: Trying to continue unpaused monitor|,
+ qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|,
);
bless { };
diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result
index c750187e512..71c8ab4b190 100644
--- a/mysql-test/suite/gcol/r/gcol_bugfixes.result
+++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result
@@ -604,3 +604,69 @@ test gcol_t1 sidea NEVER NULL
test gcol_t1 sideb NEVER NULL
test gcol_t1 sidec VIRTUAL GENERATED ALWAYS sqrt(`sidea` * `sidea` + `sideb` * `sideb`)
DROP TABLE gcol_t1;
+#
+# MDEV-16039 Crash when selecting virtual columns
+# generated using functions with DAYNAME()
+#
+CREATE TABLE t1 (
+suppliersenttoday INT NOT NULL,
+suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+SELECT * FROM t1;
+suppliersenttoday suppliercaptoday
+0 Wednesday
+0 Wednesday
+PREPARE STMT FROM 'INSERT INTO t1 (suppliersenttoday) VALUES (1)';
+CREATE OR REPLACE TABLE t1 (
+suppliersenttoday INT NOT NULL,
+suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+EXECUTE STMT;
+EXECUTE STMT;
+SELECT * FROM t1;
+suppliersenttoday suppliercaptoday
+1 Wednesday
+1 Wednesday
+DROP TABLE t1;
+# (duplicate) MDEV-20380 Server crash during update
+CREATE TABLE gafld (
+nuigafld INTEGER NOT NULL,
+ucrgafld VARCHAR(30) COLLATE UTF8_BIN NOT NULL
+DEFAULT SUBSTRING_INDEX(USER(),'@',1)
+);
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gafld ALL NULL NULL NULL NULL 1 Using where
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gafld ALL NULL NULL NULL NULL 1 Using where
+DROP TABLE gafld;
+# (duplicate) MDEV-17653 replace into generated columns is unstable
+# Some columns are snipped from the MDEV test
+CREATE TABLE t (
+c0 TIMESTAMP NOT NULL DEFAULT current_timestamp()
+ON UPDATE current_timestamp(),
+c1 DECIMAL(27,25) GENERATED ALWAYS AS (DAYOFMONTH('2020-02-05')),
+c4 TIME NOT NULL,
+c8 SMALLINT(6) GENERATED ALWAYS AS
+(CONCAT_WS(CONVERT(C1 USING CP932),
+'900') <> (c4 = 1)),
+PRIMARY KEY (c4)
+) DEFAULT CHARSET=latin1;
+REPLACE INTO t SET c0 = '2018-06-03 10:31:43', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:44', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:45', c4 = '02:58:55';
+DROP TABLE t;
+# (duplicate) MDEV-17986 crash when I insert on a table
+CREATE OR REPLACE TABLE t2 (
+number BIGINT(20) NOT NULL,
+lrn BIGINT(20) NOT NULL DEFAULT 0,
+source VARCHAR(15) NOT NULL
+DEFAULT (REVERSE(SUBSTRING_INDEX(REVERSE(user()), '@', 1))),
+PRIMARY KEY (number)
+);
+REPLACE t2(number) VALUES('1');
+REPLACE t2(number) VALUES('1');
+DROP TABLE t2;
diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test
index 5563347a02a..033c430853d 100644
--- a/mysql-test/suite/gcol/t/gcol_bugfixes.test
+++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test
@@ -564,3 +564,73 @@ SELECT table_schema,table_name,column_name,extra,is_generated,generation_express
FROM information_schema.columns WHERE table_name='gcol_t1';
DROP TABLE gcol_t1;
+
+--echo #
+--echo # MDEV-16039 Crash when selecting virtual columns
+--echo # generated using functions with DAYNAME()
+--echo #
+
+CREATE TABLE t1 (
+ suppliersenttoday INT NOT NULL,
+ suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+INSERT INTO t1 (suppliersenttoday) VALUES (0);
+SELECT * FROM t1;
+
+PREPARE STMT FROM 'INSERT INTO t1 (suppliersenttoday) VALUES (1)';
+
+CREATE OR REPLACE TABLE t1 (
+ suppliersenttoday INT NOT NULL,
+ suppliercaptoday CHAR(10) AS (CONCAT('',DAYNAME('2020-02-05')))
+) COLLATE utf8_bin;
+
+EXECUTE STMT;
+EXECUTE STMT;
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+--echo # (duplicate) MDEV-20380 Server crash during update
+CREATE TABLE gafld (
+ nuigafld INTEGER NOT NULL,
+ ucrgafld VARCHAR(30) COLLATE UTF8_BIN NOT NULL
+ DEFAULT SUBSTRING_INDEX(USER(),'@',1)
+);
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
+DROP TABLE gafld;
+
+--echo # (duplicate) MDEV-17653 replace into generated columns is unstable
+--echo # Some columns are snipped from the MDEV test
+CREATE TABLE t (
+ c0 TIMESTAMP NOT NULL DEFAULT current_timestamp()
+ ON UPDATE current_timestamp(),
+ c1 DECIMAL(27,25) GENERATED ALWAYS AS (DAYOFMONTH('2020-02-05')),
+ c4 TIME NOT NULL,
+ c8 SMALLINT(6) GENERATED ALWAYS AS
+ (CONCAT_WS(CONVERT(C1 USING CP932),
+ '900') <> (c4 = 1)),
+ PRIMARY KEY (c4)
+) DEFAULT CHARSET=latin1;
+
+REPLACE INTO t SET c0 = '2018-06-03 10:31:43', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:44', c4 = '02:58:55';
+REPLACE INTO t SET c0 = '2018-06-03 10:31:45', c4 = '02:58:55';
+
+DROP TABLE t;
+
+--echo # (duplicate) MDEV-17986 crash when I insert on a table
+CREATE OR REPLACE TABLE t2 (
+ number BIGINT(20) NOT NULL,
+ lrn BIGINT(20) NOT NULL DEFAULT 0,
+ source VARCHAR(15) NOT NULL
+ DEFAULT (REVERSE(SUBSTRING_INDEX(REVERSE(user()), '@', 1))),
+ PRIMARY KEY (number)
+);
+
+REPLACE t2(number) VALUES('1');
+REPLACE t2(number) VALUES('1');
+
+DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def
index 4484417afce..35c941f8af7 100644
--- a/mysql-test/suite/innodb/disabled.def
+++ b/mysql-test/suite/innodb/disabled.def
@@ -11,4 +11,3 @@
##############################################################################
create-index-debug : MDEV-13680 InnoDB may crash when btr_page_alloc() fails
-innodb_force_recovery_rollback : MDEV-22889 InnoDB occasionally breaks ACID
diff --git a/mysql-test/suite/innodb/r/alter_primary_key.result b/mysql-test/suite/innodb/r/alter_primary_key.result
new file mode 100644
index 00000000000..afe687871f3
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_primary_key.result
@@ -0,0 +1,26 @@
+#
+# MDEV-23244 ALTER TABLE…ADD PRIMARY KEY fails to flag
+# duplicate key error from concurrent DML
+#
+CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (c CHAR(2) NOT NULL) ENGINE=InnoDB;
+connect con1,localhost,root,,;
+BEGIN;
+INSERT INTO t0 VALUES(1);
+connection default;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
+ALTER TABLE t1 ADD PRIMARY KEY(c(1));
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR dml';
+INSERT INTO t1 VALUES ('ab'),('ac');
+COMMIT;
+SET DEBUG_SYNC='now SIGNAL dml_done';
+disconnect con1;
+connection default;
+ERROR 23000: Duplicate entry 'a' for key 'PRIMARY'
+SET DEBUG_SYNC='RESET';
+SELECT * FROM t1;
+c
+ab
+ac
+DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/r/default_row_format_alter,compact.rdiff b/mysql-test/suite/innodb/r/default_row_format_alter,compact.rdiff
new file mode 100644
index 00000000000..09095c90e29
--- /dev/null
+++ b/mysql-test/suite/innodb/r/default_row_format_alter,compact.rdiff
@@ -0,0 +1,10 @@
+--- default_row_format_alter.result
++++ default_row_format_alter,compact.reject
+@@ -91,6 +91,6 @@
+ ALTER TABLE t1 ADD b INT;
+ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+ ROW_FORMAT
+-Dynamic
++Compact
+ DROP TABLE t1;
+ SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff b/mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff
new file mode 100644
index 00000000000..972ee9bdac8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/default_row_format_alter,redundant.rdiff
@@ -0,0 +1,10 @@
+--- default_row_format_alter.result
++++ default_row_format_alter,compact.reject
+@@ -91,6 +91,6 @@
+ ALTER TABLE t1 ADD b INT;
+ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+ ROW_FORMAT
+-Dynamic
++Redundant
+ DROP TABLE t1;
+ SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/r/default_row_format_alter.result b/mysql-test/suite/innodb/r/default_row_format_alter.result
index 1f349e6e2f6..42d006a2dd3 100644
--- a/mysql-test/suite/innodb/r/default_row_format_alter.result
+++ b/mysql-test/suite/innodb/r/default_row_format_alter.result
@@ -82,4 +82,15 @@ SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
+#
+# MDEV-23295 Assertion fields[i].same(instant.fields[i]) failed
+#
+SET GLOBAL innodb_default_row_format = @row_format;
+CREATE TABLE t1 (a char(8)) ENGINE=InnoDB DEFAULT CHARSET utf8;
+SET GLOBAL innodb_default_row_format= COMPACT;
+ALTER TABLE t1 ADD b INT;
+SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+ROW_FORMAT
+Dynamic
+DROP TABLE t1;
SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 24cf44c90e0..4bd1a09dd73 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -1069,3 +1069,20 @@ SELECT * FROM t1;
a b
10 10:20:30
DROP TABLE t1;
+#
+# MDEV-18042 Server crashes in mysql_alter_table upon adding a non-null
+# date column under NO_ZERO_DATE with ALGORITHM=INPLACE
+#
+SET @OLD_SQL_MODE= @@SQL_MODE;
+SET @@SQL_MODE= 'NO_ZERO_DATE';
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=MyISAM;
+ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB;
+ALTER TABLE t1 ADD d DATETIME NOT NULL CHECK (f <= 0), ALGORITHM=COPY;
+ERROR 42S22: Unknown column 'f' in 'CHECK'
+CREATE OR REPLACE TABLE t1 (a int) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN b DATETIME NOT NULL, LOCK=NONE;
+# Cleanup
+SET @@SQL_MODE= @OLD_SQL_MODE;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result b/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result
index 81fa2448e3d..c2db4bed2f9 100644
--- a/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result
+++ b/mysql-test/suite/innodb/r/innodb_force_recovery_rollback.result
@@ -13,6 +13,6 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
# restart: --innodb-force-recovery=2
disconnect con0;
connection default;
-SELECT * FROM t0 LOCK IN SHARE MODE;
+SELECT * FROM t0 LIMIT 0 LOCK IN SHARE MODE;
a
DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result
index 84c9ba2d630..d5acc872b49 100644
--- a/mysql-test/suite/innodb/r/instant_alter_bugs.result
+++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result
@@ -402,4 +402,12 @@ INSERT INTO t1 SET a=1, b=NULL;
ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;
+#
+# MDEV-22651 Assertion dict_col_get_fixed_size...
+# in dict_table_t::init_instant()
+#
+CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t SET i=1;
+ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
+DROP TABLE t;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter_charset.result b/mysql-test/suite/innodb/r/instant_alter_charset.result
index 9e7dab8f7b4..6b60c79b558 100644
--- a/mysql-test/suite/innodb/r/instant_alter_charset.result
+++ b/mysql-test/suite/innodb/r/instant_alter_charset.result
@@ -1992,3 +1992,43 @@ KEY a_key (b, a(1))
INSERT INTO t1 VALUES ();
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
DROP TABLE t1;
+#
+# MDEV-23245 Still getting assertion failure in file data0type.cc line 67
+#
+CREATE TABLE Foo
+(
+Bar char(2) CHARACTER SET utf8,
+KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar char(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+CREATE TABLE Foo
+(
+Bar varchar(2) CHARACTER SET utf8,
+KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar varchar(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+CREATE TABLE Foo
+(
+Bar text CHARACTER SET utf8,
+KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar text CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
+PRIMARY KEY (a(1)))
+ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`a`(1))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 MODIFY a VARCHAR(2)
+CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ('a');
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/mvcc.result b/mysql-test/suite/innodb/r/mvcc.result
index fc2d403fa63..215b2165b8c 100644
--- a/mysql-test/suite/innodb/r/mvcc.result
+++ b/mysql-test/suite/innodb/r/mvcc.result
@@ -29,4 +29,18 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
+#
+# MDEV-23198 Crash in REPLACE
+#
+BEGIN NOT ATOMIC
+DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(id INT PRIMARY KEY, c',
+GROUP_CONCAT(seq SEPARATOR ' INT, c'),
+' INT NOT NULL UNIQUE) ENGINE=InnoDB')
+FROM seq_1_to_294);
+EXECUTE IMMEDIATE c;
+END;
+$$
+INSERT INTO t1 SET id=1,c294=1;
+REPLACE t1 SET id=1,c294=1;
+DROP TABLE t1;
SET GLOBAL innodb_file_per_table= @save_per_table;
diff --git a/mysql-test/suite/innodb/t/alter_primary_key.test b/mysql-test/suite/innodb/t/alter_primary_key.test
new file mode 100644
index 00000000000..4edc0cc023e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_primary_key.test
@@ -0,0 +1,34 @@
+--source innodb_default_row_format.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+--echo #
+--echo # MDEV-23244 ALTER TABLE…ADD PRIMARY KEY fails to flag
+--echo # duplicate key error from concurrent DML
+--echo #
+
+CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (c CHAR(2) NOT NULL) ENGINE=InnoDB;
+
+connect (con1,localhost,root,,);
+BEGIN;
+INSERT INTO t0 VALUES(1);
+
+connection default;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
+send ALTER TABLE t1 ADD PRIMARY KEY(c(1));
+
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR dml';
+INSERT INTO t1 VALUES ('ab'),('ac');
+COMMIT;
+SET DEBUG_SYNC='now SIGNAL dml_done';
+disconnect con1;
+
+connection default;
+--error ER_DUP_ENTRY
+reap;
+SET DEBUG_SYNC='RESET';
+
+SELECT * FROM t1;
+DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/t/default_row_format_alter.test b/mysql-test/suite/innodb/t/default_row_format_alter.test
index 8f7217bcf0c..6690bc5bddf 100644
--- a/mysql-test/suite/innodb/t/default_row_format_alter.test
+++ b/mysql-test/suite/innodb/t/default_row_format_alter.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/innodb_row_format.inc
SET @row_format = @@GLOBAL.innodb_default_row_format;
@@ -95,4 +96,14 @@ ALTER TABLE t1 DROP INDEX k1;
SHOW TABLE STATUS LIKE 't1';
DROP TABLE t1;
+--echo #
+--echo # MDEV-23295 Assertion fields[i].same(instant.fields[i]) failed
+--echo #
+SET GLOBAL innodb_default_row_format = @row_format;
+CREATE TABLE t1 (a char(8)) ENGINE=InnoDB DEFAULT CHARSET utf8;
+SET GLOBAL innodb_default_row_format= COMPACT;
+ALTER TABLE t1 ADD b INT;
+SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
+DROP TABLE t1;
+
SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index d383b3bf55e..f72935ebc3c 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -668,6 +668,28 @@ ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-
SELECT * FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-18042 Server crashes in mysql_alter_table upon adding a non-null
+--echo # date column under NO_ZERO_DATE with ALGORITHM=INPLACE
+--echo #
+
+SET @OLD_SQL_MODE= @@SQL_MODE;
+SET @@SQL_MODE= 'NO_ZERO_DATE';
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=MyISAM;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE;
+
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t1 ADD d DATETIME NOT NULL CHECK (f <= 0), ALGORITHM=COPY;
+
+CREATE OR REPLACE TABLE t1 (a int) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN b DATETIME NOT NULL, LOCK=NONE;
+
+--echo # Cleanup
+SET @@SQL_MODE= @OLD_SQL_MODE;
+DROP TABLE t1;
+
#
# End of 10.2 tests
#
diff --git a/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test b/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test
index ad234eba72e..f1d14c45aaf 100644
--- a/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test
+++ b/mysql-test/suite/innodb/t/innodb_force_recovery_rollback.test
@@ -30,5 +30,6 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
disconnect con0;
connection default;
# If the rollback was aborted, we would end up in a lock wait here.
-SELECT * FROM t0 LOCK IN SHARE MODE;
+# The LIMIT 0 works around MDEV-22889 InnoDB occasionally breaks ACID
+SELECT * FROM t0 LIMIT 0 LOCK IN SHARE MODE;
DROP TABLE t0,t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
index b6b4cadc654..3dd0bedbbb6 100644
--- a/mysql-test/suite/innodb/t/instant_alter_bugs.test
+++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
@@ -420,4 +420,14 @@ ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
ALTER TABLE t1 ADD UNIQUE INDEX (va);
DROP TABLE t1;
+--echo #
+--echo # MDEV-22651 Assertion dict_col_get_fixed_size...
+--echo # in dict_table_t::init_instant()
+--echo #
+--source include/have_innodb.inc
+CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t SET i=1;
+ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
+DROP TABLE t;
+
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/t/instant_alter_charset.test b/mysql-test/suite/innodb/t/instant_alter_charset.test
index b14c7861c25..a5ddd49830c 100644
--- a/mysql-test/suite/innodb/t/instant_alter_charset.test
+++ b/mysql-test/suite/innodb/t/instant_alter_charset.test
@@ -803,3 +803,43 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES ();
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-23245 Still getting assertion failure in file data0type.cc line 67
+--echo #
+
+CREATE TABLE Foo
+(
+ Bar char(2) CHARACTER SET utf8,
+ KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar char(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+
+CREATE TABLE Foo
+(
+ Bar varchar(2) CHARACTER SET utf8,
+ KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar varchar(2) CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+
+CREATE TABLE Foo
+(
+ Bar text CHARACTER SET utf8,
+ KEY Bar (Bar(1))
+) ENGINE = InnoDB;
+ALTER TABLE Foo MODIFY Bar text CHARACTER SET utf8mb4;
+INSERT INTO Foo VALUES ('a');
+DROP TABLE Foo;
+
+CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
+PRIMARY KEY (a(1)))
+ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 MODIFY a VARCHAR(2)
+CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+INSERT INTO t1 VALUES ('a');
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/mvcc.test b/mysql-test/suite/innodb/t/mvcc.test
index bf76a5de798..7c37718c28a 100644
--- a/mysql-test/suite/innodb/t/mvcc.test
+++ b/mysql-test/suite/innodb/t/mvcc.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
SET @save_per_table= @@GLOBAL.innodb_file_per_table;
SET GLOBAL innodb_file_per_table= 1;
@@ -49,4 +50,23 @@ SELECT * FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-23198 Crash in REPLACE
+--echo #
+
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(id INT PRIMARY KEY, c',
+ GROUP_CONCAT(seq SEPARATOR ' INT, c'),
+ ' INT NOT NULL UNIQUE) ENGINE=InnoDB')
+ FROM seq_1_to_294);
+ EXECUTE IMMEDIATE c;
+END;
+$$
+DELIMITER ;$$
+
+INSERT INTO t1 SET id=1,c294=1;
+REPLACE t1 SET id=1,c294=1;
+DROP TABLE t1;
+
SET GLOBAL innodb_file_per_table= @save_per_table;
diff --git a/mysql-test/suite/plugins/r/audit_null_debug.result b/mysql-test/suite/plugins/r/audit_null_debug.result
index 3b18edf1d0b..727bd67aecf 100644
--- a/mysql-test/suite/plugins/r/audit_null_debug.result
+++ b/mysql-test/suite/plugins/r/audit_null_debug.result
@@ -14,6 +14,7 @@ uninstall plugin audit_null;
ERROR HY000: Index for table './mysql/plugin.MYI' is corrupt; try to repair it
SET debug_dbug=@old_dbug;
uninstall plugin audit_null;
+uninstall plugin audit_null;
ERROR 42000: PLUGIN audit_null does not exist
delete from mysql.plugin where name='audit_null';
alter table mysql.plugin engine=aria;
diff --git a/mysql-test/suite/plugins/t/audit_null_debug.test b/mysql-test/suite/plugins/t/audit_null_debug.test
index da949b15f8a..52c50f13b74 100644
--- a/mysql-test/suite/plugins/t/audit_null_debug.test
+++ b/mysql-test/suite/plugins/t/audit_null_debug.test
@@ -28,7 +28,8 @@ SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage';
uninstall plugin audit_null;
SET debug_dbug=@old_dbug;
---error 1305
+uninstall plugin audit_null;
+--error ER_SP_DOES_NOT_EXIST
uninstall plugin audit_null;
delete from mysql.plugin where name='audit_null';
diff --git a/mysql-test/suite/roles/set_role-table-column-priv.result b/mysql-test/suite/roles/set_role-table-column-priv.result
index 9e1d21bab5e..4aaa0388170 100644
--- a/mysql-test/suite/roles/set_role-table-column-priv.result
+++ b/mysql-test/suite/roles/set_role-table-column-priv.result
@@ -63,7 +63,7 @@ ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'ro
drop user 'test_user'@'localhost';
select * from mysql.tables_priv;
Host Db User Table_name Grantor Timestamp Table_priv Column_priv
-localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Update,Delete
+localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Delete
mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
diff --git a/mysql-test/suite/roles/set_role-table-simple.result b/mysql-test/suite/roles/set_role-table-simple.result
index 107ca726e22..f33df34d85e 100644
--- a/mysql-test/suite/roles/set_role-table-simple.result
+++ b/mysql-test/suite/roles/set_role-table-simple.result
@@ -61,7 +61,7 @@ ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'ro
drop user 'test_user'@'localhost';
select * from mysql.tables_priv;
Host Db User Table_name Grantor Timestamp Table_priv Column_priv
-localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Update,Delete
+localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Delete
mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
index b88c3576462..52da842d855 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
@@ -230,7 +230,7 @@ ALTER TABLE t1 ENGINE=BLACKHOLE
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -248,7 +248,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -266,7 +266,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -284,7 +284,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -302,7 +302,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-7 trans
/*!100001 SET @@session.gtid_seq_no=7*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -328,7 +328,7 @@ ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-9 trans
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -346,7 +346,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-10 trans
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -364,7 +364,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-11 trans
/*!100001 SET @@session.gtid_seq_no=11*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -390,7 +390,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY key_t1 (a)
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-13 trans
/*!100001 SET @@session.gtid_seq_no=13*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -408,7 +408,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-14 trans
/*!100001 SET @@session.gtid_seq_no=14*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
@@ -426,7 +426,7 @@ COMMIT
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX GTID 0-1-15 trans
/*!100001 SET @@session.gtid_seq_no=15*//*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
# at #
# at #
diff --git a/mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result b/mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result
new file mode 100644
index 00000000000..3a80d5b5f31
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_dump_request_retry_warning.result
@@ -0,0 +1,22 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES(1);
+connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug= 'd,simulate_error_on_packet_write';
+START SLAVE;
+SET DEBUG_SYNC= 'now WAIT_FOR parked';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SET DEBUG_SYNC= 'RESET';
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_start.inc
+connection master;
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+a
+1
+connection master;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index 59c572fd2d2..406b1d145d1 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime.result
@@ -46,7 +46,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1293832861.123456/*!*/;
SET @@session.time_zone='+03:00'/*!*/;
@@ -55,7 +55,7 @@ insert t1 (b,c) values (now(6), now(6))
SET TIMESTAMP=1293832861.123456/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1293832861/*!*/;
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010')
@@ -63,7 +63,7 @@ insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','201
SET TIMESTAMP=1293832861/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (now(), now())
@@ -71,7 +71,7 @@ insert t1 (b,c) values (now(), now())
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (0,0)
@@ -79,7 +79,7 @@ insert t1 (b,c) values (0,0)
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (a,b,c) values (0,0,now(6))
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index 22060954fd7..5ec40d81ade 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev382.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -189,7 +189,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
`c``3` VARCHAR(7))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE '<name>' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!")
@@ -200,7 +200,7 @@ COMMIT
SET TIMESTAMP=1000000000/*!*/;
truncate `t``1`
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -288,7 +288,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
@@ -296,7 +296,7 @@ INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,1844674407370
SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET @`a``1`:=-9223372036854775808/*!*/;
SET @`a``2`:=42/*!*/;
@@ -383,7 +383,7 @@ master-bin.000002 # Query 1 # COMMIT
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `ts``et`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_row_virt.result b/mysql-test/suite/rpl/r/rpl_row_virt.result
new file mode 100644
index 00000000000..b670c63d9f1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_virt.result
@@ -0,0 +1,20 @@
+include/master-slave.inc
+[connection master]
+connection master;
+create table t1 (
+id int auto_increment,
+data varchar(32),
+virt tinyint as (1),
+primary key (id),
+key virt (virt)
+) engine=innodb default charset=utf8mb4;
+insert into t1 (data) values ('broken');
+update t1 set data='more broken';
+connection slave;
+select * from t1;
+id data virt
+1 more broken 1
+connection master;
+drop table t1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 8fe417d51cc..b6f4e87bfa2 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -810,7 +810,7 @@ insert into t1 values (b);
insert into t1 values (unix_timestamp());
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values ( NAME_CONST('b',8))
@@ -818,7 +818,7 @@ insert into t1 values ( NAME_CONST('b',8))
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (unix_timestamp())
@@ -826,7 +826,7 @@ insert into t1 values (unix_timestamp())
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -872,7 +872,7 @@ insert into t2 values(3);
insert into t1 values (5);
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -880,7 +880,7 @@ insert into t2 values(3)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (15)
@@ -888,7 +888,7 @@ insert into t1 values (15)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -899,7 +899,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
alter procedure foo4 sql security invoker
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
@@ -907,7 +907,7 @@ insert into t2 values(3)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (5)
@@ -915,7 +915,7 @@ insert into t1 values (5)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t2
@@ -936,7 +936,7 @@ begin
insert into t2 values(20),(20);
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(20),(20)
@@ -964,7 +964,7 @@ insert into t1 values (x);
return x+2;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete t1,t2 from t1,t2
@@ -972,7 +972,7 @@ delete t1,t2 from t1,t2
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
@@ -980,7 +980,7 @@ SELECT `mysqltest1`.`fn1`(20)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(fn1(21))
@@ -998,7 +998,7 @@ begin
return unix_timestamp();
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1006,7 +1006,7 @@ delete from t1
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values(fn1())
@@ -1028,7 +1028,7 @@ begin
return 0;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t2
@@ -1049,7 +1049,7 @@ insert into t2 values(x),(x);
return 10;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(100)
@@ -1057,7 +1057,7 @@ SELECT `mysqltest1`.`fn1`(100)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
@@ -1065,7 +1065,7 @@ SELECT `mysqltest1`.`fn1`(20)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1076,7 +1076,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (1)
@@ -1084,7 +1084,7 @@ insert into t1 values (1)
SET TIMESTAMP=t/*!*/;
COMMIT
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
@@ -1095,7 +1095,7 @@ COMMIT
SET TIMESTAMP=t/*!*/;
drop trigger trg
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (1)
@@ -1142,7 +1142,7 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW
SET TIMESTAMP=t/*!*/;
create table t1 (a int)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 (a) values (f1())
@@ -1169,7 +1169,7 @@ SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
INSERT INTO t1 VALUES(arg)
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
@@ -1223,7 +1223,7 @@ SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`()
begin end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t values ( 1 )
@@ -1238,7 +1238,7 @@ insert into t values (1);
return 0;
end
/*!*/;
-BEGIN
+START TRANSACTION
/*!*/;
use `mysqltest`/*!*/;
SET TIMESTAMP=t/*!*/;
diff --git a/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test b/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test
new file mode 100644
index 00000000000..d750d44ae71
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test
@@ -0,0 +1,60 @@
+# ==== Purpose ====
+#
+# Test verifies that, due to a temporary network error, if request dump
+# command specific packet write operation fails then the write error gets
+# handled appropriately. Further retry will be initiated with appropriate
+# slave registration on master. This will ensure that master has all the
+# details of slave and no warnings are reported on the master side.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Skip the slave start.
+# 1 - Enable debug simulation which will simulate packet write error during
+# dump request command execution.
+# 2 - Start the slave. Observe that slave is able to reconnect post
+# temporary network write error.
+#
+# ==== References ====
+#
+# MDEV-14203: rpl.rpl_extra_col_master_myisam,
+# rpl.rpl_slave_load_tmpdir_not_exist failed in buildbot with a
+# warning
+#
+# MDEV-13258: rpl.rpl_skip_replication, rpl.rpl_set_statement_default_master
+# failed in buildbot
+#
+
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--let $rpl_skip_start_slave=1
+--source include/master-slave.inc
+
+# Do an insert on master
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES(1);
+
+# Add a debug point and start the slave so that dump request fails.
+connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug= 'd,simulate_error_on_packet_write';
+
+START SLAVE;
+SET DEBUG_SYNC= 'now WAIT_FOR parked';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SET DEBUG_SYNC= 'RESET';
+
+--source include/wait_for_slave_io_to_start.inc
+--source include/wait_for_slave_sql_to_start.inc
+
+# Sync the slave and verify that slave has caught up with the master.
+connection master;
+--source include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+
+# Cleanup
+connection master;
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_virt.test b/mysql-test/suite/rpl/t/rpl_row_virt.test
new file mode 100644
index 00000000000..e79869cd8e4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_virt.test
@@ -0,0 +1,27 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--source include/have_innodb.inc
+connection master;
+
+create table t1 (
+ id int auto_increment,
+ data varchar(32),
+ virt tinyint as (1),
+ primary key (id),
+ key virt (virt)
+) engine=innodb default charset=utf8mb4;
+
+insert into t1 (data) values ('broken');
+
+update t1 set data='more broken';
+
+--sync_slave_with_master
+
+select * from t1;
+
+--connection master
+drop table t1;
+
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
index bb34436b4ec..e0f3e210feb 100644
--- a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
+++ b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
@@ -104,15 +104,9 @@ autocommit,character_set_client,character_set_connection,character_set_results,t
connection default;
# Testing NULL
SET @@global.session_track_system_variables = NULL;
+ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
SET @@session.session_track_system_variables = NULL;
-# Global - expect "" instead of NULL
-SELECT @@global.session_track_system_variables;
-@@global.session_track_system_variables
-NULL
-# Session - expect "" instead of NULL
-SELECT @@session.session_track_system_variables;
-@@session.session_track_system_variables
-
+ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
# testing with duplicate entries.
SET @@global.session_track_system_variables= "time_zone";
SET @@session.session_track_system_variables= "time_zone";
diff --git a/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test b/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test
index e58d405cf0a..20f0cd6cf17 100644
--- a/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test
+++ b/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test
@@ -85,14 +85,11 @@ SELECT @@session.session_track_system_variables;
connection default;
--echo # Testing NULL
+--error ER_WRONG_VALUE_FOR_VAR
SET @@global.session_track_system_variables = NULL;
+--error ER_WRONG_VALUE_FOR_VAR
SET @@session.session_track_system_variables = NULL;
---echo # Global - expect "" instead of NULL
-SELECT @@global.session_track_system_variables;
---echo # Session - expect "" instead of NULL
-SELECT @@session.session_track_system_variables;
-
--echo # testing with duplicate entries.
# Lets first set it to some valid value.
SET @@global.session_track_system_variables= "time_zone";
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index b945ca4fb5b..cc9891a1f6e 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -348,11 +348,7 @@ insert t1 values (1);
delete from t1;
set timestamp=unix_timestamp('2001-02-04 10:20:50');
insert t1 values (2);
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
delete from t1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
select subpartition_name,partition_description,table_rows from information_schema.partitions where table_schema='test' and table_name='t1';
subpartition_name partition_description table_rows
p1sp0 2001-02-04 00:00:00 1
@@ -395,6 +391,22 @@ i
explain partitions select * from t1 for system_time all where row_end = @ts;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1_p1sp0,p1_p1sp1 # NULL NULL NULL NULL # #
+#
+# MDEV-16023 Unfortunate error message WARN_VERS_PART_FULL
+#
+set timestamp= unix_timestamp('2020-07-29 10:30:10');
+create or replace table t1 (a int) with system versioning
+partition by system_time interval 1 second (
+partition p0 history,
+partition p1 history,
+partition pc current
+);
+set timestamp= unix_timestamp('2020-07-29 10:30:14');
+insert into t1 values (1),(2),(3);
+show warnings;
+Level Code Message
+# Cleanup
+set timestamp= default;
## INTERVAL ... STARTS
create or replace table t1 (i int) with system versioning
partition by system_time interval 1 day starts 'a';
@@ -544,16 +556,10 @@ partition by system_time interval 1 day starts '2000-01-01 00:00:00'
partitions 3;
# we are warned when we push to present:
insert into t1 values (0);
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
set timestamp= unix_timestamp('2001-01-01 00:00:01');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
set timestamp= unix_timestamp('2001-01-01 00:00:02');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
select *, row_end from t1 partition (p0);
i row_end
select *, row_end from t1 partition (p1);
@@ -596,12 +602,8 @@ set timestamp= unix_timestamp('2000-01-02 00:00:01');
update t1 set i= i + 1;
set timestamp= unix_timestamp('2000-01-03 00:00:01');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
set timestamp= unix_timestamp('2000-01-04 00:00:01');
update t1 set i= i + 1;
-Warnings:
-Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions
alter table t1 add partition (partition p2 history, partition p3 history);
select *, row_end from t1 partition (p0);
i row_end
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 507e8d40256..a154cc37ae2 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -311,6 +311,25 @@ select * from t1 for system_time all where row_end = @ts;
--replace_column 5 # 10 # 11 #
explain partitions select * from t1 for system_time all where row_end = @ts;
+--echo #
+--echo # MDEV-16023 Unfortunate error message WARN_VERS_PART_FULL
+--echo #
+
+set timestamp= unix_timestamp('2020-07-29 10:30:10');
+create or replace table t1 (a int) with system versioning
+ partition by system_time interval 1 second (
+ partition p0 history,
+ partition p1 history,
+ partition pc current
+ );
+
+set timestamp= unix_timestamp('2020-07-29 10:30:14');
+insert into t1 values (1),(2),(3);
+show warnings;
+
+--echo # Cleanup
+set timestamp= default;
+
--echo ## INTERVAL ... STARTS
--error ER_PART_WRONG_VALUE
create or replace table t1 (i int) with system versioning
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c
index 40b78986985..1503a5db442 100644
--- a/mysys/my_rdtsc.c
+++ b/mysys/my_rdtsc.c
@@ -382,6 +382,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
#elif defined(__GNUC__) && defined(__s390__)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
+#elif defined(__GNUC__) && defined (__aarch64__)
+ mti->cycles.routine= MY_TIMER_ROUTINE_AARCH64;
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
#else
@@ -629,7 +631,11 @@ void my_timer_init(MY_TIMER_INFO *mti)
time1= my_timer_cycles();
time2= my_timer_ticks();
time3= time2; /* Avoids a Microsoft/IBM compiler warning */
+#if defined(HAVE_SYS_TIMES_H) && defined(HAVE_TIMES)
+ for (i= 0; i < 1000; ++i)
+#else
for (i= 0; i < MY_TIMER_ITERATIONS * 1000; ++i)
+#endif
{
time3= my_timer_ticks();
if (time3 - time2 > 10) break;
diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt
index 28a194927e9..93ac29cd425 100644
--- a/plugin/auth_pam/CMakeLists.txt
+++ b/plugin/auth_pam/CMakeLists.txt
@@ -25,7 +25,7 @@ IF(HAVE_PAM_APPL_H)
FIND_LIBRARY(PAM_LIBRARY pam) # for srpm build-depends detection
ADD_DEFINITIONS(-D_GNU_SOURCE)
MYSQL_ADD_PLUGIN(auth_pam_v1 auth_pam_v1.c LINK_LIBRARIES pam MODULE_ONLY)
- MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam dl MODULE_ONLY)
+ MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam ${LIBDL} MODULE_ONLY)
IF (TARGET auth_pam)
MYSQL_ADD_EXECUTABLE(auth_pam_tool auth_pam_tool.c DESTINATION ${INSTALL_PLUGINDIR}/auth_pam_tool_dir COMPONENT Server)
TARGET_LINK_LIBRARIES(auth_pam_tool pam)
diff --git a/plugin/type_inet/sql_type_inet.cc b/plugin/type_inet/sql_type_inet.cc
index 76334ad1615..14d854be14f 100644
--- a/plugin/type_inet/sql_type_inet.cc
+++ b/plugin/type_inet/sql_type_inet.cc
@@ -622,10 +622,15 @@ class Field_inet6: public Field
Sql_condition::enum_warning_level level)
{
static const Name type_name= type_handler_inet6.name();
- if (get_thd()->count_cuted_fields > CHECK_FIELD_EXPRESSION)
- get_thd()->push_warning_truncated_value_for_field(level, type_name.ptr(),
- str.ptr(), table->s,
- field_name.str);
+ if (get_thd()->count_cuted_fields <= CHECK_FIELD_EXPRESSION)
+ return;
+ const TABLE_SHARE *s= table->s;
+ get_thd()->push_warning_truncated_value_for_field(level, type_name.ptr(),
+ str.ptr(),
+ s ? s->db.str : nullptr,
+ s ? s->table_name.str
+ : nullptr,
+ field_name.str);
}
int set_null_with_warn(const ErrConv &str)
{
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 3f3129128ae..e390f36a98b 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -116,7 +116,7 @@ CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', H
CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(141) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
CREATE TEMPORARY TABLE tmp_user_sys LIKE tables_priv;
-INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Update,Delete');
+INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Delete');
INSERT INTO tables_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys;
diff --git a/sql-common/client.c b/sql-common/client.c
index 1ce80a17d24..c12b3ef5c0a 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -512,6 +512,8 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
set_mysql_error(mysql, CR_NET_PACKET_TOO_LARGE, unknown_sqlstate);
goto end;
}
+ if (net->last_errno == ER_NET_ERROR_ON_WRITE && command == COM_BINLOG_DUMP)
+ goto end;
end_server(mysql);
if (mysql_reconnect(mysql) || stmt_skip)
goto end;
diff --git a/sql/field.cc b/sql/field.cc
index c5d72abc526..8cd619571c4 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2401,7 +2401,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy)
bool Field::get_date(MYSQL_TIME *to, date_mode_t mode)
{
StringBuffer<40> tmp;
- Temporal::Warn_push warn(get_thd(), NULL, NullS, to, mode);
+ Temporal::Warn_push warn(get_thd(), nullptr, nullptr, nullptr, to, mode);
Temporal_hybrid *t= new(to) Temporal_hybrid(get_thd(), &warn,
val_str(&tmp), mode);
return !t->is_valid_temporal();
@@ -10887,14 +10887,16 @@ void Field::set_datetime_warning(Sql_condition::enum_warning_level level,
if (thd->really_abort_on_warning() && level >= Sql_condition::WARN_LEVEL_WARN)
{
/*
- field_str.name can be NULL when field is not in the select list:
+ field_name.str can be NULL when field is not in the select list:
SET SESSION SQL_MODE= 'STRICT_ALL_TABLES,NO_ZERO_DATE';
CREATE OR REPLACE TABLE t2 SELECT 1 AS f FROM t1 GROUP BY FROM_DAYS(d);
Can't call push_warning_truncated_value_for_field() directly here,
as it expect a non-NULL name.
*/
thd->push_warning_wrong_or_truncated_value(level, false, typestr,
- str->ptr(), table->s,
+ str->ptr(),
+ table->s->db.str,
+ table->s->table_name.str,
field_name.str);
}
else
diff --git a/sql/handler.h b/sql/handler.h
index 1acf816dcb9..d55a83c9b93 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -2514,6 +2514,9 @@ public:
/** true for online operation (LOCK=NONE) */
bool online;
+ /** which ALGORITHM and LOCK are supported by the storage engine */
+ enum_alter_inplace_result inplace_supported;
+
/**
Can be set by handler to describe why a given operation cannot be done
in-place (HA_ALTER_INPLACE_NOT_SUPPORTED) or why it cannot be done
diff --git a/sql/item.cc b/sql/item.cc
index 5c662e5e6ff..3ea1a493db2 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1395,8 +1395,10 @@ bool Item::get_date_from_real(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate
bool Item::get_date_from_string(THD *thd, MYSQL_TIME *to, date_mode_t mode)
{
StringBuffer<MAX_DATETIME_FULL_WIDTH+1> tmp;
- Temporal::Warn_push warn(thd, field_table_or_null(), field_name_or_null(),
- to, mode);
+ const TABLE_SHARE *s = field_table_or_null();
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name_or_null(), to, mode);
Temporal_hybrid *t= new(to) Temporal_hybrid(thd, &warn, val_str(&tmp), mode);
return !t->is_valid_temporal();
}
@@ -2562,14 +2564,7 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
bool res= FALSE;
uint i;
- /*
- In case we're in statement prepare, create conversion item
- in its memory: it will be reused on each execute.
- */
- Query_arena backup;
- Query_arena *arena= thd->stmt_arena->is_stmt_prepare() ?
- thd->activate_stmt_arena_if_needed(&backup) :
- NULL;
+ DBUG_ASSERT(!thd->stmt_arena->is_stmt_prepare());
for (i= 0, arg= args; i < nargs; i++, arg+= item_sep)
{
@@ -2591,20 +2586,8 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
res= TRUE;
break; // we cannot return here, we need to restore "arena".
}
- /*
- If in statement prepare, then we create a converter for two
- constant items, do it once and then reuse it.
- If we're in execution of a prepared statement, arena is NULL,
- and the conv was created in runtime memory. This can be
- the case only if the argument is a parameter marker ('?'),
- because for all true constants the charset converter has already
- been created in prepare. In this case register the change for
- rollback.
- */
- if (thd->stmt_arena->is_stmt_prepare())
- *arg= conv;
- else
- thd->change_item_tree(arg, conv);
+
+ thd->change_item_tree(arg, conv);
if (conv->fix_fields_if_needed(thd, arg))
{
@@ -2612,8 +2595,6 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
break; // we cannot return here, we need to restore "arena".
}
}
- if (arena)
- thd->restore_active_arena(arena, &backup);
return res;
}
@@ -4142,7 +4123,7 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
{
ErrConvTime str(&value.time);
make_truncated_value_warning(current_thd, Sql_condition::WARN_LEVEL_WARN,
- &str, time_type, 0, 0);
+ &str, time_type, NULL, NULL, NULL);
set_zero_time(&value.time, time_type);
}
maybe_null= 0;
diff --git a/sql/item_create.cc b/sql/item_create.cc
index edf44fc3cd3..62f4d9f9fee 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+ Copyright (c) 2008, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 9e30afd0239..813927df32b 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2288,10 +2288,13 @@ bool Item_func_int_val::fix_length_and_dec()
{
DBUG_ENTER("Item_func_int_val::fix_length_and_dec");
DBUG_PRINT("info", ("name %s", func_name()));
- if (args[0]->cast_to_int_type_handler()->
- Item_func_int_val_fix_length_and_dec(this))
+ /*
+ We don't want to translate ENUM/SET to CHAR here.
+ So let's call real_type_handler(), not type_handler().
+ */
+ if (args[0]->real_type_handler()->Item_func_int_val_fix_length_and_dec(this))
DBUG_RETURN(TRUE);
- DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
+ DBUG_PRINT("info", ("Type: %s", real_type_handler()->name().ptr()));
DBUG_RETURN(FALSE);
}
@@ -2299,6 +2302,7 @@ bool Item_func_int_val::fix_length_and_dec()
longlong Item_func_ceiling::int_op()
{
switch (args[0]->result_type()) {
+ case STRING_RESULT: // hex hybrid
case INT_RESULT:
return val_int_from_item(args[0]);
case DECIMAL_RESULT:
@@ -2332,9 +2336,32 @@ my_decimal *Item_func_ceiling::decimal_op(my_decimal *decimal_value)
}
+bool Item_func_ceiling::date_op(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate)
+{
+ Datetime::Options opt(thd, TIME_FRAC_TRUNCATE);
+ Datetime *tm= new (to) Datetime(thd, args[0], opt);
+ tm->ceiling(thd);
+ null_value= !tm->is_valid_datetime();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
+bool Item_func_ceiling::time_op(THD *thd, MYSQL_TIME *to)
+{
+ static const Time::Options_for_round opt;
+ Time *tm= new (to) Time(thd, args[0], opt);
+ tm->ceiling();
+ null_value= !tm->is_valid_time();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
longlong Item_func_floor::int_op()
{
switch (args[0]->result_type()) {
+ case STRING_RESULT: // hex hybrid
case INT_RESULT:
return val_int_from_item(args[0]);
case DECIMAL_RESULT:
@@ -2372,6 +2399,28 @@ my_decimal *Item_func_floor::decimal_op(my_decimal *decimal_value)
}
+bool Item_func_floor::date_op(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate)
+{
+ // DATETIME is not negative, so FLOOR means just truncation
+ Datetime::Options opt(thd, TIME_FRAC_TRUNCATE);
+ Datetime *tm= new (to) Datetime(thd, args[0], opt, 0);
+ null_value= !tm->is_valid_datetime();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
+bool Item_func_floor::time_op(THD *thd, MYSQL_TIME *to)
+{
+ static const Time::Options_for_round opt;
+ Time *tm= new (to) Time(thd, args[0], opt);
+ tm->floor();
+ null_value= !tm->is_valid_time();
+ DBUG_ASSERT(maybe_null || !null_value);
+ return null_value;
+}
+
+
void Item_func_round::fix_length_and_dec_decimal(uint decimals_to_set)
{
int decimals_delta= args[0]->decimals - decimals_to_set;
@@ -2467,8 +2516,27 @@ void Item_func_round::fix_arg_datetime()
}
-void Item_func_round::fix_arg_int()
+/**
+ Calculate data type and attributes for INT-alike input.
+
+ @param [IN] preferred - The preferred data type handler for simple cases
+ such as ROUND(x) and TRUNCATE(x,0), when the input
+ is short enough to fit into an integer type
+ (without extending to DECIMAL).
+ - If `preferred` is not NULL, then the code tries
+ to preserve the given data type handler and
+ the data type attributes `preferred_attrs`.
+ - If `preferred` is NULL, then the code fully
+ calculates attributes using
+ args[0]->decimal_precision() and chooses between
+ INT and BIGINT, depending on attributes.
+ @param [IN] preferred_attrs - The preferred data type attributes for
+ simple cases.
+*/
+void Item_func_round::fix_arg_int(const Type_handler *preferred,
+ const Type_std_attributes *preferred_attrs)
{
+ DBUG_ASSERT(args[0]->decimals == 0);
if (args[1]->const_item())
{
Longlong_hybrid val1= args[1]->to_longlong_hybrid();
@@ -2477,13 +2545,35 @@ void Item_func_round::fix_arg_int()
else if ((!val1.to_uint(DECIMAL_MAX_SCALE) && truncate) ||
args[0]->decimal_precision() < DECIMAL_LONGLONG_DIGITS)
{
+ // Here we can keep INT_RESULT
// Length can increase in some cases: ROUND(9,-1) -> 10
int length_can_increase= MY_TEST(!truncate && val1.neg());
- max_length= args[0]->max_length + length_can_increase;
- // Here we can keep INT_RESULT
- unsigned_flag= args[0]->unsigned_flag;
- decimals= 0;
- set_handler(type_handler_long_or_longlong());
+ if (preferred)
+ {
+ Type_std_attributes::set(preferred_attrs);
+ if (!length_can_increase)
+ {
+ // Preserve the exact data type and attributes
+ set_handler(preferred);
+ }
+ else
+ {
+ max_length++;
+ set_handler(type_handler_long_or_longlong());
+ }
+ }
+ else
+ {
+ /*
+ This branch is currently used for hex hybrid only.
+ It's known to be unsigned. So sign length is 0.
+ */
+ DBUG_ASSERT(args[0]->unsigned_flag); // no needs to add sign length
+ max_length= args[0]->decimal_precision() + length_can_increase;
+ unsigned_flag= true;
+ decimals= 0;
+ set_handler(type_handler_long_or_longlong());
+ }
}
else
fix_length_and_dec_decimal(val1.to_uint(DECIMAL_MAX_SCALE));
@@ -2610,9 +2700,7 @@ bool Item_func_round::time_op(THD *thd, MYSQL_TIME *to)
{
DBUG_ASSERT(args[0]->type_handler()->mysql_timestamp_type() ==
MYSQL_TIMESTAMP_TIME);
- Time::Options opt(Time::default_flags_for_get_date(),
- truncate ? TIME_FRAC_TRUNCATE : TIME_FRAC_ROUND,
- Time::DATETIME_TO_TIME_DISALLOW);
+ Time::Options_for_round opt(truncate ? TIME_FRAC_TRUNCATE : TIME_FRAC_ROUND);
Longlong_hybrid_null dec= args[1]->to_longlong_hybrid_null();
Time *tm= new (to) Time(thd, args[0], opt,
dec.to_uint(TIME_SECOND_PART_DIGITS));
diff --git a/sql/item_func.h b/sql/item_func.h
index 4922d20bd0c..07ee913b07d 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -450,6 +450,25 @@ public:
:Item_func(thd, item), Type_handler_hybrid_field_type(item) { }
const Type_handler *type_handler() const
{ return Type_handler_hybrid_field_type::type_handler(); }
+ void fix_length_and_dec_long_or_longlong(uint char_length, bool unsigned_arg)
+ {
+ collation= DTCollation_numeric();
+ unsigned_flag= unsigned_arg;
+ max_length= char_length;
+ set_handler(Type_handler::type_handler_long_or_longlong(char_length,
+ unsigned_arg));
+ }
+ void fix_length_and_dec_ulong_or_ulonglong_by_nbits(uint nbits)
+ {
+ uint digits= Type_handler_bit::Bit_decimal_notation_int_digits_by_nbits(nbits);
+ collation= DTCollation_numeric();
+ unsigned_flag= true;
+ max_length= digits;
+ if (nbits > 32)
+ set_handler(&type_handler_ulonglong);
+ else
+ set_handler(&type_handler_ulong);
+ }
};
@@ -1813,13 +1832,32 @@ public:
};
-class Item_func_int_val :public Item_func_num1
+class Item_func_int_val :public Item_func_hybrid_field_type
{
public:
- Item_func_int_val(THD *thd, Item *a): Item_func_num1(thd, a) {}
+ Item_func_int_val(THD *thd, Item *a): Item_func_hybrid_field_type(thd, a) {}
+ bool check_partition_func_processor(void *int_arg) { return FALSE; }
+ bool check_vcol_func_processor(void *arg) { return FALSE; }
void fix_length_and_dec_double();
void fix_length_and_dec_int_or_decimal();
+ void fix_length_and_dec_time()
+ {
+ fix_attributes_time(0);
+ set_handler(&type_handler_time2);
+ }
+ void fix_length_and_dec_datetime()
+ {
+ fix_attributes_datetime(0);
+ set_handler(&type_handler_datetime2);
+ maybe_null= true; // E.g. CEILING(TIMESTAMP'0000-01-01 23:59:59.9')
+ }
bool fix_length_and_dec();
+ String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
+ bool native_op(THD *thd, Native *to)
+ {
+ DBUG_ASSERT(0);
+ return true;
+ }
};
@@ -1831,6 +1869,8 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
+ bool time_op(THD *thd, MYSQL_TIME *ltime);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_ceiling>(thd, this); }
};
@@ -1844,6 +1884,8 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
+ bool time_op(THD *thd, MYSQL_TIME *ltime);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_floor>(thd, this); }
};
@@ -1875,14 +1917,19 @@ public:
return NULL;
}
void fix_arg_decimal();
- void fix_arg_int();
+ void fix_arg_int(const Type_handler *preferred,
+ const Type_std_attributes *preferred_attributes);
void fix_arg_double();
void fix_arg_time();
void fix_arg_datetime();
void fix_arg_temporal(const Type_handler *h, uint int_part_length);
bool fix_length_and_dec()
{
- return args[0]->type_handler()->Item_func_round_fix_length_and_dec(this);
+ /*
+ We don't want to translate ENUM/SET to CHAR here.
+ So let's real_type_handler(), not type_handler().
+ */
+ return args[0]->real_type_handler()->Item_func_round_fix_length_and_dec(this);
}
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_round>(thd, this); }
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 53fc7efac06..7bc34ee688c 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -449,7 +449,8 @@ static bool extract_date_time(THD *thd, DATE_TIME_FORMAT *format,
{
ErrConvString err(val_begin, length, &my_charset_bin);
make_truncated_value_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- &err, cached_timestamp_type, 0, NullS);
+ &err, cached_timestamp_type,
+ nullptr, nullptr, nullptr);
break;
}
} while (++val != val_end);
@@ -1576,7 +1577,7 @@ static void set_sec_part(ulong sec_part, MYSQL_TIME *ltime, Item *item)
{
ltime->second_part= sec_part;
if (item->decimals < TIME_SECOND_PART_DIGITS)
- my_time_trunc(ltime, item->decimals);
+ my_datetime_trunc(ltime, item->decimals);
}
}
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc
index 25e86c5d777..24c2ef5a2f2 100644
--- a/sql/item_windowfunc.cc
+++ b/sql/item_windowfunc.cc
@@ -556,12 +556,10 @@ void Item_window_func::print(String *str, enum_query_type query_type)
}
window_func()->print(str, query_type);
str->append(" over ");
-#ifndef DBUG_OFF
- if (!window_spec) // one can call dbug_print_item() anytime in gdb
+ if (!window_spec)
str->append(window_name);
else
-#endif
- window_spec->print(str, query_type);
+ window_spec->print(str, query_type);
}
void Item_window_func::print_for_percentile_functions(String *str, enum_query_type query_type)
{
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 94ac4be5427..99ef738ac69 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -651,7 +651,7 @@ class Item_sum_ntile : public Item_sum_int,
{
public:
Item_sum_ntile(THD* thd, Item* num_quantiles_expr) :
- Item_sum_int(thd, num_quantiles_expr)
+ Item_sum_int(thd, num_quantiles_expr), n_old_val_(0)
{ }
longlong val_int()
@@ -664,11 +664,13 @@ class Item_sum_ntile : public Item_sum_int,
longlong num_quantiles= get_num_quantiles();
- if (num_quantiles <= 0) {
+ if (num_quantiles <= 0 ||
+ (static_cast<ulonglong>(num_quantiles) != n_old_val_ && n_old_val_ > 0))
+ {
my_error(ER_INVALID_NTILE_ARGUMENT, MYF(0));
return true;
}
-
+ n_old_val_= static_cast<ulonglong>(num_quantiles);
null_value= false;
ulonglong quantile_size = get_row_count() / num_quantiles;
ulonglong extra_rows = get_row_count() - quantile_size * num_quantiles;
@@ -694,6 +696,7 @@ class Item_sum_ntile : public Item_sum_int,
{
current_row_count_= 0;
partition_row_count_= 0;
+ n_old_val_= 0;
}
const char*func_name() const
@@ -717,6 +720,7 @@ class Item_sum_ntile : public Item_sum_int,
private:
longlong get_num_quantiles() { return args[0]->val_int(); }
+ ulonglong n_old_val_;
};
class Item_sum_percentile_disc : public Item_sum_num,
diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
index c53a2b53769..bdc42885312 100644
--- a/sql/log_event_client.cc
+++ b/sql/log_event_client.cc
@@ -2036,8 +2036,7 @@ bool Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
}
else if (strcmp("COMMIT", query) == 0)
{
- if (my_b_write(&cache, (uchar*) "BEGIN", 5) ||
- my_b_printf(&cache, "\n%s\n", print_event_info->delimiter))
+ if (my_b_printf(&cache, "START TRANSACTION\n%s\n", print_event_info->delimiter))
goto err;
}
}
@@ -2396,7 +2395,7 @@ bool Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
my_b_printf(&cache, "\tXid = %s\n", buf))
goto err;
}
- if (my_b_printf(&cache, is_flashback ? "BEGIN%s\n" : "COMMIT%s\n",
+ if (my_b_printf(&cache, is_flashback ? "START TRANSACTION%s\n" : "COMMIT%s\n",
print_event_info->delimiter))
goto err;
@@ -3899,8 +3898,8 @@ Gtid_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
}
else if (!(flags2 & FL_STANDALONE))
{
- if (my_b_printf(&cache, is_flashback ? "COMMIT\n%s\n" : "BEGIN\n%s\n",
- print_event_info->delimiter))
+ if (my_b_printf(&cache, is_flashback ? "COMMIT\n%s\n" :
+ "START TRANSACTION\n%s\n", print_event_info->delimiter))
goto err;
}
diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc
index fb75bee9f21..49e818b3b97 100644
--- a/sql/log_event_server.cc
+++ b/sql/log_event_server.cc
@@ -8029,7 +8029,6 @@ end:
if (is_table_scan || is_index_scan)
issue_long_find_row_warning(get_general_type_code(), m_table->alias.c_ptr(),
is_index_scan, rgi);
- table->default_column_bitmaps();
DBUG_RETURN(error);
}
@@ -8264,7 +8263,13 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
#endif /* WSREP_PROC_INFO */
thd_proc_info(thd, message);
- int error= find_row(rgi);
+ // Temporary fix to find out why it fails [/Matz]
+ memcpy(m_table->read_set->bitmap, m_cols.bitmap, (m_table->read_set->n_bits + 7) / 8);
+ memcpy(m_table->write_set->bitmap, m_cols_ai.bitmap, (m_table->write_set->n_bits + 7) / 8);
+
+ m_table->mark_columns_per_binlog_row_image();
+
+ int error= find_row(rgi);
if (unlikely(error))
{
/*
@@ -8334,11 +8339,6 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
goto err;
}
- // Temporary fix to find out why it fails [/Matz]
- memcpy(m_table->read_set->bitmap, m_cols.bitmap, (m_table->read_set->n_bits + 7) / 8);
- memcpy(m_table->write_set->bitmap, m_cols_ai.bitmap, (m_table->write_set->n_bits + 7) / 8);
-
- m_table->mark_columns_per_binlog_row_image();
if (m_vers_from_plain && m_table->versioned(VERS_TIMESTAMP))
m_table->vers_update_fields();
error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]);
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 3e173a47f02..ebd92a0e45a 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -45,6 +45,7 @@
#include <violite.h>
#include <signal.h>
#include "probes_mysql.h"
+#include <debug_sync.h>
#include "proxy_protocol.h"
PSI_memory_key key_memory_NET_buff;
@@ -494,6 +495,17 @@ net_write_command(NET *net,uchar command,
DBUG_ENTER("net_write_command");
DBUG_PRINT("enter",("length: %lu", (ulong) len));
+ DBUG_EXECUTE_IF("simulate_error_on_packet_write",
+ {
+ if (command == COM_BINLOG_DUMP)
+ {
+ net->last_errno = ER_NET_ERROR_ON_WRITE;
+ DBUG_ASSERT(!debug_sync_set_action(
+ (THD *)net->thd,
+ STRING_WITH_LEN("now SIGNAL parked WAIT_FOR continue")));
+ DBUG_RETURN(true);
+ }
+ };);
MYSQL_NET_WRITE_START(length);
buff[4]=command; /* For first packet */
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 10f82242bca..8ad14ca260c 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2006, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2018, MariaDB Corporation.
+ Copyright (c) 2010, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -864,9 +864,6 @@ void partition_info::vers_set_hist_part(THD *thd)
if (next->range_value > thd->query_start())
return;
}
- my_error(WARN_VERS_PART_FULL, MYF(ME_WARNING|ME_ERROR_LOG),
- table->s->db.str, table->s->table_name.str,
- vers_info->hist_part->partition_name, "INTERVAL");
}
}
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 5c287cff9e9..c6e2339c0d0 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -1579,7 +1579,7 @@ bool Protocol_binary::store(MYSQL_TIME *tm, int decimals)
DBUG_ASSERT(decimals == AUTO_SEC_PART_DIGITS ||
(decimals >= 0 && decimals <= TIME_SECOND_PART_DIGITS));
if (decimals != AUTO_SEC_PART_DIGITS)
- my_time_trunc(tm, decimals);
+ my_datetime_trunc(tm, decimals);
int4store(pos+7, tm->second_part);
if (tm->second_part)
length=11;
diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc
index 4cee6cb0dfa..1e5e356a5ba 100644
--- a/sql/session_tracker.cc
+++ b/sql/session_tracker.cc
@@ -189,7 +189,13 @@ bool sysvartrack_validate_value(THD *thd, const char *str, size_t len)
char *token, *lasts= NULL;
size_t rest= var_list.length;
- if (!var_list.str || var_list.length == 0 ||
+ if (!var_list.str)
+ {
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0),
+ "session_track_system_variables", "NULL");
+ return false;
+ }
+ if (var_list.length == 0 ||
!strcmp(var_list.str, "*"))
{
return false;
diff --git a/sql/slave.cc b/sql/slave.cc
index bd3bab224d3..cf94f1dc0b5 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3728,7 +3728,8 @@ static int request_dump(THD *thd, MYSQL* mysql, Master_info* mi,
in the future, we should do a better error analysis, but for
now we just fill up the error log :-)
*/
- if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
+ if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED ||
+ mysql_errno(mysql) == ER_NET_ERROR_ON_WRITE)
*suppress_warnings= TRUE; // Suppress reconnect warning
else
sql_print_error("Error on COM_BINLOG_DUMP: %d %s, will retry in %d secs",
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index d94016b7815..9cc35d0707f 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -800,6 +800,15 @@ class Grant_table_base
bool init_read_record(READ_RECORD* info) const
{
DBUG_ASSERT(m_table);
+
+ if (num_fields() < min_columns)
+ {
+ my_printf_error(ER_UNKNOWN_ERROR, "Fatal error: mysql.%s table is "
+ "damaged or in unsupported 3.20 format",
+ MYF(ME_ERROR_LOG), m_table->s->table_name.str);
+ return 1;
+ }
+
bool result= ::init_read_record(info, m_table->in_use, m_table,
NULL, NULL, 1, true, false);
if (!result)
@@ -824,7 +833,7 @@ class Grant_table_base
protected:
friend class Grant_tables;
- Grant_table_base() : start_priv_columns(0), end_priv_columns(0), m_table(0)
+ Grant_table_base() : min_columns(3), start_priv_columns(0), end_priv_columns(0), m_table(0)
{ }
/* Compute how many privilege columns this table has. This method
@@ -853,6 +862,9 @@ class Grant_table_base
}
}
+
+ /* the min number of columns a table should have */
+ uint min_columns;
/* The index at which privilege columns start. */
uint start_priv_columns;
/* The index after the last privilege column */
@@ -1266,7 +1278,7 @@ class User_table_tabular: public User_table
friend class Grant_tables;
/* Only Grant_tables can instantiate this class. */
- User_table_tabular() {}
+ User_table_tabular() { min_columns= 13; /* As in 3.20.13 */ }
/* The user table is a bit different compared to the other Grant tables.
Usually, we only add columns to the grant tables when adding functionality.
@@ -1288,13 +1300,6 @@ class User_table_tabular: public User_table
int setup_sysvars() const
{
- if (num_fields() < 13) // number of columns in 3.21
- {
- sql_print_error("Fatal error: mysql.user table is damaged or in "
- "unsupported 3.20 format.");
- return 1;
- }
-
username_char_length= MY_MIN(m_table->field[1]->char_length(),
USERNAME_CHAR_LENGTH);
using_global_priv_table= false;
@@ -1806,7 +1811,7 @@ class Db_table: public Grant_table_base
private:
friend class Grant_tables;
- Db_table() {}
+ Db_table() { min_columns= 9; /* as in 3.20.13 */ }
};
class Tables_priv_table: public Grant_table_base
@@ -1824,7 +1829,7 @@ class Tables_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Tables_priv_table() {}
+ Tables_priv_table() { min_columns= 8; /* as in 3.22.26a */ }
};
class Columns_priv_table: public Grant_table_base
@@ -1841,7 +1846,7 @@ class Columns_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Columns_priv_table() {}
+ Columns_priv_table() { min_columns= 7; /* as in 3.22.26a */ }
};
class Host_table: public Grant_table_base
@@ -1853,7 +1858,7 @@ class Host_table: public Grant_table_base
private:
friend class Grant_tables;
- Host_table() {}
+ Host_table() { min_columns= 8; /* as in 3.20.13 */ }
};
class Procs_priv_table: public Grant_table_base
@@ -1871,7 +1876,7 @@ class Procs_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Procs_priv_table() {}
+ Procs_priv_table() { min_columns=8; }
};
class Proxies_priv_table: public Grant_table_base
@@ -1888,7 +1893,7 @@ class Proxies_priv_table: public Grant_table_base
private:
friend class Grant_tables;
- Proxies_priv_table() {}
+ Proxies_priv_table() { min_columns= 7; }
};
class Roles_mapping_table: public Grant_table_base
@@ -1902,7 +1907,7 @@ class Roles_mapping_table: public Grant_table_base
private:
friend class Grant_tables;
- Roles_mapping_table() {}
+ Roles_mapping_table() { min_columns= 4; }
};
/**
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index a1d235086db..ede30263e48 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- Copyright (c) 2016, 2018, MariaDB Corporation
+ Copyright (c) 2016, 2020, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -129,10 +129,10 @@ const char* Alter_info::lock() const
}
-bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result,
+bool Alter_info::supports_algorithm(THD *thd,
const Alter_inplace_info *ha_alter_info)
{
- switch (result) {
+ switch (ha_alter_info->inplace_supported) {
case HA_ALTER_INPLACE_EXCLUSIVE_LOCK:
case HA_ALTER_INPLACE_SHARED_LOCK:
case HA_ALTER_INPLACE_NO_LOCK:
@@ -173,10 +173,10 @@ bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result,
}
-bool Alter_info::supports_lock(THD *thd, enum_alter_inplace_result result,
+bool Alter_info::supports_lock(THD *thd,
const Alter_inplace_info *ha_alter_info)
{
- switch (result) {
+ switch (ha_alter_info->inplace_supported) {
case HA_ALTER_INPLACE_EXCLUSIVE_LOCK:
// If SHARED lock and no particular algorithm was requested, use COPY.
if (requested_lock == Alter_info::ALTER_TABLE_LOCK_SHARED &&
@@ -377,7 +377,9 @@ void Alter_table_ctx::report_implicit_default_value_error(THD *thd,
thd->push_warning_truncated_value_for_field(Sql_condition::WARN_LEVEL_WARN,
h->name().ptr(),
h->default_value().ptr(),
- s, error_field->field_name.str);
+ s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ error_field->field_name.str);
}
diff --git a/sql/sql_alter.h b/sql/sql_alter.h
index ca343f36569..89eb4ebb3e9 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates.
- Copyright (c) 2013, 2018, MariaDB Corporation.
+ Copyright (c) 2013, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -203,29 +203,26 @@ public:
with the specified user alter algorithm.
@param thd Thread handle
- @param result Operation supported for inplace alter
@param ha_alter_info Structure describing changes to be done
by ALTER TABLE and holding data during
in-place alter
@retval false Supported operation
@retval true Not supported value
*/
- bool supports_algorithm(THD *thd, enum_alter_inplace_result result,
+ bool supports_algorithm(THD *thd,
const Alter_inplace_info *ha_alter_info);
/**
Check whether the given result can be supported
with the specified user lock type.
- @param result Operation supported for inplace alter
@param ha_alter_info Structure describing changes to be done
by ALTER TABLE and holding data during
in-place alter
@retval false Supported lock type
@retval true Not supported value
*/
- bool supports_lock(THD *thd, enum_alter_inplace_result result,
- const Alter_inplace_info *ha_alter_info);
+ bool supports_lock(THD *thd, const Alter_inplace_info *ha_alter_info);
/**
Return user requested algorithm. If user does not specify
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index c85c2b6449a..45ce4be3eb5 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -5332,6 +5332,24 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table_list)
DBUG_VOID_RETURN;
}
+int TABLE::fix_vcol_exprs(THD *thd)
+{
+ for (Field **vf= vfield; vf && *vf; vf++)
+ if (fix_session_vcol_expr(thd, (*vf)->vcol_info))
+ return 1;
+
+ for (Field **df= default_field; df && *df; df++)
+ if ((*df)->default_value &&
+ fix_session_vcol_expr(thd, (*df)->default_value))
+ return 1;
+
+ for (Virtual_column_info **cc= check_constraints; cc && *cc; cc++)
+ if (fix_session_vcol_expr(thd, (*cc)))
+ return 1;
+
+ return 0;
+}
+
static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables)
{
@@ -5339,36 +5357,27 @@ static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables)
TABLE_LIST *first_not_own= thd->lex->first_not_own_table();
DBUG_ENTER("fix_session_vcol_expr");
- for (TABLE_LIST *table= tables; table && table != first_not_own;
+ int error= 0;
+ for (TABLE_LIST *table= tables; table && table != first_not_own && !error;
table= table->next_global)
{
TABLE *t= table->table;
if (!table->placeholder() && t->s->vcols_need_refixing &&
table->lock_type >= TL_WRITE_ALLOW_WRITE)
{
+ Query_arena *stmt_backup= thd->stmt_arena;
+ if (thd->stmt_arena->is_conventional())
+ thd->stmt_arena= t->expr_arena;
if (table->security_ctx)
thd->security_ctx= table->security_ctx;
- for (Field **vf= t->vfield; vf && *vf; vf++)
- if (fix_session_vcol_expr(thd, (*vf)->vcol_info))
- goto err;
-
- for (Field **df= t->default_field; df && *df; df++)
- if ((*df)->default_value &&
- fix_session_vcol_expr(thd, (*df)->default_value))
- goto err;
-
- for (Virtual_column_info **cc= t->check_constraints; cc && *cc; cc++)
- if (fix_session_vcol_expr(thd, (*cc)))
- goto err;
+ error= t->fix_vcol_exprs(thd);
thd->security_ctx= save_security_ctx;
+ thd->stmt_arena= stmt_backup;
}
}
- DBUG_RETURN(0);
-err:
- thd->security_ctx= save_security_ctx;
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index a900e485cd7..af0035e9003 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3754,7 +3754,6 @@ void select_dumpvar::cleanup()
Query_arena::Type Query_arena::type() const
{
- DBUG_ASSERT(0); /* Should never be called */
return STATEMENT;
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 08e5af289f3..ab188c18735 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1100,7 +1100,7 @@ public:
/* We build without RTTI, so dynamic_cast can't be used. */
enum Type
{
- STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE
+ STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE, TABLE_ARENA
};
Query_arena(MEM_ROOT *mem_root_arg, enum enum_state state_arg) :
@@ -4086,13 +4086,20 @@ public:
return 0;
}
+
+ bool is_item_tree_change_register_required()
+ {
+ return !stmt_arena->is_conventional()
+ || stmt_arena->type() == Query_arena::TABLE_ARENA;
+ }
+
void change_item_tree(Item **place, Item *new_value)
{
DBUG_ENTER("THD::change_item_tree");
DBUG_PRINT("enter", ("Register: %p (%p) <- %p",
*place, place, new_value));
/* TODO: check for OOM condition here */
- if (!stmt_arena->is_conventional())
+ if (is_item_tree_change_register_required())
nocheck_register_item_tree_change(place, *place, mem_root);
*place= new_value;
DBUG_VOID_RETURN;
@@ -4588,14 +4595,13 @@ public:
void push_warning_truncated_value_for_field(Sql_condition::enum_warning_level
level, const char *type_str,
const char *val,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *name)
{
DBUG_ASSERT(name);
char buff[MYSQL_ERRMSG_SIZE];
CHARSET_INFO *cs= &my_charset_latin1;
- const char *db_name= s ? s->db.str : NULL;
- const char *table_name= s ? s->table_name.str : NULL;
if (!db_name)
db_name= "";
@@ -4612,12 +4618,13 @@ public:
bool totally_useless_value,
const char *type_str,
const char *val,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *field_name)
{
if (field_name)
push_warning_truncated_value_for_field(level, type_str, val,
- s, field_name);
+ db_name, table_name, field_name);
else if (totally_useless_value)
push_warning_wrong_value(level, type_str, val);
else
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 913379a4054..baec470c471 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -6787,6 +6787,7 @@ bool LEX::sp_for_loop_cursor_declarations(THD *thd,
LEX_CSTRING name;
uint coffs, param_count= 0;
const sp_pcursor *pcursor;
+ DBUG_ENTER("LEX::sp_for_loop_cursor_declarations");
if ((item_splocal= item->get_item_splocal()))
name= item_splocal->m_name;
@@ -6818,23 +6819,23 @@ bool LEX::sp_for_loop_cursor_declarations(THD *thd,
else
{
thd->parse_error();
- return true;
+ DBUG_RETURN(true);
}
if (unlikely(!(pcursor= spcont->find_cursor_with_error(&name, &coffs,
false)) ||
pcursor->check_param_count_with_error(param_count)))
- return true;
+ DBUG_RETURN(true);
if (!(loop->m_index= sp_add_for_loop_cursor_variable(thd, index,
pcursor, coffs,
bounds.m_index,
item_func_sp)))
- return true;
+ DBUG_RETURN(true);
loop->m_target_bound= NULL;
loop->m_direction= bounds.m_direction;
loop->m_cursor_offset= coffs;
loop->m_implicit_cursor= bounds.m_implicit_cursor;
- return false;
+ DBUG_RETURN(false);
}
@@ -8188,6 +8189,7 @@ Item *LEX::create_item_ident_sp(THD *thd, Lex_ident_sys_st *name,
const Sp_rcontext_handler *rh;
sp_variable *spv;
+ uint unused_off;
DBUG_ASSERT(spcont);
DBUG_ASSERT(sphead);
if ((spv= find_variable(name, &rh)))
@@ -8226,7 +8228,9 @@ Item *LEX::create_item_ident_sp(THD *thd, Lex_ident_sys_st *name,
return new (thd->mem_root) Item_func_sqlerrm(thd);
}
- if (!current_select)
+ if (!select_stack_head() &&
+ (current_select->parsing_place != FOR_LOOP_BOUND ||
+ spcont->find_cursor(name, &unused_off, false) == NULL))
{
// we are out of SELECT or FOR so it is syntax error
my_error(ER_SP_UNDECLARED_VAR, MYF(0), name->str);
@@ -9722,7 +9726,8 @@ Item *LEX::create_item_query_expression(THD *thd,
// Add the subtree of subquery to the current SELECT_LEX
SELECT_LEX *curr_sel= select_stack_head();
- DBUG_ASSERT(current_select == curr_sel);
+ DBUG_ASSERT(current_select == curr_sel ||
+ (curr_sel == NULL && current_select == &builtin_select));
if (!curr_sel)
{
curr_sel= &builtin_select;
@@ -9965,7 +9970,8 @@ SELECT_LEX *LEX::parsed_subselect(SELECT_LEX_UNIT *unit)
// Add the subtree of subquery to the current SELECT_LEX
SELECT_LEX *curr_sel= select_stack_head();
- DBUG_ASSERT(current_select == curr_sel);
+ DBUG_ASSERT(current_select == curr_sel ||
+ (curr_sel == NULL && current_select == &builtin_select));
if (curr_sel)
{
curr_sel->register_unit(unit, &curr_sel->context);
@@ -10041,7 +10047,8 @@ TABLE_LIST *LEX::parsed_derived_table(SELECT_LEX_UNIT *unit,
// Add the subtree of subquery to the current SELECT_LEX
SELECT_LEX *curr_sel= select_stack_head();
- DBUG_ASSERT(current_select == curr_sel);
+ DBUG_ASSERT(current_select == curr_sel ||
+ (curr_sel == NULL && current_select == &builtin_select));
Table_ident *ti= new (thd->mem_root) Table_ident(unit);
if (ti == NULL)
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index c2cabe4cb36..92d4ec42c8f 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -3698,8 +3698,9 @@ public:
if (unlikely(!select_stack_top))
{
- current_select= NULL;
- DBUG_PRINT("info", ("Top Select is empty"));
+ current_select= &builtin_select;
+ DBUG_PRINT("info", ("Top Select is empty -> sel builtin: %p",
+ current_select));
}
else
current_select= select_stack[select_stack_top - 1];
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index d3c7b27cbd3..6862610537a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1276,6 +1276,7 @@ bool do_command(THD *thd)
command= fetch_command(thd, packet);
#ifdef WITH_WSREP
+ DEBUG_SYNC(thd, "wsrep_before_before_command");
/*
Aborted by background rollbacker thread.
Handle error here and jump straight to out
@@ -8013,8 +8014,8 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
sp_cache_enforce_limit(thd->sp_package_spec_cache, stored_program_cache_size);
sp_cache_enforce_limit(thd->sp_package_body_cache, stored_program_cache_size);
thd->end_statement();
+ thd->Item_change_list::rollback_item_tree_changes();
thd->cleanup_after_query();
- DBUG_ASSERT(thd->Item_change_list::is_empty());
}
else
{
@@ -9116,7 +9117,6 @@ my_bool find_thread_callback(THD *thd, find_thread_callback_arg *arg)
if (thd->get_command() != COM_DAEMON &&
arg->id == (arg->query_id ? thd->query_id : (longlong) thd->thread_id))
{
- if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data);
mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete
arg->thd= thd;
return 1;
@@ -9132,6 +9132,26 @@ THD *find_thread_by_id(longlong id, bool query_id)
return arg.thd;
}
+#ifdef WITH_WSREP
+my_bool find_thread_with_thd_data_lock_callback(THD *thd, find_thread_callback_arg *arg)
+{
+ if (thd->get_command() != COM_DAEMON &&
+ arg->id == (arg->query_id ? thd->query_id : (longlong) thd->thread_id))
+ {
+ if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data);
+ mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete
+ arg->thd= thd;
+ return 1;
+ }
+ return 0;
+}
+THD *find_thread_by_id_with_thd_data_lock(longlong id, bool query_id)
+{
+ find_thread_callback_arg arg(id, query_id);
+ server_threads.iterate(find_thread_with_thd_data_lock_callback, &arg);
+ return arg.thd;
+}
+#endif
/**
kill one thread.
@@ -9149,7 +9169,11 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD);
DBUG_ENTER("kill_one_thread");
DBUG_PRINT("enter", ("id: %lld signal: %u", id, (uint) kill_signal));
+#ifdef WITH_WSREP
+ if (id && (tmp= find_thread_by_id_with_thd_data_lock(id, type == KILL_TYPE_QUERY)))
+#else
if (id && (tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY)))
+#endif
{
/*
If we're SUPER, we can KILL anything, including system-threads.
@@ -9203,8 +9227,9 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
else
error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR :
ER_KILL_DENIED_ERROR);
-
+#ifdef WITH_WSREP
if (WSREP(tmp)) mysql_mutex_unlock(&tmp->LOCK_thd_data);
+#endif
mysql_mutex_unlock(&tmp->LOCK_thd_kill);
}
DBUG_PRINT("exit", ("%d", error));
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 4526cac5af1..633d969b3de 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2018, Oracle and/or its affiliates.
- Copyright (c) 2010, 2020, MariaDB Corporation
+ Copyright (c) 2010, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1831,6 +1831,8 @@ static void plugin_load(MEM_ROOT *tmp_root)
int error;
THD *new_thd= new THD(0);
bool result;
+ unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
+ { MYSQL_AUDIT_GENERAL_CLASSMASK };
DBUG_ENTER("plugin_load");
if (global_system_variables.log_warnings >= 9)
@@ -1882,6 +1884,31 @@ static void plugin_load(MEM_ROOT *tmp_root)
continue;
/*
+ Pre-acquire audit plugins for events that may potentially occur
+ during [UN]INSTALL PLUGIN.
+
+ When audit event is triggered, audit subsystem acquires interested
+ plugins by walking through plugin list. Evidently plugin list
+ iterator protects plugin list by acquiring LOCK_plugin, see
+ plugin_foreach_with_mask().
+
+ On the other hand plugin_load is acquiring LOCK_plugin
+ rather for a long time.
+
+ When audit event is triggered during plugin_load plugin
+ list iterator acquires the same lock (within the same thread)
+ second time.
+
+ This hack should be removed when LOCK_plugin is fixed so it
+ protects only what it supposed to protect.
+
+ See also mysql_install_plugin(), mysql_uninstall_plugin() and
+ initialize_audit_plugin()
+ */
+ if (mysql_audit_general_enabled())
+ mysql_audit_acquire_plugins(new_thd, event_class_mask);
+
+ /*
there're no other threads running yet, so we don't need a mutex.
but plugin_add() before is designed to work in multi-threaded
environment, and it uses mysql_mutex_assert_owner(), so we lock
@@ -2281,27 +2308,30 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_CSTRING *name)
if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)) ||
plugin->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_DYING))
{
- myf MyFlags= thd->lex->if_exists() ? ME_NOTE : 0;
- my_error(ER_SP_DOES_NOT_EXIST, MyFlags, "PLUGIN", name->str);
- return !MyFlags;
- }
- if (!plugin->plugin_dl)
- {
- my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0));
- return 1;
+ // maybe plugin is present in mysql.plugin; postpone the error
+ plugin= nullptr;
}
- if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
+
+ if (plugin)
{
- my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
- return 1;
- }
+ if (!plugin->plugin_dl)
+ {
+ my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0));
+ return 1;
+ }
+ if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
+ {
+ my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
+ return 1;
+ }
- plugin->state= PLUGIN_IS_DELETED;
- if (plugin->ref_count)
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY));
- else
- reap_needed= true;
+ plugin->state= PLUGIN_IS_DELETED;
+ if (plugin->ref_count)
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
+ WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY));
+ else
+ reap_needed= true;
+ }
uchar user_key[MAX_KEY_LENGTH];
table->use_all_columns();
@@ -2325,6 +2355,12 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_CSTRING *name)
return 1;
}
}
+ else if (!plugin)
+ {
+ const myf MyFlags= thd->lex->if_exists() ? ME_NOTE : 0;
+ my_error(ER_SP_DOES_NOT_EXIST, MyFlags, "PLUGIN", name->str);
+ return !MyFlags;
+ }
return 0;
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 913497b097a..bf531fe4d7d 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -5353,7 +5353,7 @@ bool Protocol_local::store_str(const char *str, size_t length,
bool Protocol_local::store(MYSQL_TIME *time, int decimals)
{
if (decimals != AUTO_SEC_PART_DIGITS)
- my_time_trunc(time, decimals);
+ my_datetime_trunc(time, decimals);
return store_column(time, sizeof(MYSQL_TIME));
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 87257bc9ab4..8834c4d26e9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7804,7 +7804,6 @@ static bool is_inplace_alter_impossible(TABLE *table,
@param ha_alter_info Structure describing ALTER TABLE to be carried
out and serving as a storage place for data
used during different phases.
- @param inplace_supported Enum describing the locking requirements.
@param target_mdl_request Metadata request/lock on the target table name.
@param alter_ctx ALTER TABLE runtime context.
@@ -7829,7 +7828,6 @@ static bool mysql_inplace_alter_table(THD *thd,
TABLE *table,
TABLE *altered_table,
Alter_inplace_info *ha_alter_info,
- enum_alter_inplace_result inplace_supported,
MDL_request *target_mdl_request,
Alter_table_ctx *alter_ctx)
{
@@ -7839,6 +7837,10 @@ static bool mysql_inplace_alter_table(THD *thd,
bool reopen_tables= false;
bool res;
handlerton *hton;
+
+ const enum_alter_inplace_result inplace_supported=
+ ha_alter_info->inplace_supported;
+
DBUG_ENTER("mysql_inplace_alter_table");
/* Downgrade DDL lock while we are waiting for exclusive lock below */
@@ -10521,27 +10523,31 @@ do_continue:;
if (alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_NONE)
ha_alter_info.online= true;
// Ask storage engine whether to use copy or in-place
- enum_alter_inplace_result inplace_supported=
+ ha_alter_info.inplace_supported=
table->file->check_if_supported_inplace_alter(&altered_table,
&ha_alter_info);
-
- Key *k;
- for (List_iterator<Key> it(alter_info->key_list);
- (k= it++) && inplace_supported != HA_ALTER_INPLACE_NOT_SUPPORTED;)
+ if (ha_alter_info.inplace_supported != HA_ALTER_INPLACE_NOT_SUPPORTED)
{
- if(k->without_overlaps)
- inplace_supported= HA_ALTER_INPLACE_NOT_SUPPORTED;
+ List_iterator<Key> it(alter_info->key_list);
+ while (Key *k= it++)
+ {
+ if (k->without_overlaps)
+ {
+ ha_alter_info.inplace_supported= HA_ALTER_INPLACE_NOT_SUPPORTED;
+ break;
+ }
+ }
}
- if (alter_info->supports_algorithm(thd, inplace_supported, &ha_alter_info) ||
- alter_info->supports_lock(thd, inplace_supported, &ha_alter_info))
+ if (alter_info->supports_algorithm(thd, &ha_alter_info) ||
+ alter_info->supports_lock(thd, &ha_alter_info))
{
cleanup_table_after_inplace_alter(&altered_table);
goto err_new_table_cleanup;
}
// If SHARED lock and no particular algorithm was requested, use COPY.
- if (inplace_supported == HA_ALTER_INPLACE_EXCLUSIVE_LOCK &&
+ if (ha_alter_info.inplace_supported == HA_ALTER_INPLACE_EXCLUSIVE_LOCK &&
alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_SHARED &&
alter_info->algorithm(thd) ==
Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT &&
@@ -10549,7 +10555,7 @@ do_continue:;
Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT)
use_inplace= false;
- if (inplace_supported == HA_ALTER_INPLACE_NOT_SUPPORTED)
+ if (ha_alter_info.inplace_supported == HA_ALTER_INPLACE_NOT_SUPPORTED)
use_inplace= false;
if (use_inplace)
@@ -10562,7 +10568,7 @@ do_continue:;
*/
thd->count_cuted_fields = CHECK_FIELD_WARN;
int res= mysql_inplace_alter_table(thd, table_list, table, &altered_table,
- &ha_alter_info, inplace_supported,
+ &ha_alter_info,
&target_mdl_request, &alter_ctx);
thd->count_cuted_fields= save_count_cuted_fields;
my_free(const_cast<uchar*>(frm.str));
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index c08e54bed87..8bb96dfa776 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -18,7 +18,6 @@
/* Functions to handle date and time */
#include "mariadb.h"
-#include "sql_priv.h"
#include "sql_time.h"
#include "tztime.h" // struct Time_zone
#include "sql_class.h" // THD
@@ -297,7 +296,7 @@ check_date_with_warn(THD *thd, const MYSQL_TIME *ltime,
{
ErrConvTime str(ltime);
make_truncated_value_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- &str, ts_type, 0, 0);
+ &str, ts_type, nullptr, nullptr, nullptr);
return true;
}
return false;
@@ -431,7 +430,7 @@ str_to_datetime_with_warn(THD *thd, CHARSET_INFO *cs,
const char *str, size_t length, MYSQL_TIME *to,
date_mode_t mode)
{
- Temporal::Warn_push warn(thd, NULL, NullS, to, mode);
+ Temporal::Warn_push warn(thd, nullptr, nullptr, nullptr, to, mode);
Temporal_hybrid *t= new(to) Temporal_hybrid(thd, &warn, str, length, cs, mode);
return !t->is_valid_temporal();
}
@@ -441,7 +440,9 @@ bool double_to_datetime_with_warn(THD *thd, double value, MYSQL_TIME *ltime,
date_mode_t fuzzydate,
const TABLE_SHARE *s, const char *field_name)
{
- Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate);
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name, ltime, fuzzydate);
Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, value, fuzzydate);
return !t->is_valid_temporal();
}
@@ -452,7 +453,9 @@ bool decimal_to_datetime_with_warn(THD *thd, const my_decimal *value,
date_mode_t fuzzydate,
const TABLE_SHARE *s, const char *field_name)
{
- Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate);
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name, ltime, fuzzydate);
Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, value, fuzzydate);
return !t->is_valid_temporal();
}
@@ -467,7 +470,9 @@ bool int_to_datetime_with_warn(THD *thd, const Longlong_hybrid &nr,
Note: conversion from an integer to TIME can overflow to '838:59:59.999999',
so the conversion result can have fractional digits.
*/
- Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate);
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
+ field_name, ltime, fuzzydate);
Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, nr, fuzzydate);
return !t->is_valid_temporal();
}
@@ -896,12 +901,13 @@ void make_truncated_value_warning(THD *thd,
Sql_condition::enum_warning_level level,
const ErrConv *sval,
timestamp_type time_type,
- const TABLE_SHARE *s, const char *field_name)
+ const char *db_name, const char *table_name,
+ const char *field_name)
{
const char *type_str= Temporal::type_name_by_timestamp_type(time_type);
return thd->push_warning_wrong_or_truncated_value
(level, time_type <= MYSQL_TIMESTAMP_ERROR, type_str, sval->ptr(),
- s, field_name);
+ db_name, table_name, field_name);
}
diff --git a/sql/sql_time.h b/sql/sql_time.h
index fe9697adf67..c918eb6d807 100644
--- a/sql/sql_time.h
+++ b/sql/sql_time.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates.
- Copyright (c) 2011, 2016, MariaDB
+ Copyright (c) 2011, 2020, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -78,7 +78,7 @@ void make_truncated_value_warning(THD *thd,
Sql_condition::enum_warning_level level,
const ErrConv *str_val,
timestamp_type time_type,
- const TABLE_SHARE *s,
+ const char *db_name, const char *table_name,
const char *field_name);
extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 7345b1fb529..bce65e494d3 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -507,17 +507,21 @@ bool Sec6::convert_to_mysql_time(THD *thd, int *warn, MYSQL_TIME *ltime,
void Temporal::push_conversion_warnings(THD *thd, bool totally_useless_value,
int warn,
const char *typestr,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *field_name,
const char *value)
{
if (MYSQL_TIME_WARN_HAVE_WARNINGS(warn))
thd->push_warning_wrong_or_truncated_value(Sql_condition::WARN_LEVEL_WARN,
totally_useless_value,
- typestr, value, s, field_name);
+ typestr, value,
+ db_name, table_name,
+ field_name);
else if (MYSQL_TIME_WARN_HAVE_NOTES(warn))
thd->push_warning_wrong_or_truncated_value(Sql_condition::WARN_LEVEL_NOTE,
- false, typestr, value, s,
+ false, typestr, value,
+ db_name, table_name,
field_name);
}
@@ -1092,7 +1096,7 @@ bool Temporal::datetime_round_or_invalidate(THD *thd, uint dec, int *warn, ulong
DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
if (datetime_add_nanoseconds_or_invalidate(thd, warn, nsec))
return true;
- my_time_trunc(this, dec);
+ my_datetime_trunc(this, dec);
return false;
}
@@ -4069,7 +4073,7 @@ uint32
Type_handler_bit::Item_decimal_notation_int_digits(const Item *item)
const
{
- return Bit_decimal_notation_int_digits(item);
+ return Bit_decimal_notation_int_digits_by_nbits(item->max_length);
}
@@ -4087,9 +4091,23 @@ Type_handler_general_purpose_int::Item_decimal_notation_int_digits(
a divisor.
*/
uint32
-Type_handler_bit::Bit_decimal_notation_int_digits(const Item *item)
-{
- return item->max_length/3+1;
+Type_handler_bit::Bit_decimal_notation_int_digits_by_nbits(uint nbits)
+{
+ DBUG_ASSERT(nbits > 0);
+ DBUG_ASSERT(nbits <= 64);
+ set_if_smaller(nbits, 64); // Safety
+ static uint ndigits[65]=
+ {0,
+ 1,1,1,2,2,2,3,3, // 1..8 bits
+ 3,4,4,4,4,5,5,5, // 9..16 bits
+ 6,6,6,7,7,7,7,8, // 17..24 bits
+ 8,8,9,9,9,10,10,10, // 25..32 bits
+ 10,11,11,11,12,12,12,13, // 33..40 bits
+ 13,13,13,14,14,14,15,15, // 41..48 bits
+ 15,16,16,16,16,17,17,17, // 49..56 bits
+ 18,18,18,19,19,19,19,20 // 57..64 bits
+ };
+ return ndigits[nbits];
}
/*************************************************************************/
@@ -4933,7 +4951,9 @@ bool Type_handler::Item_get_date_with_warn(THD *thd, Item *item,
MYSQL_TIME *ltime,
date_mode_t fuzzydate) const
{
- Temporal::Warn_push warn(thd, item->field_table_or_null(),
+ const TABLE_SHARE *s= item->field_table_or_null();
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
item->field_name_or_null(), ltime, fuzzydate);
Item_get_date(thd, item, &warn, ltime, fuzzydate);
return ltime->time_type < 0;
@@ -4945,7 +4965,9 @@ bool Type_handler::Item_func_hybrid_field_type_get_date_with_warn(THD *thd,
MYSQL_TIME *ltime,
date_mode_t mode) const
{
- Temporal::Warn_push warn(thd, item->field_table_or_null(),
+ const TABLE_SHARE *s= item->field_table_or_null();
+ Temporal::Warn_push warn(thd, s ? s->db.str : nullptr,
+ s ? s->table_name.str : nullptr,
item->field_name_or_null(), ltime, mode);
Item_func_hybrid_field_type_get_date(thd, item, &warn, ltime, mode);
return ltime->time_type < 0;
@@ -6143,7 +6165,40 @@ bool Type_handler_row::
bool Type_handler_int_result::
Item_func_round_fix_length_and_dec(Item_func_round *item) const
{
- item->fix_arg_int();
+ item->fix_arg_int(this, item->arguments()[0]);
+ return false;
+}
+
+
+bool Type_handler_year::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ item->fix_arg_int(&type_handler_ulong, item->arguments()[0]);
+ return false;
+}
+
+
+bool Type_handler_hex_hybrid::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ item->fix_arg_int(nullptr, nullptr);
+ return false;
+}
+
+
+bool Type_handler_bit::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ uint nbits= item->arguments()[0]->max_length;
+ item->fix_length_and_dec_ulong_or_ulonglong_by_nbits(nbits);
+ return false;
+}
+
+
+bool Type_handler_typelib::
+ Item_func_round_fix_length_and_dec(Item_func_round *item) const
+{
+ item->fix_length_and_dec_long_or_longlong(5, true);
return false;
}
@@ -6164,10 +6219,12 @@ bool Type_handler_decimal_result::
}
-bool Type_handler_temporal_result::
+bool Type_handler_date_common::
Item_func_round_fix_length_and_dec(Item_func_round *item) const
{
- item->fix_arg_double();
+ static const Type_std_attributes attr(Type_numeric_attributes(8, 0, true),
+ DTCollation_numeric());
+ item->fix_arg_int(&type_handler_ulong, &attr);
return false;
}
@@ -6217,7 +6274,43 @@ bool Type_handler_row::
bool Type_handler_int_result::
Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
{
- item->fix_length_and_dec_int_or_decimal();
+ item->Type_std_attributes::set(item->arguments()[0]);
+ item->set_handler(this);
+ return false;
+}
+
+
+bool Type_handler_year::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->Type_std_attributes::set(item->arguments()[0]);
+ item->set_handler(&type_handler_ulong);
+ return false;
+}
+
+
+bool Type_handler_bit::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ uint nbits= item->arguments()[0]->max_length;
+ item->fix_length_and_dec_ulong_or_ulonglong_by_nbits(nbits);
+ return false;
+}
+
+
+bool Type_handler_typelib::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_long_or_longlong(5, true);
+ return false;
+}
+
+
+bool Type_handler_hex_hybrid::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ uint nchars= item->arguments()[0]->decimal_precision();
+ item->fix_length_and_dec_long_or_longlong(nchars, true);
return false;
}
@@ -6238,10 +6331,36 @@ bool Type_handler_decimal_result::
}
-bool Type_handler_temporal_result::
+bool Type_handler_date_common::
Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
{
- item->fix_length_and_dec_int_or_decimal();
+ static const Type_numeric_attributes attr(8, 0/*dec*/, true/*unsigned*/);
+ item->Type_std_attributes::set(attr, DTCollation_numeric());
+ item->set_handler(&type_handler_ulong);
+ return false;
+}
+
+
+bool Type_handler_time_common::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_time();
+ return false;
+}
+
+
+bool Type_handler_datetime_common::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_datetime();
+ return false;
+}
+
+
+bool Type_handler_timestamp_common::
+ Item_func_int_val_fix_length_and_dec(Item_func_int_val *item) const
+{
+ item->fix_length_and_dec_datetime();
return false;
}
@@ -8589,7 +8708,8 @@ static void literal_warn(THD *thd, const Item *item,
ErrConvString err(str, length, cs);
thd->push_warning_wrong_or_truncated_value(
Sql_condition::time_warn_level(st->warnings),
- false, typestr, err.ptr(), NULL, NullS);
+ false, typestr, err.ptr(),
+ nullptr, nullptr, nullptr);
}
}
else if (send_error)
diff --git a/sql/sql_type.h b/sql/sql_type.h
index dcff53eb4f1..ed0aaaea400 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -807,34 +807,39 @@ public:
public:
void push_conversion_warnings(THD *thd, bool totally_useless_value,
date_mode_t mode, timestamp_type tstype,
- const TABLE_SHARE* s, const char *name)
+ const char *db_name, const char *table_name,
+ const char *name)
{
const char *typestr= tstype >= 0 ? type_name_by_timestamp_type(tstype) :
mode & (TIME_INTERVAL_hhmmssff | TIME_INTERVAL_DAY) ?
"interval" :
mode & TIME_TIME_ONLY ? "time" : "datetime";
Temporal::push_conversion_warnings(thd, totally_useless_value, warnings,
- typestr, s, name, ptr());
+ typestr, db_name, table_name, name,
+ ptr());
}
};
class Warn_push: public Warn
{
- THD *m_thd;
- const TABLE_SHARE *m_s;
- const char *m_name;
- const MYSQL_TIME *m_ltime;
- date_mode_t m_mode;
+ THD * const m_thd;
+ const char * const m_db_name;
+ const char * const m_table_name;
+ const char * const m_name;
+ const MYSQL_TIME * const m_ltime;
+ const date_mode_t m_mode;
public:
- Warn_push(THD *thd, const TABLE_SHARE *s, const char *name,
- const MYSQL_TIME *ltime, date_mode_t mode)
- :m_thd(thd), m_s(s), m_name(name), m_ltime(ltime), m_mode(mode)
+ Warn_push(THD *thd, const char *db_name, const char *table_name,
+ const char *name, const MYSQL_TIME *ltime, date_mode_t mode)
+ : m_thd(thd), m_db_name(db_name), m_table_name(table_name), m_name(name),
+ m_ltime(ltime), m_mode(mode)
{ }
~Warn_push()
{
if (warnings)
push_conversion_warnings(m_thd, m_ltime->time_type < 0,
- m_mode, m_ltime->time_type, m_s, m_name);
+ m_mode, m_ltime->time_type,
+ m_db_name, m_table_name, m_name);
}
};
@@ -875,7 +880,8 @@ public:
}
static void push_conversion_warnings(THD *thd, bool totally_useless_value, int warn,
const char *type_name,
- const TABLE_SHARE *s,
+ const char *db_name,
+ const char *table_name,
const char *field_name,
const char *value);
/*
@@ -1503,6 +1509,14 @@ public:
{ }
};
+ class Options_for_round: public Options
+ {
+ public:
+ Options_for_round(time_round_mode_t round_mode= TIME_FRAC_TRUNCATE)
+ :Options(Time::default_flags_for_get_date(), round_mode,
+ Time::DATETIME_TO_TIME_DISALLOW)
+ { }
+ };
class Options_cmp: public Options
{
public:
@@ -1854,6 +1868,40 @@ public:
DBUG_ASSERT(is_valid_value_slow());
return *this;
}
+ Time &ceiling(int *warn)
+ {
+ if (is_valid_time())
+ {
+ if (neg)
+ my_time_trunc(this, 0);
+ else if (second_part)
+ round_or_set_max(0, warn, 999999999);
+ }
+ DBUG_ASSERT(is_valid_value_slow());
+ return *this;
+ }
+ Time &ceiling()
+ {
+ int warn= 0;
+ return ceiling(&warn);
+ }
+ Time &floor(int *warn)
+ {
+ if (is_valid_time())
+ {
+ if (!neg)
+ my_time_trunc(this, 0);
+ else if (second_part)
+ round_or_set_max(0, warn, 999999999);
+ }
+ DBUG_ASSERT(is_valid_value_slow());
+ return *this;
+ }
+ Time &floor()
+ {
+ int warn= 0;
+ return floor(&warn);
+ }
Time &round(uint dec, int *warn)
{
if (is_valid_time())
@@ -2421,10 +2469,22 @@ public:
Datetime &trunc(uint dec)
{
if (is_valid_datetime())
- my_time_trunc(this, dec);
+ my_datetime_trunc(this, dec);
+ DBUG_ASSERT(is_valid_value_slow());
+ return *this;
+ }
+ Datetime &ceiling(THD *thd, int *warn)
+ {
+ if (is_valid_datetime() && second_part)
+ round_or_invalidate(thd, 0, warn, 999999999);
DBUG_ASSERT(is_valid_value_slow());
return *this;
}
+ Datetime &ceiling(THD *thd)
+ {
+ int warn= 0;
+ return ceiling(thd, &warn);
+ }
Datetime &round(THD *thd, uint dec, int *warn)
{
if (is_valid_datetime())
@@ -5102,8 +5162,6 @@ public:
bool Item_func_between_fix_length_and_dec(Item_func_between *)const override;
bool Item_func_in_fix_comparator_compatible_types(THD *, Item_func_in *)
const override;
- bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
- bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *)const override;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const override;
@@ -5629,6 +5687,8 @@ public:
const Column_definition_attributes *attr,
uint32 flags) const override;
Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *)const override;
void Item_get_date(THD *thd, Item *item, Temporal::Warn *warn,
MYSQL_TIME *ltime, date_mode_t fuzzydate) const override;
void Item_func_hybrid_field_type_get_date(THD *,
@@ -5653,7 +5713,7 @@ public:
}
uint32 max_display_length(const Item *item) const override;
uint32 Item_decimal_notation_int_digits(const Item *item) const override;
- static uint32 Bit_decimal_notation_int_digits(const Item *item);
+ static uint32 Bit_decimal_notation_int_digits_by_nbits(uint nbits);
uint32 max_display_length_for_field(const Conv_source &src) const override;
uint32 calc_pack_length(uint32 length) const override { return length / 8; }
uint calc_key_length(const Column_definition &def) const override;
@@ -5670,6 +5730,8 @@ public:
}
void show_binlog_type(const Conv_source &src, const Field &, String *str)
const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
Field *make_conversion_table_field(MEM_ROOT *root,
TABLE *table, uint metadata,
const Field *target) const override;
@@ -5912,6 +5974,7 @@ public:
const override;
longlong Item_func_between_val_int(Item_func_between *func) const override;
bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp)
const override;
bool set_comparator_func(Arg_comparator *cmp) const override;
@@ -6073,6 +6136,8 @@ public:
longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
my_decimal *) const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
bool Item_hybrid_func_fix_attributes(THD *thd,
const char *name,
Type_handler_hybrid_field_type *,
@@ -6208,6 +6273,7 @@ public:
String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override;
double Item_func_min_max_val_real(Item_func_min_max *) const override;
longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *, my_decimal *)
const override;
bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
@@ -6337,6 +6403,7 @@ public:
int cmp_native(const Native &a, const Native &b) const override;
longlong Item_func_between_val_int(Item_func_between *func) const override;
bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs)
const override;
@@ -6762,6 +6829,8 @@ class Type_handler_hex_hybrid: public Type_handler_varchar
public:
virtual ~Type_handler_hex_hybrid() {}
const Type_handler *cast_to_int_type_handler() const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
};
@@ -6980,6 +7049,8 @@ public:
enum_field_types field_type() const override { return MYSQL_TYPE_STRING; }
const Type_handler *type_handler_for_item_field() const override;
const Type_handler *cast_to_int_type_handler() const override;
+ bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val*) const override;
uint32 max_display_length_for_field(const Conv_source &src) const override;
bool Item_hybrid_func_fix_attributes(THD *thd,
const char *name,
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index f08b9733e89..4bda42b2ffa 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -3863,6 +3863,12 @@ static bool fix_tp_min_threads(sys_var *, THD *, enum_var_type)
static bool check_threadpool_size(sys_var *self, THD *thd, set_var *var)
{
+
+#ifdef _WIN32
+ if (threadpool_mode != TP_MODE_GENERIC)
+ return false;
+#endif
+
ulonglong v= var->save_result.ulonglong_value;
if (v > threadpool_max_size)
{
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index ed2aaf49b9f..ba56a7b4bfb 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -534,7 +534,10 @@ public:
String str2(buff2, sizeof(buff2), charset), *res;
if (!(res=var->value->val_str(&str)))
+ {
var->save_result.string_value.str= 0;
+ var->save_result.string_value.length= 0; // safety
+ }
else
{
uint32 unused;
@@ -939,9 +942,16 @@ public:
String str(buff, sizeof(buff), system_charset_info), *res;
if (!(res=var->value->val_str(&str)))
+ {
var->save_result.string_value.str= const_cast<char*>("");
+ var->save_result.string_value.length= 0;
+ }
else
- var->save_result.string_value.str= thd->strmake(res->ptr(), res->length());
+ {
+ size_t len= res->length();
+ var->save_result.string_value.str= thd->strmake(res->ptr(), len);
+ var->save_result.string_value.length= len;
+ }
return false;
}
bool session_update(THD *thd, set_var *var)
@@ -965,6 +975,7 @@ public:
{
char *ptr= (char*)(intptr)option.def_value;
var->save_result.string_value.str= ptr;
+ var->save_result.string_value.length= safe_strlen(ptr);
}
uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base)
{
diff --git a/sql/table.cc b/sql/table.cc
index d7ea9d447fa..e4ed862f41b 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -50,6 +50,17 @@
#define MYSQL57_GENERATED_FIELD 128
#define MYSQL57_GCOL_HEADER_SIZE 4
+class Table_arena: public Query_arena
+{
+public:
+ Table_arena(MEM_ROOT *mem_root, enum enum_state state_arg) :
+ Query_arena(mem_root, state_arg){}
+ virtual Type type() const
+ {
+ return TABLE_ARENA;
+ }
+};
+
struct extra2_fields
{
LEX_CUSTRING version;
@@ -1145,8 +1156,9 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
We need to use CONVENTIONAL_EXECUTION here to ensure that
any new items created by fix_fields() are not reverted.
*/
- table->expr_arena= new (alloc_root(mem_root, sizeof(Query_arena)))
- Query_arena(mem_root, Query_arena::STMT_CONVENTIONAL_EXECUTION);
+ table->expr_arena= new (alloc_root(mem_root, sizeof(Table_arena)))
+ Table_arena(mem_root,
+ Query_arena::STMT_CONVENTIONAL_EXECUTION);
if (!table->expr_arena)
DBUG_RETURN(1);
diff --git a/sql/table.h b/sql/table.h
index f719a0d03a2..6f3620de83f 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1667,6 +1667,7 @@ public:
TABLE *tmp_table,
TMP_TABLE_PARAM *tmp_table_param,
bool with_cleanup);
+ int fix_vcol_exprs(THD *thd);
Field *find_field_by_name(LEX_CSTRING *str) const;
bool export_structure(THD *thd, class Row_definition_list *defs);
bool is_splittable() { return spl_opt_info != NULL; }
diff --git a/sql/threadpool.h b/sql/threadpool.h
index b781e50b992..27da872c5cc 100644
--- a/sql/threadpool.h
+++ b/sql/threadpool.h
@@ -74,6 +74,7 @@ enum TP_STATE
{
TP_STATE_IDLE,
TP_STATE_RUNNING,
+ TP_STATE_PENDING
};
/*
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index bd8573951b6..877428e67ac 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -451,11 +451,25 @@ void tp_timeout_handler(TP_connection *c)
{
if (c->state != TP_STATE_IDLE)
return;
- THD *thd=c->thd;
+ THD *thd= c->thd;
mysql_mutex_lock(&thd->LOCK_thd_kill);
- thd->set_killed_no_mutex(KILL_WAIT_TIMEOUT);
- c->priority= TP_PRIORITY_HIGH;
- post_kill_notification(thd);
+ Vio *vio= thd->net.vio;
+ if (vio && (vio_pending(vio) > 0 || vio->has_data(vio)) &&
+ c->state == TP_STATE_IDLE)
+ {
+ /*
+ There is some data on that connection, i.e
+ i.e there was no inactivity timeout.
+ Don't kill.
+ */
+ c->state= TP_STATE_PENDING;
+ }
+ else if (c->state == TP_STATE_IDLE)
+ {
+ thd->set_killed_no_mutex(KILL_WAIT_TIMEOUT);
+ c->priority= TP_PRIORITY_HIGH;
+ post_kill_notification(thd);
+ }
mysql_mutex_unlock(&thd->LOCK_thd_kill);
}
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index d9286602ace..7b13803a5c3 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 Monty Program Ab
+/* Copyright (C) 2012, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -513,11 +513,21 @@ static my_bool timeout_check(THD *thd, pool_timer_t *timer)
DBUG_ENTER("timeout_check");
if (thd->net.reading_or_writing == 1)
{
- /*
- Check if connection does not have scheduler data. This happens for example
- if THD belongs to a different scheduler, that is listening to extra_port.
- */
- if (auto connection= (TP_connection_generic *) thd->event_scheduler.data)
+ TP_connection_generic *connection= (TP_connection_generic *)thd->event_scheduler.data;
+ if (!connection || connection->state != TP_STATE_IDLE)
+ {
+ /*
+ Connection does not have scheduler data. This happens for example
+ if THD belongs to a different scheduler, that is listening to extra_port.
+ */
+ DBUG_RETURN(0);
+ }
+
+ if(connection->abs_wait_timeout < timer->current_microtime)
+ {
+ tp_timeout_handler(connection);
+ }
+ else
{
if (connection->abs_wait_timeout < timer->current_microtime)
tp_timeout_handler(connection);
diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc
index de0aab4b81a..8f52938f9ed 100644
--- a/sql/wsrep_high_priority_service.cc
+++ b/sql/wsrep_high_priority_service.cc
@@ -292,6 +292,8 @@ int Wsrep_high_priority_service::append_fragment_and_commit(
ret= ret || (m_thd->wsrep_cs().after_applying(), 0);
m_thd->mdl_context.release_transactional_locks();
+ free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC));
+
thd_proc_info(m_thd, "wsrep applier committed");
DBUG_RETURN(ret);
@@ -350,6 +352,8 @@ int Wsrep_high_priority_service::commit(const wsrep::ws_handle& ws_handle,
thd->lex->sql_command= SQLCOM_END;
+ free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC));
+
must_exit_= check_exit_status();
DBUG_RETURN(ret);
}
@@ -370,6 +374,9 @@ int Wsrep_high_priority_service::rollback(const wsrep::ws_handle& ws_handle,
int ret= (trans_rollback_stmt(m_thd) || trans_rollback(m_thd));
m_thd->mdl_context.release_transactional_locks();
m_thd->mdl_context.release_explicit_locks();
+
+ free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC));
+
DBUG_RETURN(ret);
}
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index fab849b81f0..126f873569f 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -4922,8 +4922,13 @@ loop:
mtr_release_block_at_savepoint(
&mtr, savepoint, right_block);
- btr_block_get(*index, parent_right_page_no,
- RW_SX_LATCH, false, &mtr);
+ if (parent_right_page_no != FIL_NULL) {
+ btr_block_get(*index,
+ parent_right_page_no,
+ RW_SX_LATCH, false,
+ &mtr);
+ }
+
right_block = btr_block_get(*index,
right_page_no,
RW_SX_LATCH,
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 54a39a5455f..daa1901181e 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -772,6 +772,7 @@ btr_cur_optimistic_latch_leaves(
{
rw_lock_type_t mode;
ulint left_page_no;
+ ulint curr_page_no;
switch (*latch_mode) {
case BTR_SEARCH_LEAF:
@@ -795,13 +796,33 @@ btr_cur_optimistic_latch_leaves(
goto unpin_failed;
}
+ curr_page_no = block->page.id().page_no();
left_page_no = btr_page_get_prev(block->frame);
rw_lock_s_unlock(&block->lock);
- cursor->left_block = left_page_no != FIL_NULL
- ? btr_block_get(*cursor->index, left_page_no, mode,
- page_is_leaf(block->frame), mtr)
- : NULL;
+ if (left_page_no != FIL_NULL) {
+ dberr_t err = DB_SUCCESS;
+ cursor->left_block = buf_page_get_gen(
+ page_id_t(cursor->index->table->space_id,
+ left_page_no),
+ cursor->index->table->space->zip_size(),
+ mode, nullptr, BUF_GET_POSSIBLY_FREED,
+ __FILE__, __LINE__, mtr, &err);
+
+ if (err == DB_DECRYPTION_FAILED) {
+ cursor->index->table->file_unreadable = true;
+ }
+
+ if (btr_page_get_next(cursor->left_block->frame)
+ != curr_page_no) {
+ /* release the left block */
+ btr_leaf_page_release(
+ cursor->left_block, mode, mtr);
+ goto unpin_failed;
+ }
+ } else {
+ cursor->left_block = NULL;
+ }
if (buf_page_optimistic_get(mode, block, modify_clock,
file, line, mtr)) {
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index ff13e0ad5e8..3b28724c948 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -1290,26 +1290,6 @@ retry:
ut_ad(block->page.id().space() == index->table->space_id);
ut_a(index_id == index->id);
ut_ad(!dict_index_is_ibuf(index));
-#ifdef UNIV_DEBUG
- switch (dict_index_get_online_status(index)) {
- case ONLINE_INDEX_CREATION:
- /* The index is being created (bulk loaded). */
- case ONLINE_INDEX_COMPLETE:
- /* The index has been published. */
- case ONLINE_INDEX_ABORTED:
- /* Either the index creation was aborted due to an
- error observed by InnoDB (in which case there should
- not be any adaptive hash index entries), or it was
- completed and then flagged aborted in
- rollback_inplace_alter_table(). */
- break;
- case ONLINE_INDEX_ABORTED_DROPPED:
- /* The index should have been dropped from the tablespace
- already, and the adaptive hash index entries should have
- been dropped as well. */
- ut_error;
- }
-#endif /* UNIV_DEBUG */
n_fields = block->curr_n_fields;
n_bytes = block->curr_n_bytes;
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index d55c9e996f2..6a8c4869659 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -3836,15 +3836,25 @@ buf_page_create(fil_space_t *space, uint32_t offset,
if (block && block->page.in_file() &&
!buf_pool.watch_is_sentinel(block->page))
{
+#ifdef BTR_CUR_HASH_ADAPT
+ const bool drop_hash_entry= block->page.state() == BUF_BLOCK_FILE_PAGE &&
+ UNIV_LIKELY_NULL(block->index);
+ if (UNIV_UNLIKELY(drop_hash_entry))
+ block->page.set_io_fix(BUF_IO_PIN);
+#endif /* BTR_CUR_HASH_ADAPT */
+
/* Page can be found in buf_pool */
buf_LRU_block_free_non_file_page(free_block);
mutex_exit(&buf_pool.mutex);
#ifdef BTR_CUR_HASH_ADAPT
- if (block->page.state() == BUF_BLOCK_FILE_PAGE &&
- UNIV_LIKELY_NULL(block->index))
+ if (UNIV_UNLIKELY(drop_hash_entry))
+ {
btr_search_drop_page_hash_index(block);
+ block->page.io_unfix();
+ }
#endif /* BTR_CUR_HASH_ADAPT */
+
if (!recv_recovery_is_on())
/* FIXME: Remove the redundant lookup and avoid
the unnecessary invocation of buf_zip_decompress().
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index a8de0ef5085..8f7e2b04782 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -2581,7 +2581,7 @@ static os_thread_ret_t DECLARE_THREAD(buf_flush_page_cleaner)(void*)
idle and there are no pending IOs in the buffer pool
and there is work to do. */
if (!n_flushed || !buf_pool.n_pend_reads
- || srv_check_activity(last_activity)) {
+ || srv_check_activity(&last_activity)) {
ret_sleep = pc_sleep_if_needed(
next_loop_time, sig_count, curr_time);
@@ -2671,7 +2671,7 @@ static os_thread_ret_t DECLARE_THREAD(buf_flush_page_cleaner)(void*)
n_flushed = n_flushed_lru + n_flushed_list;
- } else if (srv_check_activity(last_activity)) {
+ } else if (srv_check_activity(&last_activity)) {
ulint n_to_flush;
lsn_t lsn_limit;
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 9761a77d7cb..0f1b3b461a8 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -4324,6 +4324,7 @@ dict_set_corrupted_index_cache_only(
is corrupted */
if (dict_index_is_clust(index)) {
index->table->corrupted = TRUE;
+ index->table->file_unreadable = true;
}
index->type |= DICT_CORRUPT;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 67822d0b752..1db3d73c027 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -369,14 +369,6 @@ TYPELIB innodb_flush_method_typelib = {
NULL
};
-/* The following counter is used to convey information to InnoDB
-about server activity: in case of normal DML ops it is not
-sensible to call srv_active_wake_master_thread after each
-operation, we only do it every INNOBASE_WAKE_INTERVAL'th step. */
-
-#define INNOBASE_WAKE_INTERVAL 32
-static ulong innobase_active_counter = 0;
-
/** Allowed values of innodb_change_buffering */
static const char* innodb_change_buffering_names[] = {
"none", /* IBUF_USE_NONE */
@@ -1724,23 +1716,6 @@ static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid);
static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid);
#endif /* WITH_WSREP */
/********************************************************************//**
-Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth
-time calls srv_active_wake_master_thread. This function should be used
-when a single database operation may introduce a small need for
-server utility activity, like checkpointing. */
-inline
-void
-innobase_active_small(void)
-/*=======================*/
-{
- innobase_active_counter++;
-
- if ((innobase_active_counter % INNOBASE_WAKE_INTERVAL) == 0) {
- srv_active_wake_master_thread();
- }
-}
-
-/********************************************************************//**
Converts an InnoDB error code to a MySQL error code and also tells to MySQL
about a possible transaction rollback inside InnoDB caused by a lock wait
timeout or a deadlock.
@@ -6193,11 +6168,6 @@ ha_innobase::close()
MONITOR_INC(MONITOR_TABLE_CLOSE);
- /* Tell InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
DBUG_RETURN(0);
}
@@ -7890,8 +7860,6 @@ report_error:
}
func_exit:
- innobase_active_small();
-
DBUG_RETURN(error_result);
}
@@ -8573,11 +8541,6 @@ func_exit:
error, m_prebuilt->table->flags, m_user_thd);
}
- /* Tell InnoDB server that there might be work for
- utility threads: */
-
- innobase_active_small();
-
#ifdef WITH_WSREP
if (error == DB_SUCCESS && trx->is_wsrep()
&& wsrep_thd_is_local(m_user_thd)
@@ -8639,11 +8602,6 @@ ha_innobase::delete_row(
innobase_srv_conc_exit_innodb(m_prebuilt);
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- innobase_active_small();
-
#ifdef WITH_WSREP
if (error == DB_SUCCESS && trx->is_wsrep()
&& wsrep_thd_is_local(m_user_thd)
@@ -13020,7 +12978,6 @@ create_table_info_t::create_table_update_dict()
if (m_flags2 & DICT_TF2_FTS) {
if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) {
dict_table_close(innobase_table, FALSE, FALSE);
- srv_active_wake_master_thread();
trx_free(m_trx);
DBUG_RETURN(-1);
}
@@ -13173,11 +13130,6 @@ ha_innobase::create(
error = info.create_table_update_dict();
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
DBUG_RETURN(error);
}
@@ -21053,6 +21005,31 @@ bool ha_innobase::rowid_filter_push(Rowid_filter* pk_filter)
DBUG_RETURN(false);
}
+static bool is_part_of_a_key_prefix(const Field_longstr *field)
+{
+ const TABLE_SHARE *s= field->table->s;
+
+ for (uint i= 0; i < s->keys; i++)
+ {
+ const KEY &key= s->key_info[i];
+ for (uint j= 0; j < key.user_defined_key_parts; j++)
+ {
+ const KEY_PART_INFO &info= key.key_part[j];
+ // When field is a part of some key, a key part and field will have the
+ // same length. And their length will be different when only some prefix
+ // of a field is used as a key part. That's what we're looking for here.
+ if (info.field->field_index == field->field_index &&
+ info.length != field->field_length)
+ {
+ DBUG_ASSERT(info.length < field->field_length);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
static bool
is_part_of_a_primary_key(const Field* field)
{
@@ -21087,6 +21064,11 @@ bool ha_innobase::can_convert_string(const Field_string *field,
if (!field_cs.eq_collation_specific_names(new_type.charset))
return !is_part_of_a_primary_key(field);
+ // Fully indexed case works instantly like
+ // Compare_keys::EqualButKeyPartLength. But prefix case isn't implemented.
+ if (is_part_of_a_key_prefix(field))
+ return false;
+
return true;
}
@@ -21101,53 +21083,50 @@ supports_enlarging(const dict_table_t* table, const Field_varstring* field,
|| field->field_length > 255 || !table->not_redundant();
}
-bool
-ha_innobase::can_convert_varstring(const Field_varstring* field,
- const Column_definition& new_type) const
+bool ha_innobase::can_convert_varstring(
+ const Field_varstring *field, const Column_definition &new_type) const
{
- if (new_type.length < field->field_length) {
- return false;
- }
+ if (new_type.length < field->field_length)
+ return false;
- if (new_type.char_length < field->char_length()) {
- return false;
- }
+ if (new_type.char_length < field->char_length())
+ return false;
- if (!new_type.compression_method() != !field->compression_method()) {
- return false;
- }
+ if (!new_type.compression_method() != !field->compression_method())
+ return false;
- if (new_type.type_handler() != field->type_handler()) {
- return false;
- }
+ if (new_type.type_handler() != field->type_handler())
+ return false;
- if (new_type.charset != field->charset()) {
- if (!supports_enlarging(m_prebuilt->table, field, new_type)) {
- return false;
- }
+ if (new_type.charset != field->charset())
+ {
+ if (!supports_enlarging(m_prebuilt->table, field, new_type))
+ return false;
- Charset field_cs(field->charset());
- if (!field_cs.encoding_allows_reinterpret_as(
- new_type.charset)) {
- return false;
- }
+ Charset field_cs(field->charset());
+ if (!field_cs.encoding_allows_reinterpret_as(new_type.charset))
+ return false;
- if (!field_cs.eq_collation_specific_names(new_type.charset)) {
- return !is_part_of_a_primary_key(field);
- }
+ if (!field_cs.eq_collation_specific_names(new_type.charset))
+ return !is_part_of_a_primary_key(field);
- return true;
- }
+ // Fully indexed case works instantly like
+ // Compare_keys::EqualButKeyPartLength. But prefix case isn't implemented.
+ if (is_part_of_a_key_prefix(field))
+ return false;
- if (new_type.length != field->field_length) {
- if (!supports_enlarging(m_prebuilt->table, field, new_type)) {
- return false;
- }
+ return true;
+ }
- return true;
- }
+ if (new_type.length != field->field_length)
+ {
+ if (!supports_enlarging(m_prebuilt->table, field, new_type))
+ return false;
+
+ return true;
+ }
- return true;
+ return true;
}
static bool is_part_of_a_key(const Field_blob *field)
@@ -21189,6 +21168,11 @@ bool ha_innobase::can_convert_blob(const Field_blob *field,
if (!field_cs.eq_collation_specific_names(new_type.charset))
return !is_part_of_a_key(field);
+ // Fully indexed case works instantly like
+ // Compare_keys::EqualButKeyPartLength. But prefix case isn't implemented.
+ if (is_part_of_a_key_prefix(field))
+ return false;
+
return true;
}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index f878a483019..253675266c9 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -169,8 +169,6 @@ inline void dict_table_t::init_instant(const dict_table_t& table)
ut_d(unsigned n_nullable = 0);
for (unsigned i = u; i < index.n_fields; i++) {
auto& f = index.fields[i];
- DBUG_ASSERT(dict_col_get_fixed_size(f.col, not_redundant())
- <= DICT_MAX_FIXED_COL_LEN);
ut_d(n_nullable += f.col->is_nullable());
if (!f.col->is_dropped()) {
@@ -215,6 +213,9 @@ inline void dict_table_t::prepare_instant(const dict_table_t& old,
DBUG_ASSERT(old.n_cols == old.n_def);
DBUG_ASSERT(n_cols == n_def);
DBUG_ASSERT(old.supports_instant());
+ DBUG_ASSERT(not_redundant() == old.not_redundant());
+ DBUG_ASSERT(DICT_TF_HAS_ATOMIC_BLOBS(flags)
+ == DICT_TF_HAS_ATOMIC_BLOBS(old.flags));
DBUG_ASSERT(!persistent_autoinc
|| persistent_autoinc == old.persistent_autoinc);
/* supports_instant() does not necessarily hold here,
@@ -6123,6 +6124,15 @@ prepare_inplace_alter_table_dict(
user_table = ctx->new_table;
+ if (ha_alter_info->inplace_supported == HA_ALTER_INPLACE_INSTANT) {
+ /* If we promised ALGORITHM=INSTANT capability, we must
+ retain the original ROW_FORMAT of the table. */
+ flags = (user_table->flags & (DICT_TF_MASK_COMPACT
+ | DICT_TF_MASK_ATOMIC_BLOBS))
+ | (flags & ~(DICT_TF_MASK_COMPACT
+ | DICT_TF_MASK_ATOMIC_BLOBS));
+ }
+
trx_start_if_not_started_xa(ctx->prebuilt->trx, true);
if (ha_alter_info->handler_flags
@@ -11060,11 +11070,6 @@ foreign_fail:
crash_inject_count++);
}
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
if (fail) {
for (inplace_alter_handler_ctx** pctx = ctx_array;
*pctx; pctx++) {
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index c51e831fb0e..0acff406326 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -810,8 +810,11 @@ rec_get_nth_cfield(
ulint n,
ulint* len)
{
- ut_ad(rec_offs_validate(rec, index, offsets));
-
+ /* Because this function may be invoked by innobase_rec_to_mysql()
+ for reporting a duplicate key during ALTER TABLE or
+ CREATE UNIQUE INDEX, and in that case the rec omit the fixed-size
+ header of 5 or 6 bytes, the check
+ rec_offs_validate(rec, index, offsets) must be avoided here. */
if (!rec_offs_nth_default(offsets, n)) {
return rec_get_nth_field(rec, offsets, n, len);
}
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index d4b6425c44b..9cad1497b85 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -643,19 +643,6 @@ srv_reset_io_thread_op_info();
/** Wake up the purge if there is work to do. */
void
srv_wake_purge_thread_if_not_active();
-/** Wake up the InnoDB master thread */
-void
-srv_active_wake_master_thread_low();
-
-#define srv_active_wake_master_thread() \
- do { \
- if (!srv_read_only_mode) { \
- srv_active_wake_master_thread_low(); \
- } \
- } while (0)
-/** Wake up the master */
-void
-srv_wake_master_thread();
/******************************************************************//**
Outputs to a file the output of the InnoDB Monitor.
@@ -684,13 +671,13 @@ reading this value as it is only used in heuristics.
ulint
srv_get_activity_count(void);
/*========================*/
-/*******************************************************************//**
-Check if there has been any activity.
+
+/** Check if there has been any activity.
+@param[in,out] activity_count recent activity count to be returned
+if there is a change
@return FALSE if no change in activity counter. */
-ibool
-srv_check_activity(
-/*===============*/
- ulint old_activity_count); /*!< old activity count */
+bool srv_check_activity(ulint *activity_count);
+
/******************************************************************//**
Increment the server activity counter. */
void
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 84589e7950f..0fe480ca660 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -1642,6 +1642,9 @@ wait_suspend_loop:
"Waiting for page cleaner");
ib::info() << "Waiting for page_cleaner to "
"finish flushing of buffer pool";
+ /* This is a workaround to avoid the InnoDB hang
+ when OS datetime changed backwards */
+ os_event_set(buf_flush_event);
count = 0;
}
}
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 50a225ab2cd..ad14f91859d 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -2166,7 +2166,7 @@ same_page:
if (lsn == checkpoint_lsn)
{
- ut_ad(mlog_checkpoint_lsn <= recovered_lsn);
+ /* There can be multiple FILE_CHECKPOINT for the same LSN. */
if (mlog_checkpoint_lsn)
continue;
mlog_checkpoint_lsn= recovered_lsn;
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 0f1e8007d36..cdd12a10cf7 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -2224,8 +2224,14 @@ row_ins_duplicate_online(
return(DB_SUCCESS);
}
- if (fields == n_uniq + 2) {
- /* rec is an exact match of entry. */
+ ulint trx_id_len;
+
+ if (fields == n_uniq + 2
+ && memcmp(rec_get_nth_field(rec, offsets, n_uniq, &trx_id_len),
+ reset_trx_id, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN)) {
+ ut_ad(trx_id_len == DATA_TRX_ID_LEN);
+ /* rec is an exact match of entry, and DB_TRX_ID belongs
+ to a transaction that started after our ALTER TABLE. */
return(DB_SUCCESS_LOCKED_REC);
}
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 296c273a779..f7868135a94 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -3807,7 +3807,7 @@ funct_exit_all_freed:
trx->op_info = "";
- srv_wake_master_thread();
+ srv_inc_activity_count();
DBUG_RETURN(err);
}
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index d84747c9007..eb948855032 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -93,7 +93,7 @@ row_vers_impl_x_locked_low(
trx_id_t trx_id;
rec_t* prev_version = NULL;
rec_offs clust_offsets_[REC_OFFS_NORMAL_SIZE];
- rec_offs* clust_offsets = clust_offsets_;
+ rec_offs* clust_offsets;
mem_heap_t* heap;
dtuple_t* ientry = NULL;
mem_heap_t* v_heap = NULL;
@@ -115,7 +115,7 @@ row_vers_impl_x_locked_low(
heap = mem_heap_create(1024);
- clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets,
+ clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets_,
true, ULINT_UNDEFINED, &heap);
trx_id = row_get_rec_trx_id(clust_rec, clust_index, clust_offsets);
@@ -204,7 +204,7 @@ row_vers_impl_x_locked_low(
ut_ad(committed || prev_version
|| !rec_get_deleted_flag(version, comp));
- /* Free version. */
+ /* Free version and clust_offsets. */
mem_heap_free(old_heap);
if (committed) {
@@ -239,7 +239,7 @@ not_locked:
}
clust_offsets = rec_get_offsets(
- prev_version, clust_index, clust_offsets, true,
+ prev_version, clust_index, clust_offsets_, true,
ULINT_UNDEFINED, &heap);
vers_del = rec_get_deleted_flag(prev_version, comp);
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 8b8765b2748..09cdf6fe0c1 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -76,7 +76,6 @@ Created 10/8/1995 Heikki Tuuri
#include <my_service_manager.h>
-
/* The following is the maximum allowed duration of a lock wait. */
UNIV_INTERN ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT;
@@ -1507,17 +1506,6 @@ bool srv_any_background_activity()
}
#endif /* UNIV_DEBUG */
-/** Wake up the InnoDB master thread if it was suspended (not sleeping). */
-void
-srv_active_wake_master_thread_low()
-{
- ut_ad(!srv_read_only_mode);
- ut_ad(!mutex_own(&srv_sys.mutex));
-
- srv_inc_activity_count();
-}
-
-
static void purge_worker_callback(void*);
static void purge_coordinator_callback(void*);
static void purge_coordinator_timer_callback(void*);
@@ -1606,13 +1594,6 @@ void purge_sys_t::resume()
rw_lock_x_unlock(&latch);
}
-/** Wake up the master thread if it is suspended or being suspended. */
-void
-srv_wake_master_thread()
-{
- srv_inc_activity_count();
-}
-
/*******************************************************************//**
Get current server activity count. We don't hold srv_sys::mutex while
reading this value as it is only used in heuristics.
@@ -1624,15 +1605,20 @@ srv_get_activity_count(void)
return(srv_sys.activity_count);
}
-/*******************************************************************//**
-Check if there has been any activity.
+/** Check if there has been any activity.
+@param[in,out] activity_count recent activity count to be returned
+if there is a change
@return FALSE if no change in activity counter. */
-ibool
-srv_check_activity(
-/*===============*/
- ulint old_activity_count) /*!< in: old activity count */
+bool srv_check_activity(ulint *activity_count)
{
- return(srv_sys.activity_count != old_activity_count);
+ ulint new_activity_count= srv_sys.activity_count;
+ if (new_activity_count != *activity_count)
+ {
+ *activity_count= new_activity_count;
+ return true;
+ }
+
+ return false;
}
/********************************************************************//**
@@ -1923,6 +1909,10 @@ srv_master_do_idle_tasks(void)
log_checkpoint();
MONITOR_INC_TIME_IN_MICRO_SECS(MONITOR_SRV_CHECKPOINT_MICROSECOND,
counter_time);
+
+ /* This is a workaround to avoid the InnoDB hang when OS datetime
+ changed backwards.*/
+ os_event_set(buf_flush_event);
}
/**
@@ -1971,8 +1961,7 @@ void srv_master_callback(void*)
srv_main_thread_op_info = "";
MONITOR_INC(MONITOR_MASTER_THREAD_SLEEP);
- if (srv_check_activity(old_activity_count)) {
- old_activity_count = srv_get_activity_count();
+ if (srv_check_activity(&old_activity_count)) {
srv_master_do_active_tasks();
} else {
srv_master_do_idle_tasks();
@@ -2097,15 +2086,13 @@ static uint32_t srv_do_purge(ulint* n_total_purged)
++n_use_threads;
}
- } else if (srv_check_activity(old_activity_count)
+ } else if (srv_check_activity(&old_activity_count)
&& n_use_threads > 1) {
/* History length same or smaller since last snapshot,
use fewer threads. */
--n_use_threads;
-
- old_activity_count = srv_get_activity_count();
}
/* Ensure that the purge threads are less than what
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 9f7f039bde1..60fc333c4ba 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -888,7 +888,6 @@ srv_shutdown_all_bg_threads()
/* NOTE: IF YOU CREATE THREADS IN INNODB, YOU MUST EXIT THEM
HERE OR EARLIER */
-
if (!srv_read_only_mode) {
/* b. srv error monitor thread exits automatically,
no need to do anything here */
@@ -2049,7 +2048,7 @@ void srv_shutdown_bg_undo_sources()
fts_optimize_shutdown();
dict_stats_shutdown();
while (row_get_background_drop_list_len_low()) {
- srv_wake_master_thread();
+ srv_inc_activity_count();
os_thread_yield();
}
srv_undo_sources = false;
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index 85daf649c6a..a16ee95dc83 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -67,7 +67,7 @@ inline bool trx_t::rollback_finish()
}
ut_a(error_state == DB_INTERRUPTED);
- ut_ad(!srv_is_being_started);
+ ut_ad(srv_shutdown_state != SRV_SHUTDOWN_NONE);
ut_a(!srv_undo_sources);
ut_ad(srv_fast_shutdown);
ut_d(in_rollback= false);
@@ -145,9 +145,6 @@ inline void trx_t::rollback_low(trx_savept_t *savept)
mem_heap_free(heap);
- /* There might be work for utility threads.*/
- srv_active_wake_master_thread();
-
MONITOR_DEC(MONITOR_TRX_ACTIVE);
}
@@ -776,7 +773,8 @@ void trx_rollback_recovered(bool all)
ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
ut_d(trx_mutex_exit(trx));
- if (!srv_is_being_started && !srv_undo_sources && srv_fast_shutdown)
+ if (srv_shutdown_state != SRV_SHUTDOWN_NONE && !srv_undo_sources &&
+ srv_fast_shutdown)
goto discard;
if (all || trx_get_dict_operation(trx) != TRX_DICT_OP_NONE)
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index fb594b0b099..ac9fc7d22c2 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1469,11 +1469,6 @@ inline void trx_t::commit_in_memory(const mtr_t *mtr)
must_flush_log_later= true;
else if (srv_flush_log_at_trx_commit)
trx_flush_log_if_needed(commit_lsn, this);
-
- /* Tell server some activity has happened, since the trx does
- changes something. Background utility threads like master thread,
- purge thread or page_cleaner thread might have some work to do. */
- srv_active_wake_master_thread();
}
ut_ad(!rsegs.m_noredo.undo);
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 090ababf238..19f0d3cfa99 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -112,9 +112,15 @@ SET(ROCKSDB_SE_SOURCES
# This is a strong requirement coming from RocksDB. No conditional checks here.
#ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX
#)
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+ SET(ATOMIC_EXTRA_LIBS -latomic)
+else()
+ SET(ATOMIC_EXTRA_LIBS)
+endif()
MYSQL_ADD_PLUGIN(rocksdb ${ROCKSDB_SE_SOURCES} MODULE_ONLY STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_rocksdb
+ LINK_LIBRARIES ${ATOMIC_EXTRA_LIBS}
COMPONENT rocksdb-engine)
IF(NOT TARGET rocksdb)
@@ -165,6 +171,7 @@ TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
if (UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()
+TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
# IF (WITH_JEMALLOC)
# FIND_LIBRARY(JEMALLOC_LIBRARY
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index f7b2170978d..2b4649b1fbe 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -18,17 +18,16 @@ if(WIN32)
# include(${ROCKSDB_SOURCE_DIR}/thirdparty.inc)
else()
option(WITH_ROCKSDB_JEMALLOC "build RocksDB with JeMalloc" OFF)
- if(WITH_ROCKSDB_JEMALLOC)
- find_package(JeMalloc REQUIRED)
- add_definitions(-DROCKSDB_JEMALLOC)
- ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
- include_directories(${JEMALLOC_INCLUDE_DIR})
- endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# FreeBSD has jemaloc as default malloc
add_definitions(-DROCKSDB_JEMALLOC)
ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
set(WITH_JEMALLOC ON)
+ elseif(WITH_ROCKSDB_JEMALLOC)
+ find_package(JeMalloc REQUIRED)
+ add_definitions(-DROCKSDB_JEMALLOC)
+ ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
+ include_directories(${JEMALLOC_INCLUDE_DIR})
endif()
endif()
@@ -127,6 +126,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
ADD_DEFINITIONS(-DHAVE_POWER8 -DHAS_ALTIVEC)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} -latomic)
+endif()
+
option(WITH_FALLOCATE "build with fallocate" ON)
if(WITH_FALLOCATE AND UNIX)
@@ -437,6 +440,17 @@ else()
util/crc32c_ppc.c
util/crc32c_ppc_asm.S)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+ # aarch
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
+ INCLUDE(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC)
+ if(HAS_ARMV8_CRC)
+ message(STATUS " HAS_ARMV8_CRC yes")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crc+crypto -Wno-unused-function")
+ list(APPEND ROCKSDB_SOURCES
+ util/crc32c_arm64.cc)
+ endif(HAS_ARMV8_CRC)
+ endif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
endif()
SET(SOURCES)
FOREACH(s ${ROCKSDB_SOURCES})
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test b/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
index 3ebdd67a1a6..aee653830e2 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
@@ -30,7 +30,7 @@ $MYSQL_SLAP --silent --delimiter=";" --query="select * from a1 where b=1" --conc
wait
EOF
---exec bash $MYSQL_TMP_DIR/concurrent_alter.sh
+--exec sh $MYSQL_TMP_DIR/concurrent_alter.sh
let $server_charset=`select @@character_set_server`;
--replace_result $server_charset DEFAULT_CHARSET
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index 8dc38ab31e8..55c34be9dd7 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -37,6 +37,7 @@ my_bool vio_is_connected_pipe(Vio *vio);
int vio_close_pipe(Vio * vio);
int cancel_io(HANDLE handle, DWORD thread_id);
int vio_shutdown_pipe(Vio *vio,int how);
+uint vio_pending_pipe(Vio* vio);
#endif
diff --git a/vio/viopipe.c b/vio/viopipe.c
index 6db0944d8df..567884807fe 100644
--- a/vio/viopipe.c
+++ b/vio/viopipe.c
@@ -140,5 +140,11 @@ int vio_close_pipe(Vio *vio)
DBUG_RETURN(ret);
}
+/* return number of bytes readable from pipe.*/
+uint vio_pending_pipe(Vio *vio)
+{
+ DWORD bytes;
+ return PeekNamedPipe(vio->hPipe, NULL, 0, NULL, &bytes, NULL) ? bytes : 0;
+}
#endif
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 2d240688ce0..9cad035161c 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -1252,7 +1252,6 @@ my_bool vio_is_connected(Vio *vio)
DBUG_RETURN(bytes ? TRUE : FALSE);
}
-#ifndef DBUG_OFF
/**
Number of bytes in the read or socket buffer
@@ -1271,22 +1270,34 @@ ssize_t vio_pending(Vio *vio)
return vio->read_end - vio->read_pos;
/* Skip non-socket based transport types. */
- if (vio->type == VIO_TYPE_TCPIP || vio->type == VIO_TYPE_SOCKET)
+ switch (vio->type)
{
+ case VIO_TYPE_TCPIP:
+ /* fallthrough */
+ case VIO_TYPE_SOCKET:
/* Obtain number of readable bytes in the socket buffer. */
if (socket_peek_read(vio, &bytes))
return -1;
- }
+ return bytes;
- /*
- SSL not checked due to a yaSSL bug in SSL_pending that
- causes it to attempt to read from the socket.
- */
+ case VIO_TYPE_SSL:
+ bytes= (uint) SSL_pending(vio->ssl_arg);
+ if (bytes)
+ return bytes;
+ if (socket_peek_read(vio, &bytes))
+ return -1;
+ return bytes;
- return (ssize_t) bytes;
+#ifdef _WIN32
+ case VIO_TYPE_NAMEDPIPE:
+ bytes= vio_pending_pipe(vio);
+ return bytes;
+#endif
+ default:
+ return -1;
+ }
}
-#endif /* DBUG_OFF */
/**
Checks if the error code, returned by vio_getnameinfo(), means it was the
diff --git a/wsrep-lib b/wsrep-lib
-Subproject d0255569b0154e23c5461ed13928f9b0a18008e
+Subproject ae4e58ba031587039c8830f2f8ca51fa9fb7d6e