Commit 78357796 authored by Monty's avatar Monty

Added support for VISIBLE attribute for indexes in CREATE TABLE

MDEV-22199 Add VISIBLE attribute for indexes in CREATE TABLE

This was done to make it easier to read in dumps from MySQL 8.0 generated
with MySQL workbench
parent 91ffdc83
...@@ -2012,3 +2012,5 @@ CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAI ...@@ -2012,3 +2012,5 @@ CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAI
Warnings: Warnings:
Warning 1280 Name 'foo' ignored for PRIMARY key. Warning 1280 Name 'foo' ignored for PRIMARY key.
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (id1 INT, id2 INT, primary key (id1), unique index (id2) visible);
drop table t1;
...@@ -1873,3 +1873,9 @@ drop table t1; ...@@ -1873,3 +1873,9 @@ drop table t1;
CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAINT `bar` UNIQUE KEY(id2)); CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAINT `bar` UNIQUE KEY(id2));
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-22199 Add VISIBLE option for indexes in create table
#
CREATE TABLE t1 (id1 INT, id2 INT, primary key (id1), unique index (id2) visible);
drop table t1;
...@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1 ...@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
#################################### ####################################
SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long; SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
event_name digest digest_text sql_text event_name digest digest_text sql_text
statement/sql/select 230fd11f009a87fecbb87c9fc7361475 SELECT ? + ? + SELECT ... statement/sql/select beb5bd93b7e8c45bc5cb6060804988e8 SELECT ? + ? + SELECT ...
statement/sql/truncate faf6cefb662b443f05e97b5c5ab14a59 TRUNCATE TABLE truncat... statement/sql/truncate faf6cefb662b443f05e97b5c5ab14a59 TRUNCATE TABLE truncat...
...@@ -43,6 +43,9 @@ SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"}; ...@@ -43,6 +43,9 @@ SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};
NOTE! The symbol tables should be the same regardless of what features NOTE! The symbol tables should be the same regardless of what features
are compiled into the server. Don't add ifdef'ed symbols to the are compiled into the server. Don't add ifdef'ed symbols to the
lists lists
NOTE!!
If you add or delete symbols from this file, you must also update results for
the perfschema.start_server_low_digest_sql_length test!
*/ */
static SYMBOL symbols[] = { static SYMBOL symbols[] = {
...@@ -174,7 +177,7 @@ static SYMBOL symbols[] = { ...@@ -174,7 +177,7 @@ static SYMBOL symbols[] = {
{ "DAY_MICROSECOND", SYM(DAY_MICROSECOND_SYM)}, { "DAY_MICROSECOND", SYM(DAY_MICROSECOND_SYM)},
{ "DAY_MINUTE", SYM(DAY_MINUTE_SYM)}, { "DAY_MINUTE", SYM(DAY_MINUTE_SYM)},
{ "DAY_SECOND", SYM(DAY_SECOND_SYM)}, { "DAY_SECOND", SYM(DAY_SECOND_SYM)},
{ "DEALLOCATE", SYM(DEALLOCATE_SYM)}, { "DEALLOCATE", SYM(DEALLOCATE_SYM)},
{ "DEC", SYM(DECIMAL_SYM)}, { "DEC", SYM(DECIMAL_SYM)},
{ "DECIMAL", SYM(DECIMAL_SYM)}, { "DECIMAL", SYM(DECIMAL_SYM)},
{ "DECLARE", SYM(DECLARE_MARIADB_SYM)}, { "DECLARE", SYM(DECLARE_MARIADB_SYM)},
...@@ -705,6 +708,7 @@ static SYMBOL symbols[] = { ...@@ -705,6 +708,7 @@ static SYMBOL symbols[] = {
{ "VIA", SYM(VIA_SYM)}, { "VIA", SYM(VIA_SYM)},
{ "VIEW", SYM(VIEW_SYM)}, { "VIEW", SYM(VIEW_SYM)},
{ "VIRTUAL", SYM(VIRTUAL_SYM)}, { "VIRTUAL", SYM(VIRTUAL_SYM)},
{ "VISIBLE", SYM(VISIBLE_SYM)},
{ "VERSIONING", SYM(VERSIONING_SYM)}, { "VERSIONING", SYM(VERSIONING_SYM)},
{ "WAIT", SYM(WAIT_SYM)}, { "WAIT", SYM(WAIT_SYM)},
{ "WARNINGS", SYM(WARNINGS)}, { "WARNINGS", SYM(WARNINGS)},
...@@ -713,7 +717,7 @@ static SYMBOL symbols[] = { ...@@ -713,7 +717,7 @@ static SYMBOL symbols[] = {
{ "WHEN", SYM(WHEN_SYM)}, { "WHEN", SYM(WHEN_SYM)},
{ "WHERE", SYM(WHERE)}, { "WHERE", SYM(WHERE)},
{ "WHILE", SYM(WHILE_SYM)}, { "WHILE", SYM(WHILE_SYM)},
{ "WINDOW", SYM(WINDOW_SYM)}, { "WINDOW", SYM(WINDOW_SYM)},
{ "WITH", SYM(WITH)}, { "WITH", SYM(WITH)},
{ "WITHIN", SYM(WITHIN)}, { "WITHIN", SYM(WITHIN)},
{ "WITHOUT", SYM(WITHOUT)}, { "WITHOUT", SYM(WITHOUT)},
......
...@@ -1125,6 +1125,7 @@ End SQL_MODE_ORACLE_SPECIFIC */ ...@@ -1125,6 +1125,7 @@ End SQL_MODE_ORACLE_SPECIFIC */
%token <kwd> VERSIONING_SYM /* SQL-2011-R */ %token <kwd> VERSIONING_SYM /* SQL-2011-R */
%token <kwd> VIA_SYM %token <kwd> VIA_SYM
%token <kwd> VIEW_SYM /* SQL-2003-N */ %token <kwd> VIEW_SYM /* SQL-2003-N */
%token <kwd> VISIBLE_SYM /* MySQL 8.0 */
%token <kwd> VIRTUAL_SYM %token <kwd> VIRTUAL_SYM
%token <kwd> WAIT_SYM %token <kwd> WAIT_SYM
%token <kwd> WARNINGS %token <kwd> WARNINGS
...@@ -6997,6 +6998,10 @@ all_key_opt: ...@@ -6997,6 +6998,10 @@ all_key_opt:
} }
| COMMENT_SYM TEXT_STRING_sys | COMMENT_SYM TEXT_STRING_sys
{ Lex->last_key->key_create_info.comment= $2; } { Lex->last_key->key_create_info.comment= $2; }
| VISIBLE_SYM
{
/* This is mainly for MySQL 8.0 compatiblity */
}
| IDENT_sys equal TEXT_STRING_sys | IDENT_sys equal TEXT_STRING_sys
{ {
if (unlikely($3.length > ENGINE_OPTION_MAX_LENGTH)) if (unlikely($3.length > ENGINE_OPTION_MAX_LENGTH))
...@@ -15796,6 +15801,7 @@ keyword_sp_var_and_label: ...@@ -15796,6 +15801,7 @@ keyword_sp_var_and_label:
| VERSIONING_SYM | VERSIONING_SYM
| VIEW_SYM | VIEW_SYM
| VIRTUAL_SYM | VIRTUAL_SYM
| VISIBLE_SYM
| VALUE_SYM | VALUE_SYM
| WARNINGS | WARNINGS
| WAIT_SYM | WAIT_SYM
......
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