mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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'.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user