diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-07-25 14:34:37 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-08-27 16:59:12 +0200 |
commit | 73a220aac3842da0ab8d51fa9961a18b03c45001 (patch) | |
tree | 34b6e36c895c2b47c1e68a5b4a19ce5e0d3d1a76 /mysql-test/t/default.test | |
parent | eb9bce519d632104c49108bdf4021124add46f77 (diff) | |
download | mariadb-git-73a220aac3842da0ab8d51fa9961a18b03c45001.tar.gz |
session-state dependent functions in DEFAULT/CHECK/vcols
* revert part of the db7edfe that moved calculations from
fix_fields to val_str for Item_func_sysconst and descendants
* mark session state dependent functions in check_vcol_func_processor()
* re-run fix_fields for all such functions for every statement
* fix CURRENT_USER/CURRENT_ROLE not to use Name_resolution_context
(that is allocated on the stack in unpack_vcol_info_from_frm())
Note that NOW(), CURDATE(), etc use lazy initialization and do *not*
force fix_fields to be re-run. The rule is:
* lazy initialization is *not* allowed, if it changes metadata (so,
e.g. DAYNAME() cannot use it)
* lazy initialization is *preferrable* if it has side effects (e.g.
NOW() sets thd->time_zone_used=1, so it's better to do it when
the value of NOW is actually needed, not when NOW is simply prepared)
Diffstat (limited to 'mysql-test/t/default.test')
-rw-r--r-- | mysql-test/t/default.test | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 4981c2161e7..14eb16bacd4 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -817,29 +817,6 @@ INSERT INTO t1 VALUES (); SELECT * FROM t1; DROP TABLE t1; - ---echo # ---echo # Miscelaneous SQL standard <default option> variants ---echo # - ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -CREATE TABLE t1 (a VARCHAR(30) DEFAULT CURRENT_USER); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -CREATE TABLE t1 (a VARCHAR(30) DEFAULT CURRENT_ROLE); - ---echo # ---echo # Other Item_func_sysconst derived functions ---echo # -CREATE TABLE t1 (a VARCHAR(30) DEFAULT DATABASE()); -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES (); -USE INFORMATION_SCHEMA; -INSERT INTO test.t1 VALUES (); -USE test; -INSERT INTO t1 VALUES (); -SELECT * FROM t1; -DROP TABLE t1; - --echo # --echo # Check DEFAULT() function --echo # @@ -1010,9 +987,6 @@ INSERT INTO t1 VALUES ('01,5,2013','%d,%m,%Y', DEFAULT); SELECT * FROM t1; DROP TABLE t1; ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -CREATE TABLE t1 (a VARCHAR(30), b VARCHAR(30) DEFAULT DATE_FORMAT(a,'%W %M %Y')); - --echo # Item_datefunc SET time_zone='-10:00'; @@ -1221,7 +1195,6 @@ INSERT INTO t1 (a) VALUES ('1987-01-01'); SELECT * FROM t1; DROP TABLE t1; -# QQ: this depends on @@default_week_format. CREATE TABLE t1 (a DATE, b INT DEFAULT WEEK(a)); SHOW CREATE TABLE t1; INSERT INTO t1 (a) VALUES ('1987-02-01'); @@ -1240,12 +1213,6 @@ INSERT INTO t1 (a) VALUES ('2008-04-01'); SELECT * FROM t1; DROP TABLE t1; -# QQ: this depends on @@lc_time_names ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -CREATE TABLE t1 (a DATE, b VARCHAR(30) DEFAULT DAYNAME(a)); ---error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -CREATE TABLE t1 (a DATE, b VARCHAR(30) DEFAULT MONTHNAME(a)); - CREATE TABLE t1 (a DATE, b INT DEFAULT EXTRACT(YEAR FROM a)); SHOW CREATE TABLE t1; INSERT INTO t1 (a) VALUES ('2009-07-02'); @@ -1596,7 +1563,6 @@ INSERT INTO t1 (a) VALUES (64); SELECT * FROM t1; DROP TABLE t1; -# QQ: this depends on @@lc_time_names CREATE TABLE t1 (a INT, b INT, c VARCHAR(30) DEFAULT FORMAT(a,b)); SHOW CREATE TABLE t1; INSERT INTO t1 (a,b) VALUES (10000,3); |