Commit f9cdc748 authored by Alexander Barkov's avatar Alexander Barkov Committed by Sergei Golubchik

More test for MDEV-10134 Add full support for DEFAULT

UUID(), UUID_SHORT()
parent 6c626117
...@@ -1242,6 +1242,12 @@ SELECT * FROM t1; ...@@ -1242,6 +1242,12 @@ SELECT * FROM t1;
a b c a b c
a 97 97 a 97 97
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a TEXT DEFAULT UUID_SHORT());
INSERT INTO t1 VALUES ();
SELECT a>0 FROM t1;
a>0
1
DROP TABLE t1;
CREATE TABLE t1 (a INT DEFAULT BENCHMARK(1,1)); CREATE TABLE t1 (a INT DEFAULT BENCHMARK(1,1));
ERROR HY000: Function or expression 'benchmark' is not allowed for 'DEFAULT' of column/constraint 'a' ERROR HY000: Function or expression 'benchmark' is not allowed for 'DEFAULT' of column/constraint 'a'
CREATE TABLE t1 (a INT DEFAULT GET_LOCK('a',1)); CREATE TABLE t1 (a INT DEFAULT GET_LOCK('a',1));
...@@ -2026,6 +2032,12 @@ aaa 0 ...@@ -2026,6 +2032,12 @@ aaa 0
bbb 0 bbb 0
ccc 1 ccc 1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a TEXT DEFAULT UUID());
INSERT INTO t1 VALUES ();
SELECT LENGTH(a)>0 FROM t1;
LENGTH(a)>0
1
DROP TABLE t1;
# #
# Numeric result functions with string input # Numeric result functions with string input
# #
......
...@@ -959,6 +959,11 @@ INSERT INTO t1 (a) VALUES ('a'); ...@@ -959,6 +959,11 @@ INSERT INTO t1 (a) VALUES ('a');
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a TEXT DEFAULT UUID_SHORT());
INSERT INTO t1 VALUES ();
SELECT a>0 FROM t1;
DROP TABLE t1;
--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED --error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (a INT DEFAULT BENCHMARK(1,1)); CREATE TABLE t1 (a INT DEFAULT BENCHMARK(1,1));
...@@ -1607,6 +1612,11 @@ INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); ...@@ -1607,6 +1612,11 @@ INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc');
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a TEXT DEFAULT UUID());
INSERT INTO t1 VALUES ();
SELECT LENGTH(a)>0 FROM t1;
DROP TABLE t1;
--echo # --echo #
--echo # Numeric result functions with string input --echo # Numeric result functions with string input
--echo # --echo #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment