summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_misc.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/func_misc.test')
-rw-r--r--mysql-test/t/func_misc.test52
1 files changed, 36 insertions, 16 deletions
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index b874700f29d..f931352c0e2 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -627,7 +627,6 @@ select is_free_lock('test');
select is_used_lock('test') = connection_id();
connect (con1,localhost,root,,);
---echo # -> Switching to connection 'con1'
connection con1;
--echo # IS_USED_LOCK, IS_FREE_LOCK: the lock is acquired in another
--echo # connection
@@ -640,7 +639,6 @@ select get_lock('test', 0);
--echo # RELEASE_LOCK returns 0 if the lock belongs to another connection
select release_lock('test');
---echo # -> Switching to connection 'default'
connection default;
--echo # RELEASE_LOCK returns 1 if it successfully releases a lock
@@ -650,23 +648,19 @@ select release_lock('test');
--echo # Test that get_lock() returns NULL if error.
select get_lock('test', 0);
---echo # -> Switching to connection 'con1'
connection con1;
create table t1 select connection_id() as id;
send select get_lock('test', 7200);
---echo # -> Switching to connection 'default'
connection default;
let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state='User lock';
source include/wait_condition.inc;
select (@id := id) - id from t1;
kill query @id;
---echo # -> Switching to connection 'con1'
connection con1;
reap;
---echo # -> Switching to connection 'default'
connection default;
--echo # GET_LOCK() works recursively
@@ -696,12 +690,10 @@ select release_lock('test3');
--echo # Deadlocks are detected e.g. in case of a mutual wait
select get_lock('test1', 0);
---echo # -> Switching to connection 'con1'
connection con1;
select get_lock('test2', 0);
send select get_lock('test1', 7200);
---echo # -> Switching to connection 'default'
connection default;
let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state='User lock';
source include/wait_condition.inc;
@@ -710,13 +702,11 @@ select get_lock('test2', 7200);
select release_lock('test1');
---echo # -> Switching to connection 'con1'
connection con1;
reap;
select release_lock('test2');
select release_lock('test1');
---echo # -> Switching to connection 'default'
connection default;
--echo # LOCK/UNLOCK TABLES works fine with a user lock.
@@ -748,12 +738,10 @@ select release_lock('test2');
--echo # are detected OK.
select get_lock('test', 0);
---echo # -> Switching to connection 'con1'
connection con1;
lock table t1 write;
send select get_lock('test', 7200);
---echo # -> Switching to connection 'default'
connection default;
let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state = 'User lock';
source include/wait_condition.inc;
@@ -762,7 +750,6 @@ lock table t1 read;
select release_lock('test');
---echo # -> Switching to connection 'con1'
connection con1;
reap;
select release_lock('test');
@@ -1081,7 +1068,6 @@ DROP TABLE t2;
--echo # MDEV-4018 : Microseconds in GET_LOCK()
--echo #
---echo # -> Switching to connection 'default'
connection default;
select is_used_lock('test') = connection_id();
@@ -1089,7 +1075,6 @@ select is_used_lock('test') = connection_id();
select get_lock('test', 0);
connect (con1,localhost,root,,);
---echo # -> Switching to connection 'con1'
connection con1;
select is_used_lock('test') = connection_id();
select get_lock('test', 0);
@@ -1099,7 +1084,6 @@ select get_lock('test', 0.1);
select get_lock('test', 0.000001);
select get_lock('test', 0.0000000000000001);
---echo # -> Switching to connection 'default'
connection default;
select is_used_lock('test') = connection_id();
select release_lock('test');
@@ -1107,3 +1091,39 @@ select release_lock('test');
--echo
--echo # -- Done.
--echo
+
+--echo #
+--echo # Start of 10.2 tests
+--echo #
+
+--echo #
+--echo # MDEV-10134 Add full support for DEFAULT
+--echo #
+
+CREATE TABLE t1 (
+ a VARCHAR(30),
+ b BIGINT DEFAULT INET_ATON(a),
+ a1 VARCHAR(30) DEFAULT INET_NTOA(b),
+ c INT DEFAULT IS_IPV4(a),
+ d INT DEFAULT IS_IPV6(a)
+);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ str VARCHAR(128),
+ addr VARBINARY(16) DEFAULT INET6_ATON(str),
+ str1 VARCHAR(128) DEFAULT INET6_NTOA(addr),
+ b INT DEFAULT IS_IPV4_COMPAT(addr),
+ c INT DEFAULT IS_IPV4_MAPPED(addr)
+);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9');
+SELECT str, str1, b,c FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #