Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
cefef6a7
Commit
cefef6a7
authored
Nov 12, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17669 Add sql_mode specific tokens for the keyword DECLARE
parent
7f4aee22
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
19 deletions
+27
-19
sql/gen_lex_token.cc
sql/gen_lex_token.cc
+1
-1
sql/lex.h
sql/lex.h
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+20
-14
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+4
-3
No files found.
sql/gen_lex_token.cc
View file @
cefef6a7
...
...
@@ -33,7 +33,7 @@
from bison.
See also YYMAXUTOK.
*/
#define MY_MAX_TOKEN 1
0
00
#define MY_MAX_TOKEN 1
1
00
/** Generated token. */
struct
gen_lex_token_string
{
...
...
sql/lex.h
View file @
cefef6a7
...
...
@@ -176,7 +176,7 @@ static SYMBOL symbols[] = {
{
"DEALLOCATE"
,
SYM
(
DEALLOCATE_SYM
)},
{
"DEC"
,
SYM
(
DECIMAL_SYM
)},
{
"DECIMAL"
,
SYM
(
DECIMAL_SYM
)},
{
"DECLARE"
,
SYM
(
DECLARE_SYM
)},
{
"DECLARE"
,
SYM
(
DECLARE_
MARIADB_
SYM
)},
{
"DEFAULT"
,
SYM
(
DEFAULT
)},
{
"DEFINER"
,
SYM
(
DEFINER_SYM
)},
{
"DELAYED"
,
SYM
(
DELAYED_SYM
)},
...
...
sql/sql_lex.cc
View file @
cefef6a7
...
...
@@ -844,6 +844,7 @@ int Lex_input_stream::find_keyword(Lex_ident_cli_st *kwd,
case
BEGIN_MARIADB_SYM
:
return
BEGIN_ORACLE_SYM
;
case
BODY_MARIADB_SYM
:
return
BODY_ORACLE_SYM
;
case
CONTINUE_MARIADB_SYM
:
return
CONTINUE_ORACLE_SYM
;
case
DECLARE_MARIADB_SYM
:
return
DECLARE_ORACLE_SYM
;
case
DECODE_MARIADB_SYM
:
return
DECODE_ORACLE_SYM
;
case
ELSEIF_MARIADB_SYM
:
return
ELSEIF_ORACLE_SYM
;
case
ELSIF_MARIADB_SYM
:
return
ELSIF_ORACLE_SYM
;
...
...
sql/sql_yacc.yy
View file @
cefef6a7
...
...
@@ -967,7 +967,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token DAY_SECOND_SYM
%token DECIMAL_NUM
%token DECIMAL_SYM /* SQL-2003-R */
%token DECLARE_SYM /* SQL-2003-R */
%token DECLARE_MARIADB_SYM /* SQL-2003-R */
%token DECLARE_ORACLE_SYM /* Oracle-R */
%token DEFAULT /* SQL-2003-R */
%token DELETE_DOMAIN_ID_SYM
%token DELETE_SYM /* SQL-2003-R */
...
...
@@ -2149,6 +2150,7 @@ END_OF_INPUT
%type <num> sp_decl_idents sp_decl_idents_init_vars
%type <num> sp_handler_type sp_hcond_list
%type <spcondvalue> sp_cond sp_hcond sqlstate signal_value opt_signal_value
%type <spblock> sp_decl_handler
%type <spblock> sp_decls sp_decl sp_decl_body sp_decl_variable_list
%type <spname> sp_name
%type <spvar> sp_param_name sp_param_name_and_type
...
...
@@ -3503,7 +3505,7 @@ sp_decls:
;
sp_decl:
DECLARE_SYM sp_decl_body { $$= $2; }
DECLARE_
MARIADB_
SYM sp_decl_body { $$= $2; }
;
...
...
@@ -3619,18 +3621,7 @@ sp_decl_body:
$$.vars= $$.hndlrs= $$.curs= 0;
$$.conds= 1;
}
| sp_handler_type HANDLER_SYM FOR_SYM
{
if (unlikely(Lex->sp_handler_declaration_init(thd, $1)))
MYSQL_YYABORT;
}
sp_hcond_list sp_proc_stmt
{
if (unlikely(Lex->sp_handler_declaration_finalize(thd, $1)))
MYSQL_YYABORT;
$$.vars= $$.conds= $$.curs= 0;
$$.hndlrs= 1;
}
| sp_decl_handler
| sp_decl_ident CURSOR_SYM
{
Lex->sp_block_init(thd);
...
...
@@ -3648,6 +3639,21 @@ sp_decl_body:
}
;
sp_decl_handler:
sp_handler_type HANDLER_SYM FOR_SYM
{
if (unlikely(Lex->sp_handler_declaration_init(thd, $1)))
MYSQL_YYABORT;
}
sp_hcond_list sp_proc_stmt
{
if (unlikely(Lex->sp_handler_declaration_finalize(thd, $1)))
MYSQL_YYABORT;
$$.vars= $$.conds= $$.curs= 0;
$$.hndlrs= 1;
}
;
opt_parenthesized_cursor_formal_parameters:
/* Empty */
| '(' sp_fdparams ')'
...
...
sql/sql_yacc_ora.yy
View file @
cefef6a7
...
...
@@ -361,7 +361,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token DAY_SECOND_SYM
%token DECIMAL_NUM
%token DECIMAL_SYM /* SQL-2003-R */
%token DECLARE_SYM /* SQL-2003-R */
%token DECLARE_MARIADB_SYM /* SQL-2003-R */
%token DECLARE_ORACLE_SYM /* Oracle-R */
%token DEFAULT /* SQL-2003-R */
%token DELETE_DOMAIN_ID_SYM
%token DELETE_SYM /* SQL-2003-R */
...
...
@@ -4462,7 +4463,7 @@ sp_labeled_block:
MYSQL_YYABORT;
}
| sp_block_label
DECLARE_SYM
DECLARE_
ORACLE_
SYM
{
Lex->sp_block_init(thd, &$1);
}
...
...
@@ -4502,7 +4503,7 @@ sp_unlabeled_block:
if (unlikely(Lex->sp_block_finalize(thd, Lex_spblock($4))))
MYSQL_YYABORT;
}
| DECLARE_SYM
| DECLARE_
ORACLE_
SYM
{
if (unlikely(Lex->maybe_start_compound_statement(thd)))
MYSQL_YYABORT;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment