summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_yacc.yy')
-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