Skip to content

Commit

Permalink
Allow "yes" keyword to be used as an identifier
Browse files Browse the repository at this point in the history
MySQL permits `yes` keyword to be used as an identifier.
  • Loading branch information
ramanenka committed Jul 24, 2024
1 parent 7953607 commit 66d9faa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions sql/mariadb/MariaDBParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -3199,6 +3199,7 @@ keywordsCanBeId
| XA
| XA_RECOVER_ADMIN
| XML
| YES
// MariaDB-specific only
| BINLOG_MONITOR
| BINLOG_REPLAY
Expand Down
1 change: 1 addition & 0 deletions sql/mariadb/examples/fast/ddl_alter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ alter table table1 add primary key (id);
alter table table1 add primary key table_pk (id);
alter table table1 add primary key `table_pk` (id);
alter table table1 add primary key `table_pk` (`id`);
alter table table1 add column yes varchar(255) default '' null;
alter table add_test add column if not exists col1 varchar(255);
alter table add_test add column if not exists col4 varchar(255);
alter table add_test add index if not exists ix_add_test_col1 using btree (col1) comment 'test index';
Expand Down
1 change: 1 addition & 0 deletions sql/mysql/Positive-Technologies/MySqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -3122,6 +3122,7 @@ keywordsCanBeId
| XA
| XA_RECOVER_ADMIN
| XML
| YES
;

functionNameBase
Expand Down
1 change: 1 addition & 0 deletions sql/mysql/Positive-Technologies/examples/ddl_alter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ alter table table1 add primary key `table_pk` (id);
alter table table1 add primary key `table_pk` (`id`);
alter table table1 drop foreign key fk_name;
alter table table1 drop constraint cons;
alter table table1 add column yes varchar(255) default '' null;
alter table add_test add column col1 int not null;
alter table `some_table` add (primary key `id` (`id`),`k_id` int unsigned not null,`another_field` smallint not null,index `k_id` (`k_id`));
alter table `some_table` add column (unique key `another_field` (`another_field`));
Expand Down

0 comments on commit 66d9faa

Please sign in to comment.