summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-09-28 14:01:17 +0300
committerunknown <sanja@montyprogram.com>2012-09-28 14:01:17 +0300
commit7327cd9717f0b98499f0f5b19c84e5e3e48241df (patch)
treef652710ef9b4e4f9709728f1bca3b01ee52fdfc9 /sql/sql_yacc.yy
parent4db207d56da2f832d8bc6cc1d935a17efcbc1035 (diff)
downloadmariadb-git-7327cd9717f0b98499f0f5b19c84e5e3e48241df.tar.gz
MDEV-377 Name support for dynamic columns
MDEV-127 Optimization of memory allocation MDEV-483 Make column_check function which cheсks dynamic columns integrit JSON conversion function
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy20
1 files changed, 19 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 4e3629080be..48dd47bccea 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -882,10 +882,12 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token COLLATION_SYM /* SQL-2003-N */
%token COLUMNS
%token COLUMN_ADD_SYM
+%token COLUMN_CHECK_SYM
%token COLUMN_CREATE_SYM
%token COLUMN_DELETE_SYM
%token COLUMN_EXISTS_SYM
%token COLUMN_GET_SYM
+%token COLUMN_JSON_SYM
%token COLUMN_LIST_SYM
%token COLUMN_SYM /* SQL-2003-R */
%token COLUMN_NAME_SYM /* SQL-2003-N */
@@ -8245,7 +8247,7 @@ dyncall_create_element:
alloc_root(YYTHD->mem_root, sizeof(DYNCALL_CREATE_DEF));
if ($$ == NULL)
MYSQL_YYABORT;
- $$->num= $1;
+ $$->key= $1;
$$->value= $3;
$$->type= (DYNAMIC_COLUMN_TYPE)$4;
$$->cs= lex->charset;
@@ -8799,6 +8801,13 @@ function_call_nonkeyword:
MYSQL_YYABORT;
}
|
+ COLUMN_CHECK_SYM '(' expr ')'
+ {
+ $$= new (YYTHD->mem_root) Item_func_dyncol_check($3);
+ if ($$ == NULL)
+ MYSQL_YYABORT;
+ }
+ |
COLUMN_EXISTS_SYM '(' expr ',' expr ')'
{
$$= new (YYTHD->mem_root) Item_func_dyncol_exists($3, $5);
@@ -8820,6 +8829,13 @@ function_call_nonkeyword:
MYSQL_YYABORT;
}
|
+ COLUMN_JSON_SYM '(' expr ')'
+ {
+ $$= create_func_dyncol_json(YYTHD, $3);
+ if ($$ == NULL)
+ MYSQL_YYABORT;
+ }
+ |
COLUMN_GET_SYM '(' expr ',' expr AS cast_type ')'
{
LEX *lex= Lex;
@@ -12908,10 +12924,12 @@ keyword:
| CHECKPOINT_SYM {}
| CLOSE_SYM {}
| COLUMN_ADD_SYM {}
+ | COLUMN_CHECK_SYM {}
| COLUMN_CREATE_SYM {}
| COLUMN_DELETE_SYM {}
| COLUMN_EXISTS_SYM {}
| COLUMN_GET_SYM {}
+ | COLUMN_JSON_SYM {}
| COLUMN_LIST_SYM {}
| COMMENT_SYM {}
| COMMIT_SYM {}