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
eb472f77
Commit
eb472f77
authored
Jun 03, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in cluster"
This reverts commit
b05218e0
.
parent
0fd54c98
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
0 deletions
+97
-0
mysql-test/suite/galera/r/MDEV-24143.result
mysql-test/suite/galera/r/MDEV-24143.result
+23
-0
mysql-test/suite/galera/r/galera_bf_abort_get_lock.result
mysql-test/suite/galera/r/galera_bf_abort_get_lock.result
+18
-0
mysql-test/suite/galera/t/MDEV-24143.test
mysql-test/suite/galera/t/MDEV-24143.test
+20
-0
mysql-test/suite/galera/t/galera_bf_abort_get_lock.test
mysql-test/suite/galera/t/galera_bf_abort_get_lock.test
+36
-0
No files found.
mysql-test/suite/galera/r/MDEV-24143.result
0 → 100644
View file @
eb472f77
connection node_2;
connection node_1;
CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY (10), c3 DATETIME);
SELECT get_lock ('test2', 0);
get_lock ('test2', 0)
1
DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
SET SESSION wsrep_trx_fragment_size=10;
SET SESSION autocommit=0;
SELECT * FROM t1 WHERE c1 <=0 ORDER BY c1 DESC;
c1
INSERT INTO t1 VALUES (4),(3),(1),(2);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE;
ERROR 42S01: Table 't1' already exists
ALTER TABLE t1 DROP COLUMN c2;
ERROR 42000: Can't DROP COLUMN `c2`; check that it exists
SELECT get_lock ('test', 1.5);
get_lock ('test', 1.5)
1
DROP TABLE t1;
mysql-test/suite/galera/r/galera_bf_abort_get_lock.result
0 → 100644
View file @
eb472f77
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2a;
SELECT GET_LOCK("foo", 1000);
GET_LOCK("foo", 1000)
1
connection node_2;
SET AUTOCOMMIT=OFF;
INSERT INTO t1 VALUES (1);
SELECT GET_LOCK("foo", 1000);;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
mysql-test/suite/galera/t/MDEV-24143.test
0 → 100644
View file @
eb472f77
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_sequence
.
inc
CREATE
TABLE
t1
(
c1
BIGINT
NOT
NULL
PRIMARY
KEY
,
c2
BINARY
(
10
),
c3
DATETIME
);
SELECT
get_lock
(
'test2'
,
0
);
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
c1
SMALLINT
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
);
INSERT
INTO
t1
VALUES
(
1
);
SET
SESSION
wsrep_trx_fragment_size
=
10
;
SET
SESSION
autocommit
=
0
;
SELECT
*
FROM
t1
WHERE
c1
<=
0
ORDER
BY
c1
DESC
;
--
error
ER_LOCK_DEADLOCK
INSERT
INTO
t1
VALUES
(
4
),(
3
),(
1
),(
2
);
--
error
ER_TABLE_EXISTS_ERROR
CREATE
TABLE
t1
(
pk
INT
PRIMARY
KEY
,
b
INT
)
ENGINE
=
SEQUENCE
;
--
error
ER_CANT_DROP_FIELD_OR_KEY
ALTER
TABLE
t1
DROP
COLUMN
c2
;
SELECT
get_lock
(
'test'
,
1.5
);
DROP
TABLE
t1
;
mysql-test/suite/galera/t/galera_bf_abort_get_lock.test
0 → 100644
View file @
eb472f77
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
#
# Test a local transaction being aborted by a slave one while it is running a GET_LOCK()
#
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
)
ENGINE
=
InnoDB
;
--
let
$galera_connection_name
=
node_2a
--
let
$galera_server_number
=
2
--
source
include
/
galera_connect
.
inc
--
connection
node_2a
SELECT
GET_LOCK
(
"foo"
,
1000
);
--
connection
node_2
SET
AUTOCOMMIT
=
OFF
;
--
let
$wsrep_local_bf_aborts_before
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
INSERT
INTO
t1
VALUES
(
1
);
--
send
SELECT
GET_LOCK
(
"foo"
,
1000
);
--
connection
node_1
INSERT
INTO
t1
VALUES
(
1
);
--
connection
node_2
--
error
ER_LOCK_DEADLOCK
--
reap
--
let
$wsrep_local_bf_aborts_after
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
# Check that wsrep_local_bf_aborts has been incremented by exactly 1
--
disable_query_log
--
eval
SELECT
$wsrep_local_bf_aborts_after
-
$wsrep_local_bf_aborts_before
=
1
AS
wsrep_local_aborts_increment
;
--
enable_query_log
DROP
TABLE
t1
;
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