Skip to content

Commit da5c3e0

Browse files
author
Alexey Botchkov
committed
MDEV-9255 Add generation_expression to information_schema.columns.
Added IS_GENERATED and GENERATION_EXPRESSION columns required by the SQL standard
1 parent 93dd70c commit da5c3e0

16 files changed

+2709
-2556
lines changed

mysql-test/r/information_schema.result

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ Field Type Collation Null Key Default Extra Privileges Comment
222222
c varchar(64) utf8_general_ci NO select,insert,update,references
223223
select * from information_schema.COLUMNS where table_name="t1"
224224
and column_name= "a";
225-
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
226-
def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
225+
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
226+
def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
227227
show columns from mysqltest.t1 where field like "%a%";
228228
Field Type Null Key Default Extra
229229
a int(11) YES NULL
@@ -844,6 +844,7 @@ table_schema table_name column_name
844844
information_schema ALL_PLUGINS PLUGIN_DESCRIPTION
845845
information_schema COLUMNS COLUMN_DEFAULT
846846
information_schema COLUMNS COLUMN_TYPE
847+
information_schema COLUMNS GENERATION_EXPRESSION
847848
information_schema EVENTS EVENT_DEFINITION
848849
information_schema PARAMETERS DTD_IDENTIFIER
849850
information_schema PARTITIONS PARTITION_EXPRESSION
@@ -1577,9 +1578,9 @@ WHERE TABLE_SCHEMA='mysql' and TABLE_NAME= 'db';
15771578
TABLE_COLLATION
15781579
utf8_bin
15791580
select * from information_schema.columns where table_schema = NULL;
1580-
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
1581+
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
15811582
select * from `information_schema`.`COLUMNS` where `TABLE_NAME` = NULL;
1582-
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
1583+
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
15831584
select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_SCHEMA` = NULL;
15841585
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
15851586
select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_NAME` = NULL;
@@ -1920,7 +1921,7 @@ LEFT JOIN INFORMATION_SCHEMA.COLUMNS
19201921
USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME)
19211922
WHERE COLUMNS.TABLE_SCHEMA = 'test'
19221923
AND COLUMNS.TABLE_NAME = 't1';
1923-
TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
1924+
TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
19241925
#
19251926
# A test case for Bug#56540 "Exception (crash) in sql_show.cc
19261927
# during rqg_info_schema test on Windows"

