Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4235c133
Commit
4235c133
authored
Jul 31, 2023
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.4' into 10.5
parents
055f2e30
f182de2e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
181 additions
and
7 deletions
+181
-7
mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
+56
-0
mysql-test/suite/rpl/r/rpl_gtid_basic.result
mysql-test/suite/rpl/r/rpl_gtid_basic.result
+56
-0
mysql-test/suite/rpl/r/rpl_rotate_logs.result
mysql-test/suite/rpl/r/rpl_rotate_logs.result
+1
-0
mysql-test/suite/rpl/t/rpl_gtid_basic.test
mysql-test/suite/rpl/t/rpl_gtid_basic.test
+44
-0
mysql-test/suite/rpl/t/rpl_rotate_logs.test
mysql-test/suite/rpl/t/rpl_rotate_logs.test
+3
-0
mysql-test/suite/sys_vars/r/gtid_seq_no_basic.result
mysql-test/suite/sys_vars/r/gtid_seq_no_basic.result
+1
-0
mysql-test/suite/sys_vars/t/gtid_seq_no_basic.test
mysql-test/suite/sys_vars/t/gtid_seq_no_basic.test
+2
-0
sql/sys_vars.cc
sql/sys_vars.cc
+17
-7
tests/mysql_client_test.c
tests/mysql_client_test.c
+1
-0
No files found.
mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
View file @
4235c133
...
@@ -555,6 +555,62 @@ a
...
@@ -555,6 +555,62 @@ a
32
32
33
33
34
34
*** MDEV-31723: Crash on SET SESSION gtid_seq_no= DEFAULT
connection server_1;
SET SESSION gtid_seq_no= 2000;
SELECT @@SESSION.gtid_seq_no;
@@SESSION.gtid_seq_no
2000
INSERT INTO t1 VALUES (40);
SELECT @@SESSION.gtid_seq_no;
@@SESSION.gtid_seq_no
0
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2000
INSERT INTO t1 VALUES (41);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2001
SET SESSION gtid_seq_no= 2010;
INSERT INTO t1 VALUES (42);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2010
SET @old_strict= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
SET SESSION gtid_seq_no= 0;
INSERT INTO t1 VALUES (43);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2011
SET GLOBAL gtid_strict_mode= @old_strict;
INSERT INTO t1 VALUES (44);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2012
SET SESSION gtid_seq_no= 2020;
SET SESSION gtid_seq_no= 2030;
INSERT INTO t1 VALUES (45);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2030
SET SESSION gtid_seq_no= 2040;
SET SESSION gtid_seq_no= DEFAULT;
INSERT INTO t1 VALUES (46);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2031
INSERT INTO t1 VALUES (47);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2032
SET SESSION gtid_seq_no= 2050;
SET SESSION gtid_seq_no= 0;
INSERT INTO t1 VALUES (48);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2033
connection server_1;
connection server_1;
DROP TABLE t1;
DROP TABLE t1;
include/rpl_end.inc
include/rpl_end.inc
...
...
mysql-test/suite/rpl/r/rpl_gtid_basic.result
View file @
4235c133
...
@@ -554,6 +554,62 @@ a
...
@@ -554,6 +554,62 @@ a
32
32
33
33
34
34
*** MDEV-31723: Crash on SET SESSION gtid_seq_no= DEFAULT
connection server_1;
SET SESSION gtid_seq_no= 2000;
SELECT @@SESSION.gtid_seq_no;
@@SESSION.gtid_seq_no
2000
INSERT INTO t1 VALUES (40);
SELECT @@SESSION.gtid_seq_no;
@@SESSION.gtid_seq_no
0
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2000
INSERT INTO t1 VALUES (41);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2001
SET SESSION gtid_seq_no= 2010;
INSERT INTO t1 VALUES (42);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2010
SET @old_strict= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
SET SESSION gtid_seq_no= 0;
INSERT INTO t1 VALUES (43);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2011
SET GLOBAL gtid_strict_mode= @old_strict;
INSERT INTO t1 VALUES (44);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2012
SET SESSION gtid_seq_no= 2020;
SET SESSION gtid_seq_no= 2030;
INSERT INTO t1 VALUES (45);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2030
SET SESSION gtid_seq_no= 2040;
SET SESSION gtid_seq_no= DEFAULT;
INSERT INTO t1 VALUES (46);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2031
INSERT INTO t1 VALUES (47);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2032
SET SESSION gtid_seq_no= 2050;
SET SESSION gtid_seq_no= 0;
INSERT INTO t1 VALUES (48);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2033
connection server_1;
connection server_1;
DROP TABLE t1;
DROP TABLE t1;
include/rpl_end.inc
include/rpl_end.inc
...
...
mysql-test/suite/rpl/r/rpl_rotate_logs.result
View file @
4235c133
connect master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK;
connect slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK;
SET GLOBAL gtid_slave_pos= "";
connection slave;
connection slave;
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
start slave;
start slave;
...
...
mysql-test/suite/rpl/t/rpl_gtid_basic.test
View file @
4235c133
...
@@ -565,6 +565,50 @@ SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
...
@@ -565,6 +565,50 @@ SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
SELECT
*
FROM
t1
WHERE
a
>=
30
ORDER
BY
a
;
SELECT
*
FROM
t1
WHERE
a
>=
30
ORDER
BY
a
;
--
echo
***
MDEV
-
31723
:
Crash
on
SET
SESSION
gtid_seq_no
=
DEFAULT
--
connection
server_1
# Setting gtid_seq_no forces the GTID logged, but only once.
SET
SESSION
gtid_seq_no
=
2000
;
SELECT
@@
SESSION
.
gtid_seq_no
;
INSERT
INTO
t1
VALUES
(
40
);
SELECT
@@
SESSION
.
gtid_seq_no
;
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
INSERT
INTO
t1
VALUES
(
41
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
# Setting to 0 has no effect.
SET
SESSION
gtid_seq_no
=
2010
;
INSERT
INTO
t1
VALUES
(
42
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
SET
@
old_strict
=
@@
GLOBAL
.
gtid_strict_mode
;
SET
GLOBAL
gtid_strict_mode
=
1
;
SET
SESSION
gtid_seq_no
=
0
;
INSERT
INTO
t1
VALUES
(
43
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
SET
GLOBAL
gtid_strict_mode
=
@
old_strict
;
INSERT
INTO
t1
VALUES
(
44
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
# Setting gtid_seq_no multiple times.
SET
SESSION
gtid_seq_no
=
2020
;
SET
SESSION
gtid_seq_no
=
2030
;
INSERT
INTO
t1
VALUES
(
45
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
# Setting to DEFAULT or 0 disables prior setting.
SET
SESSION
gtid_seq_no
=
2040
;
SET
SESSION
gtid_seq_no
=
DEFAULT
;
INSERT
INTO
t1
VALUES
(
46
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
INSERT
INTO
t1
VALUES
(
47
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
SET
SESSION
gtid_seq_no
=
2050
;
SET
SESSION
gtid_seq_no
=
0
;
INSERT
INTO
t1
VALUES
(
48
);
SELECT
REGEXP_REPLACE
(
@@
gtid_binlog_pos
,
".*
\\
b(0-1-[0-9]+)
\\
b.*"
,
"
\\
1"
)
AS
dom0_pos
;
# Clean up.
# Clean up.
--
connection
server_1
--
connection
server_1
DROP
TABLE
t1
;
DROP
TABLE
t1
;
...
...
mysql-test/suite/rpl/t/rpl_rotate_logs.test
View file @
4235c133
...
@@ -20,6 +20,9 @@
...
@@ -20,6 +20,9 @@
connect
(
master
,
localhost
,
root
,,
test
,
$MASTER_MYPORT
,
$MASTER_MYSOCK
);
connect
(
master
,
localhost
,
root
,,
test
,
$MASTER_MYPORT
,
$MASTER_MYSOCK
);
connect
(
slave
,
localhost
,
root
,,
test
,
$SLAVE_MYPORT
,
$SLAVE_MYSOCK
);
connect
(
slave
,
localhost
,
root
,,
test
,
$SLAVE_MYPORT
,
$SLAVE_MYSOCK
);
# Reset the GTID position explicitly (since we're not using rpl_init.inc).
SET
GLOBAL
gtid_slave_pos
=
""
;
# Create empty file
# Create empty file
let
$MYSQLD_SLAVE_DATADIR
=
`select @@datadir`
;
let
$MYSQLD_SLAVE_DATADIR
=
`select @@datadir`
;
write_file
$MYSQLD_SLAVE_DATADIR
/
master
.
info
;
write_file
$MYSQLD_SLAVE_DATADIR
/
master
.
info
;
...
...
mysql-test/suite/sys_vars/r/gtid_seq_no_basic.result
View file @
4235c133
...
@@ -8,6 +8,7 @@ SELECT @@session.gtid_seq_no;
...
@@ -8,6 +8,7 @@ SELECT @@session.gtid_seq_no;
20
20
SET GLOBAL gtid_seq_no= DEFAULT;
SET GLOBAL gtid_seq_no= DEFAULT;
ERROR HY000: Variable 'gtid_seq_no' is a SESSION variable and can't be used with SET GLOBAL
ERROR HY000: Variable 'gtid_seq_no' is a SESSION variable and can't be used with SET GLOBAL
SET SESSION gtid_seq_no= DEFAULT;
SET SESSION gtid_seq_no= -1;
SET SESSION gtid_seq_no= -1;
Warnings:
Warnings:
Warning 1292 Truncated incorrect gtid_seq_no value: '-1'
Warning 1292 Truncated incorrect gtid_seq_no value: '-1'
...
...
mysql-test/suite/sys_vars/t/gtid_seq_no_basic.test
View file @
4235c133
...
@@ -9,5 +9,7 @@ SELECT @@session.gtid_seq_no;
...
@@ -9,5 +9,7 @@ SELECT @@session.gtid_seq_no;
--
error
ER_LOCAL_VARIABLE
--
error
ER_LOCAL_VARIABLE
SET
GLOBAL
gtid_seq_no
=
DEFAULT
;
SET
GLOBAL
gtid_seq_no
=
DEFAULT
;
SET
SESSION
gtid_seq_no
=
DEFAULT
;
SET
SESSION
gtid_seq_no
=
-
1
;
SET
SESSION
gtid_seq_no
=
-
1
;
SELECT
@@
session
.
gtid_seq_no
;
SELECT
@@
session
.
gtid_seq_no
;
sql/sys_vars.cc
View file @
4235c133
...
@@ -1800,6 +1800,13 @@ Sys_gtid_domain_id(
...
@@ -1800,6 +1800,13 @@ Sys_gtid_domain_id(
ON_CHECK
(
check_gtid_domain_id
));
ON_CHECK
(
check_gtid_domain_id
));
/*
Check that setting gtid_seq_no isn't done inside a transaction, and (in
gtid_strict_mode) doesn't create an out-of-order GTID sequence.
Setting gtid_seq_no to DEFAULT or 0 means we 'reset' it so that the value
doesn't affect the GTID of the next event group written to the binlog.
*/
static
bool
check_gtid_seq_no
(
sys_var
*
self
,
THD
*
thd
,
set_var
*
var
)
static
bool
check_gtid_seq_no
(
sys_var
*
self
,
THD
*
thd
,
set_var
*
var
)
{
{
uint32
domain_id
,
server_id
;
uint32
domain_id
,
server_id
;
...
@@ -1810,13 +1817,16 @@ static bool check_gtid_seq_no(sys_var *self, THD *thd, set_var *var)
...
@@ -1810,13 +1817,16 @@ static bool check_gtid_seq_no(sys_var *self, THD *thd, set_var *var)
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
)))
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
)))
return
true
;
return
true
;
domain_id
=
thd
->
variables
.
gtid_domain_id
;
DBUG_EXECUTE_IF
(
"ignore_set_gtid_seq_no_check"
,
return
false
;);
server_id
=
thd
->
variables
.
server_id
;
if
(
var
->
value
&&
opt_gtid_strict_mode
&&
opt_bin_log
)
seq_no
=
(
uint64
)
var
->
value
->
val_uint
();
{
DBUG_EXECUTE_IF
(
"ignore_set_gtid_seq_no_check"
,
return
0
;);
domain_id
=
thd
->
variables
.
gtid_domain_id
;
if
(
opt_gtid_strict_mode
&&
opt_bin_log
&&
server_id
=
thd
->
variables
.
server_id
;
mysql_bin_log
.
check_strict_gtid_sequence
(
domain_id
,
server_id
,
seq_no
))
seq_no
=
(
uint64
)
var
->
value
->
val_uint
();
return
true
;
if
(
seq_no
!=
0
&&
mysql_bin_log
.
check_strict_gtid_sequence
(
domain_id
,
server_id
,
seq_no
))
return
true
;
}
return
false
;
return
false
;
}
}
...
...
tests/mysql_client_test.c
View file @
4235c133
...
@@ -21616,6 +21616,7 @@ static void test_mdev_30159()
...
@@ -21616,6 +21616,7 @@ static void test_mdev_30159()
result
=
mysql_list_fields
(
mysql
,
"v1"
,
NULL
);
result
=
mysql_list_fields
(
mysql
,
"v1"
,
NULL
);
mytest
(
result
);
mytest
(
result
);
mysql_free_result
(
result
);
rc
=
mysql_query
(
mysql
,
"drop view v1"
);
rc
=
mysql_query
(
mysql
,
"drop view v1"
);
myquery
(
rc
);
myquery
(
rc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment