Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore setting m_lock_rows if lock_type == TL_IGNORE #871

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions mysql-test/suite/rocksdb/r/lock.result
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,18 @@ SELECT a,b FROM t1;
a b
UNLOCK TABLES;
DROP TABLE t1, t2;
CREATE TABLE t1 (i INT) ENGINE=MyISAM;
HANDLER t1 OPEN h;
CREATE TABLE t2 (i INT) ENGINE=RocksDB;
LOCK TABLES t2 WRITE;
connect con1,localhost,root,,test;
connection con1;
FLUSH TABLES WITH READ LOCK;
connection default;
INSERT INTO t2 VALUES (1);
UNLOCK TABLES;
HANDLER h CLOSE;
connection con1;
disconnect con1;
connection default;
DROP TABLE t1, t2;
22 changes: 22 additions & 0 deletions mysql-test/suite/rocksdb/t/lock.test
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,28 @@ SELECT a,b FROM t1;
UNLOCK TABLES;
DROP TABLE t1, t2;

CREATE TABLE t1 (i INT) ENGINE=MyISAM;
HANDLER t1 OPEN h;
CREATE TABLE t2 (i INT) ENGINE=RocksDB;
LOCK TABLES t2 WRITE;

--connect (con1,localhost,root,,test)
--connection con1
--send
FLUSH TABLES WITH READ LOCK;

--connection default
INSERT INTO t2 VALUES (1);
UNLOCK TABLES;
HANDLER h CLOSE;

--connection con1
--reap
--disconnect con1

--connection default
DROP TABLE t1, t2;

# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cleanup for the whole test file, as such, has to be moved below the newly added test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Expand Down
2 changes: 1 addition & 1 deletion storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10403,7 +10403,7 @@ THR_LOCK_DATA **ha_rocksdb::store_lock(THD *const thd, THR_LOCK_DATA **to,
m_lock_rows = RDB_LOCK_WRITE;
} else if (lock_type == TL_READ_WITH_SHARED_LOCKS) {
m_lock_rows = RDB_LOCK_READ;
} else {
} else if (lock_type != TL_IGNORE) {
m_lock_rows = RDB_LOCK_NONE;
if (THDVAR(thd, lock_scanned_rows)) {
/*
Expand Down