summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorantony@ltantony.dsl-verizon.net <>2004-04-28 16:14:53 +0100
committerantony@ltantony.dsl-verizon.net <>2004-04-28 16:14:53 +0100
commit28870228d4adee8b709a2f730b6bb00de6a0fd20 (patch)
tree6c92d4845efa916dd3e9c67a7bd1465826848af5 /sql
parent5c7d7364438d891090d116346d081406c586002f (diff)
downloadmariadb-git-28870228d4adee8b709a2f730b6bb00de6a0fd20.tar.gz
Fix for Bug 3481
CREATE statement allowed extra unnecessary commas
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_yacc.yy19
1 files changed, 15 insertions, 4 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 52334b4830e..2930c60310a 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -945,7 +945,7 @@ field_list_item:
;
column_def:
- field_spec check_constraint
+ field_spec opt_check_constraint
| field_spec references
{
Lex->col_list.empty(); /* Alloced by sql_alloc */
@@ -963,20 +963,31 @@ key_def:
{
Lex->col_list.empty(); /* Alloced by sql_alloc */
}
+ | constraint opt_check_constraint
+ {
+ Lex->col_list.empty(); /* Alloced by sql_alloc */
+ }
| opt_constraint check_constraint
{
Lex->col_list.empty(); /* Alloced by sql_alloc */
}
;
-check_constraint:
+opt_check_constraint:
/* empty */
- | CHECK_SYM expr
+ | check_constraint
+ ;
+
+check_constraint:
+ CHECK_SYM expr
;
opt_constraint:
/* empty */
- | CONSTRAINT opt_ident;
+ | constraint;
+
+constraint:
+ CONSTRAINT opt_ident;
field_spec:
field_ident