Commit 888f6852 authored by Anel Husakovic's avatar Anel Husakovic

MDEV-20210 If you have an INVISIBLE VIRTUAL column, SHOW CREATE TABLE doesn't list it as INVISIBLE

parent c93f96e2
...@@ -376,3 +376,15 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index"; ...@@ -376,3 +376,15 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index";
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SET debug_dbug= DEFAULT; SET debug_dbug= DEFAULT;
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# MDEV-20210
# If you have an INVISIBLE VIRTUAL column, SHOW CREATE TABLE doesn't list it as INVISIBLE
#
CREATE TABLE t1 (i INT, v int GENERATED ALWAYS AS (1) VIRTUAL INVISIBLE);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL,
`v` int(11) GENERATED ALWAYS AS (1) VIRTUAL INVISIBLE
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
...@@ -278,3 +278,12 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index"; ...@@ -278,3 +278,12 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index";
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SET debug_dbug= DEFAULT; SET debug_dbug= DEFAULT;
DROP TABLE t1, t2; DROP TABLE t1, t2;
--echo #
--echo # MDEV-20210
--echo # If you have an INVISIBLE VIRTUAL column, SHOW CREATE TABLE doesn't list it as INVISIBLE
--echo #
CREATE TABLE t1 (i INT, v int GENERATED ALWAYS AS (1) VIRTUAL INVISIBLE);
SHOW CREATE TABLE t1;
DROP TABLE t1;
...@@ -2256,6 +2256,10 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, ...@@ -2256,6 +2256,10 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN(" STORED")); packet->append(STRING_WITH_LEN(" STORED"));
else else
packet->append(STRING_WITH_LEN(" VIRTUAL")); packet->append(STRING_WITH_LEN(" VIRTUAL"));
if (field->invisible == INVISIBLE_USER)
{
packet->append(STRING_WITH_LEN(" INVISIBLE"));
}
} }
else else
{ {
......
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