Hi, Alexey! On Mar 22, Alexey Botchkov wrote:
revision-id: 85058bf17953dc313731f4b22f0ec6037380f42b (mariadb-10.2.4-77-g85058bf) parent(s): 1ca8637ae35061d2567728a1c7aede11e68e5fff committer: Alexey Botchkov timestamp: 2017-03-22 01:31:47 +0400 message:
MDEV-9255 Add generation_expression to information_schema.columns.
Added IS_GENERATED and GENERATION_EXPRESSION columns required by the SQL standard.
Ouch, 1M for a commit email for a few-liner...
revision-id: 85058bf17953dc313731f4b22f0ec6037380f42b (mariadb-10.2.4-77-g85058bf) parent(s): 1ca8637ae35061d2567728a1c7aede11e68e5fff committer: Alexey Botchkov timestamp: 2017-03-22 01:31:47 +0400 message:
MDEV-9255 Add generation_expression to information_schema.columns.
diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result index 63c6e11..382a634 100644 --- a/mysql-test/suite/funcs_1/r/is_columns.result +++ b/mysql-test/suite/funcs_1/r/is_columns.result @@ -70,7 +72,9 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` ( `COLUMN_KEY` varchar(3) NOT NULL DEFAULT '', `EXTRA` varchar(30) NOT NULL DEFAULT '', `PRIVILEGES` varchar(80) NOT NULL DEFAULT '', - `COLUMN_COMMENT` varchar(1024) NOT NULL DEFAULT '' + `COLUMN_COMMENT` varchar(1024) NOT NULL DEFAULT '', + `IS_GENERATED` varchar(6) NOT NULL DEFAULT '', + `GENERATION_EXPRESSION` varchar(766) DEFAULT NULL
does it mean that longer expressions will be truncated? we suport up to 64K expressions. should this be SMALLTEXT or long varchar, perhaps?
) DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.COLUMNS; Field Type Null Key Default Extra diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test index 7ca50e6..1318abe 100644 --- a/mysql-test/suite/gcol/t/gcol_bugfixes.test +++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test @@ -536,3 +536,17 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; SELECT 1 FROM t WHERE c GROUP BY b; COMMIT; DROP TABLE t; + +--echo # +--echo # MDEV-9255 Add generation_expression to information_schema.columns. +--echo # + +CREATE TABLE gcol_t1 ( + sidea DOUBLE, + sideb DOUBLE, + sidec DOUBLE AS (SQRT(sidea * sidea + sideb * sideb)) +); + +SELECT * FROM information_schema.columns WHERE table_name='gcol_t1';
Great. Just one tiny detail - there is no gcol_bugfixes.result in your commit :)
+ +DROP TABLE gcol_t1;
Regards, Sergei Chief Architect MariaDB and security@mariadb.org