summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnel Husakovic <anel@mariadb.org>2019-07-31 03:28:38 -0700
committerAnel Husakovic <anel@mariadb.org>2019-08-14 05:57:28 -0700
commit712bfdde574807d3fc6684ec10902a74f438f66e (patch)
treecd34f1d8ced0c58cfe7e59d782f4e9ad9d1a1726
parent39db116562f7e5bdd4b8c5dbbdc21a06c7ae09ad (diff)
downloadmariadb-git-bb-10.3-anel-MDEV-20210-show_invisible.tar.gz
MDEV-20210 If you have an INVISIBLE VIRTUAL column, SHOW CREATE TABLE doesn't list it as INVISIBLEbb-10.3-anel-MDEV-20210-show_invisible
-rw-r--r--mysql-test/main/invisible_field_debug.result12
-rw-r--r--mysql-test/main/invisible_field_debug.test9
-rw-r--r--sql/sql_show.cc4
3 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/main/invisible_field_debug.result b/mysql-test/main/invisible_field_debug.result
index 0ea8ab12de8..6f85bd6dd88 100644
--- a/mysql-test/main/invisible_field_debug.result
+++ b/mysql-test/main/invisible_field_debug.result
@@ -376,3 +376,15 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index";
CREATE TABLE t2 LIKE t1;
SET debug_dbug= DEFAULT;
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;
diff --git a/mysql-test/main/invisible_field_debug.test b/mysql-test/main/invisible_field_debug.test
index 86252512386..a8e20247090 100644
--- a/mysql-test/main/invisible_field_debug.test
+++ b/mysql-test/main/invisible_field_debug.test
@@ -278,3 +278,12 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index";
CREATE TABLE t2 LIKE t1;
SET debug_dbug= DEFAULT;
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;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 1170aead53c..77eb51f6368 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2256,6 +2256,10 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN(" STORED"));
else
packet->append(STRING_WITH_LEN(" VIRTUAL"));
+ if (field->invisible == INVISIBLE_USER)
+ {
+ packet->append(STRING_WITH_LEN(" INVISIBLE"));
+ }
}
else
{