summaryrefslogtreecommitdiff
path: root/sql/sql_yacc_ora.yy
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-03-29 11:26:37 +0400
committerAlexander Barkov <bar@mariadb.com>2018-03-29 11:26:37 +0400
commit2a13b3db503dc130eb92d6b295c8dd035ea8d92b (patch)
treead7e801723bbe0c872c43c9a79ea95abf1d2b98b /sql/sql_yacc_ora.yy
parentb81a403e69feadc9896893ddcddc35e8a1f26cec (diff)
downloadmariadb-git-2a13b3db503dc130eb92d6b295c8dd035ea8d92b.tar.gz
MDEV-15714 Remove the use of STRING_ITEM from the parser
Diffstat (limited to 'sql/sql_yacc_ora.yy')
-rw-r--r--sql/sql_yacc_ora.yy30
1 files changed, 7 insertions, 23 deletions
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index bd1e47266b0..f357cc47903 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.yy
@@ -198,6 +198,7 @@ void ORAerror(THD *thd, const char *s)
Item *item;
Item_num *item_num;
Item_param *item_param;
+ Item_basic_constant *item_basic_constant;
Key_part_spec *key_part;
LEX *lex;
sp_assignment_lex *assignment_lex;
@@ -1156,7 +1157,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
replace_lock_option opt_low_priority insert_lock_option load_data_lock
%type <item>
- literal text_literal insert_ident order_ident temporal_literal
+ literal insert_ident order_ident temporal_literal
simple_ident expr sum_expr in_sum_expr
variable variable_aux bool_pri
predicate bit_expr parenthesized_expr
@@ -1189,6 +1190,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%type <item_num>
NUM_literal
+%type <item_basic_constant> text_literal
+
%type <item_list>
expr_list opt_udf_expr_list udf_expr_list when_list when_list_opt_else
ident_list ident_list_arg opt_expr_list
@@ -9727,27 +9730,8 @@ column_default_non_parenthesized_expr:
}
| '{' ident expr '}'
{
- $$= NULL;
- /*
- If "expr" is reasonably short pure ASCII string literal,
- try to parse known ODBC style date, time or timestamp literals,
- e.g:
- SELECT {d'2001-01-01'};
- SELECT {t'10:20:30'};
- SELECT {ts'2001-01-01 10:20:30'};
- */
- if ($3->type() == Item::STRING_ITEM)
- {
- Item_string *item= (Item_string *) $3;
- enum_field_types type= item->odbc_temporal_literal_type(&$2);
- if (type != MYSQL_TYPE_STRING)
- {
- $$= create_temporal_literal(thd, item->val_str(NULL),
- type, false);
- }
- }
- if ($$ == NULL)
- $$= $3;
+ if (!($$= $3->make_odbc_literal(thd, &$2)))
+ MYSQL_YYABORT;
}
| MATCH ident_list_arg AGAINST '(' bit_expr fulltext_options ')'
{
@@ -14404,7 +14388,7 @@ text_literal:
}
| text_literal TEXT_STRING_literal
{
- if (!($$= thd->make_string_literal_concat($1, $2)))
+ if (!($$= $1->make_string_literal_concat(thd, &$2)))
MYSQL_YYABORT;
}
;