summaryrefslogtreecommitdiff
path: root/mysql-test/main/user_var-binlog.result
diff options
context:
space:
mode:
authorSujatha <sujatha.sivakumar@mariadb.com>2020-07-20 17:57:39 +0530
committerSujatha <sujatha.sivakumar@mariadb.com>2020-07-22 11:34:50 +0530
commitc86accc7ac9ea503dc7988e7921e58a9bf7b2f80 (patch)
treec2d81b769c6ce0257db9ffe7f4da6cd42242ab41 /mysql-test/main/user_var-binlog.result
parentb75563cdfd161e373480949ffa498bd4a8087b12 (diff)
downloadmariadb-git-c86accc7ac9ea503dc7988e7921e58a9bf7b2f80.tar.gz
MDEV-23108: Point in time recovery of binary log fails when sql_mode=ORACLE
Problem: ======== During point in time recovery of binary log syntax error is reported for BEGIN statement and recovery fails. Analysis: ========= In MariaDB 10.3 and later, setting the sql_mode system variable to Oracle allows the server to understand a subset of Oracle's PL/SQL language. When sql_mode=ORACLE is set, it switches the parser from the MariaDB parser to Oracle compatible parser. With this change 'BEGIN' is not considered as 'START TRANSACTION'. Hence the syntax error is reported. Fix: === At preset 'BEGIN' query is generated from 'Gtid_log_event::print'. The current session specific 'sql_mode' information is not present as part of 'Gtid_log_event'. If it was available then, mysqlbinlog tool can make use of 'sql_mode == ORACLE' and can output "START TRANSACTION" in this particular mode and for other sql_modes it will write "BEGIN" as part of output. Since it is not available 'mysqlbinlog' tool will output all 'BEGIN' statements as 'START TRANSACTION' irrespective of 'sql_mode'.
Diffstat (limited to 'mysql-test/main/user_var-binlog.result')
-rw-r--r--mysql-test/main/user_var-binlog.result4
1 files changed, 2 insertions, 2 deletions
diff --git a/mysql-test/main/user_var-binlog.result b/mysql-test/main/user_var-binlog.result
index 0d8732399c7..0a9fe956aee 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`/*!*/;