mysql-test/r/information_schema_parameters.result

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ COLUMN_KEY
4444
EXTRA
4545
PRIVILEGES #
4646
COLUMN_COMMENT
47+
IS_GENERATED NEVER
48+
GENERATION_EXPRESSION NULL
4749
TABLE_CATALOG def
4850
TABLE_SCHEMA information_schema
4951
TABLE_NAME PARAMETERS
@@ -64,6 +66,8 @@ COLUMN_KEY
6466
EXTRA
6567
PRIVILEGES #
6668
COLUMN_COMMENT
69+
IS_GENERATED NEVER
70+
GENERATION_EXPRESSION NULL
6771
TABLE_CATALOG def
6872
TABLE_SCHEMA information_schema
6973
TABLE_NAME PARAMETERS
@@ -84,6 +88,8 @@ COLUMN_KEY
8488
EXTRA
8589
PRIVILEGES #
8690
COLUMN_COMMENT
91+
IS_GENERATED NEVER
92+
GENERATION_EXPRESSION NULL
8793
TABLE_CATALOG def
8894
TABLE_SCHEMA information_schema
8995
TABLE_NAME PARAMETERS
@@ -104,6 +110,8 @@ COLUMN_KEY
104110
EXTRA
105111
PRIVILEGES #
106112
COLUMN_COMMENT
113+
IS_GENERATED NEVER
114+
GENERATION_EXPRESSION NULL
107115
TABLE_CATALOG def
108116
TABLE_SCHEMA information_schema
109117
TABLE_NAME PARAMETERS
@@ -124,6 +132,8 @@ COLUMN_KEY
124132
EXTRA
125133
PRIVILEGES #
126134
COLUMN_COMMENT
135+
IS_GENERATED NEVER
136+
GENERATION_EXPRESSION NULL
127137
TABLE_CATALOG def
128138
TABLE_SCHEMA information_schema
129139
TABLE_NAME PARAMETERS
@@ -144,6 +154,8 @@ COLUMN_KEY
144154
EXTRA
145155
PRIVILEGES #
146156
COLUMN_COMMENT
157+
IS_GENERATED NEVER
158+
GENERATION_EXPRESSION NULL
147159
TABLE_CATALOG def
148160
TABLE_SCHEMA information_schema
149161
TABLE_NAME PARAMETERS
@@ -164,6 +176,8 @@ COLUMN_KEY
164176
EXTRA
165177
PRIVILEGES #
166178
COLUMN_COMMENT
179+
IS_GENERATED NEVER
180+
GENERATION_EXPRESSION NULL
167181
TABLE_CATALOG def
168182
TABLE_SCHEMA information_schema
169183
TABLE_NAME PARAMETERS
@@ -184,6 +198,8 @@ COLUMN_KEY
184198
EXTRA
185199
PRIVILEGES #
186200
COLUMN_COMMENT
201+
IS_GENERATED NEVER
202+
GENERATION_EXPRESSION NULL
187203
TABLE_CATALOG def
188204
TABLE_SCHEMA information_schema
189205
TABLE_NAME PARAMETERS
@@ -204,6 +220,8 @@ COLUMN_KEY
204220
EXTRA
205221
PRIVILEGES #
206222
COLUMN_COMMENT
223+
IS_GENERATED NEVER
224+
GENERATION_EXPRESSION NULL
207225
TABLE_CATALOG def
208226
TABLE_SCHEMA information_schema
209227
TABLE_NAME PARAMETERS
@@ -224,6 +242,8 @@ COLUMN_KEY
224242
EXTRA
225243
PRIVILEGES #
226244
COLUMN_COMMENT
245+
IS_GENERATED NEVER
246+
GENERATION_EXPRESSION NULL
227247
TABLE_CATALOG def
228248
TABLE_SCHEMA information_schema
229249
TABLE_NAME PARAMETERS
@@ -244,6 +264,8 @@ COLUMN_KEY
244264
EXTRA
245265
PRIVILEGES #
246266
COLUMN_COMMENT
267+
IS_GENERATED NEVER
268+
GENERATION_EXPRESSION NULL
247269
TABLE_CATALOG def
248270
TABLE_SCHEMA information_schema
249271
TABLE_NAME PARAMETERS
@@ -264,6 +286,8 @@ COLUMN_KEY
264286
EXTRA
265287
PRIVILEGES #
266288
COLUMN_COMMENT
289+
IS_GENERATED NEVER
290+
GENERATION_EXPRESSION NULL
267291
TABLE_CATALOG def
268292
TABLE_SCHEMA information_schema
269293
TABLE_NAME PARAMETERS
@@ -284,6 +308,8 @@ COLUMN_KEY
284308
EXTRA
285309
PRIVILEGES #
286310
COLUMN_COMMENT
311+
IS_GENERATED NEVER
312+
GENERATION_EXPRESSION NULL
287313
TABLE_CATALOG def
288314
TABLE_SCHEMA information_schema
289315
TABLE_NAME PARAMETERS
@@ -304,6 +330,8 @@ COLUMN_KEY
304330
EXTRA
305331
PRIVILEGES #
306332
COLUMN_COMMENT
333+
IS_GENERATED NEVER
334+
GENERATION_EXPRESSION NULL
307335
TABLE_CATALOG def
308336
TABLE_SCHEMA information_schema
309337
TABLE_NAME PARAMETERS
@@ -324,6 +352,8 @@ COLUMN_KEY
324352
EXTRA
325353
PRIVILEGES #
326354
COLUMN_COMMENT
355+
IS_GENERATED NEVER
356+
GENERATION_EXPRESSION NULL
327357
TABLE_CATALOG def
328358
TABLE_SCHEMA information_schema
329359
TABLE_NAME PARAMETERS
@@ -344,6 +374,8 @@ COLUMN_KEY
344374
EXTRA
345375
PRIVILEGES #
346376
COLUMN_COMMENT
377+
IS_GENERATED NEVER
378+
GENERATION_EXPRESSION NULL
347379
DESCRIBE INFORMATION_SCHEMA.PARAMETERS;
348380
Field Type Null Key Default Extra
349381
SPECIFIC_CATALOG varchar(512) NO

0 commit comments

Comments
 (0)