1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-4017 - GET_LOCK() with negative timeouts has strange behavior

GET_LOCK() silently accepted negative values and NULL for timeout.
Fixed GET_LOCK() to issue a warning and return NULL in such cases.
This commit is contained in:
Sergey Vojtovich
2015-07-23 12:50:58 +04:00
parent e40bc65933
commit 392df76bc3
6 changed files with 40 additions and 4 deletions

View File

@@ -242,7 +242,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
create table t0 (n int);
insert t0 select * from t1;
set autocommit=1;
insert into t0 select GET_LOCK("lock1",null);
insert into t0 select GET_LOCK("lock1",0);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
set autocommit=0;
@@ -288,7 +288,7 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert t0 select * from t1
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null)
master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",0)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti`