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
c2e0e5af
Commit
c2e0e5af
authored
Mar 07, 2007
by
kostja@bodhi.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into bodhi.local:/opt/local/work/mysql-5.0-26750
parents
82c1c023
86f02cd3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
523 additions
and
425 deletions
+523
-425
sql/log_event.cc
sql/log_event.cc
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+0
-12
sql/sql_class.cc
sql/sql_class.cc
+14
-18
sql/sql_class.h
sql/sql_class.h
+38
-16
sql/sql_lex.cc
sql/sql_lex.cc
+30
-0
sql/sql_lex.h
sql/sql_lex.h
+4
-0
sql/sql_parse.cc
sql/sql_parse.cc
+7
-27
sql/sql_prepare.cc
sql/sql_prepare.cc
+32
-18
sql/sql_trigger.cc
sql/sql_trigger.cc
+2
-5
sql/sql_yacc.yy
sql/sql_yacc.yy
+394
-327
No files found.
sql/log_event.cc
View file @
c2e0e5af
...
...
@@ -3114,8 +3114,8 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
ex
.
skip_lines
=
skip_lines
;
List
<
Item
>
field_list
;
thd
->
main_lex
.
select_lex
.
context
.
resolve_in_table_list_only
(
&
tables
);
set_fields
(
tables
.
db
,
field_list
,
&
thd
->
main_lex
.
select_lex
.
context
);
thd
->
lex
->
select_lex
.
context
.
resolve_in_table_list_only
(
&
tables
);
set_fields
(
tables
.
db
,
field_list
,
&
thd
->
lex
->
select_lex
.
context
);
thd
->
variables
.
pseudo_thread_id
=
thread_id
;
if
(
net
)
{
...
...
sql/mysqld.cc
View file @
c2e0e5af
...
...
@@ -1598,18 +1598,6 @@ static void network_init(void)
#endif
/*!EMBEDDED_LIBRARY*/
void
MYSQLerror
(
const
char
*
s
)
{
THD
*
thd
=
current_thd
;
char
*
yytext
=
(
char
*
)
thd
->
lex
->
tok_start
;
/* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */
if
(
strcmp
(
s
,
"parse error"
)
==
0
||
strcmp
(
s
,
"syntax error"
)
==
0
)
s
=
ER
(
ER_SYNTAX_ERROR
);
my_printf_error
(
ER_PARSE_ERROR
,
ER
(
ER_PARSE_ERROR
),
MYF
(
0
),
s
,
(
yytext
?
(
char
*
)
yytext
:
""
),
thd
->
lex
->
yylineno
);
}
#ifndef EMBEDDED_LIBRARY
/*
...
...
sql/sql_class.cc
View file @
c2e0e5af
...
...
@@ -166,14 +166,10 @@ Open_tables_state::Open_tables_state(ulong version_arg)
}
/*
Pass nominal parameters to Statement constructor only to ensure that
the destructor works OK in case of error. The main_mem_root will be
re-initialized in init().
*/
THD
::
THD
()
:
Statement
(
CONVENTIONAL_EXECUTION
,
0
,
ALLOC_ROOT_MIN_BLOCK_SIZE
,
0
),
:
Statement
(
&
main_lex
,
&
main_mem_root
,
CONVENTIONAL_EXECUTION
,
/* statement id */
0
),
Open_tables_state
(
refresh_version
),
lock_id
(
&
main_lock_id
),
user_time
(
0
),
in_sub_stmt
(
0
),
global_read_lock
(
0
),
is_fatal_error
(
0
),
...
...
@@ -184,6 +180,12 @@ THD::THD()
{
ulong
tmp
;
/*
Pass nominal parameters to init_alloc_root only to ensure that
the destructor works OK in case of an error. The main_mem_root
will be re-initialized in init_for_queries().
*/
init_sql_alloc
(
&
main_mem_root
,
ALLOC_ROOT_MIN_BLOCK_SIZE
,
0
);
stmt_arena
=
this
;
thread_stack
=
0
;
db
=
0
;
...
...
@@ -475,6 +477,7 @@ THD::~THD()
#ifndef DBUG_OFF
dbug_sentry
=
THD_SENTRY_GONE
;
#endif
free_root
(
&
main_mem_root
,
MYF
(
0
));
DBUG_VOID_RETURN
;
}
...
...
@@ -1613,18 +1616,17 @@ void Query_arena::cleanup_stmt()
Statement functions
*/
Statement
::
Statement
(
enum
enum_state
state_arg
,
ulong
id
_arg
,
ulong
alloc_block_size
,
ulong
prealloc_size
)
:
Query_arena
(
&
main_mem_root
,
state_arg
),
Statement
::
Statement
(
LEX
*
lex_arg
,
MEM_ROOT
*
mem_root
_arg
,
enum
enum_state
state_arg
,
ulong
id_arg
)
:
Query_arena
(
mem_root_arg
,
state_arg
),
id
(
id_arg
),
set_query_id
(
1
),
lex
(
&
main_lex
),
lex
(
lex_arg
),
query
(
0
),
query_length
(
0
),
cursor
(
0
)
{
name
.
str
=
NULL
;
init_sql_alloc
(
&
main_mem_root
,
alloc_block_size
,
prealloc_size
);
}
...
...
@@ -1666,7 +1668,7 @@ void Statement::restore_backup_statement(Statement *stmt, Statement *backup)
void
THD
::
end_statement
()
{
/* Cleanup SQL processing state to re
s
use this statement in next query. */
/* Cleanup SQL processing state to reuse this statement in next query. */
lex_end
(
lex
);
delete
lex
->
result
;
lex
->
result
=
0
;
...
...
@@ -1707,12 +1709,6 @@ void THD::restore_active_arena(Query_arena *set, Query_arena *backup)
Statement
::~
Statement
()
{
/*
We must free `main_mem_root', not `mem_root' (pointer), to work
correctly if this statement is used as a backup statement,
for which `mem_root' may point to some other statement.
*/
free_root
(
&
main_mem_root
,
MYF
(
0
));
}
C_MODE_START
...
...
sql/sql_class.h
View file @
c2e0e5af
...
...
@@ -753,8 +753,10 @@ class Query_arena
class
Server_side_cursor
;
/*
State of a single command executed against this connection.
/**
@class Statement
@brief State of a single command executed against this connection.
One connection can contain a lot of simultaneously running statements,
some of which could be:
- prepared, that is, contain placeholders,
...
...
@@ -772,10 +774,6 @@ class Statement: public ilink, public Query_arena
Statement
(
const
Statement
&
rhs
);
/* not implemented: */
Statement
&
operator
=
(
const
Statement
&
rhs
);
/* non-copyable */
public:
/* FIXME: these must be protected */
MEM_ROOT
main_mem_root
;
LEX
main_lex
;
/*
Uniquely identifies each statement object in thread scope; change during
statement lifetime. FIXME: must be const
...
...
@@ -819,10 +817,10 @@ class Statement: public ilink, public Query_arena
public:
/* This constructor is called for backup statements */
Statement
()
{
clear_alloc_root
(
&
main_mem_root
);
}
Statement
()
{}
Statement
(
enum
enum_state
state_arg
,
ulong
id
_arg
,
ulong
alloc_block_size
,
ulong
prealloc_size
);
Statement
(
LEX
*
lex_arg
,
MEM_ROOT
*
mem_root
_arg
,
enum
enum_state
state_arg
,
ulong
id_arg
);
virtual
~
Statement
();
/* Assign execution context (note: not all members) of given stmt to self */
...
...
@@ -834,7 +832,7 @@ class Statement: public ilink, public Query_arena
};
/*
/*
*
Container for all statements created/used in a connection.
Statements in Statement_map have unique Statement::id (guaranteed by id
assignment in Statement::Statement)
...
...
@@ -914,6 +912,10 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state);
bool
xid_cache_insert
(
XID_STATE
*
xid_state
);
void
xid_cache_delete
(
XID_STATE
*
xid_state
);
/**
@class Security_context
@brief A set of THD members describing the current authenticated user.
*/
class
Security_context
{
public:
...
...
@@ -943,7 +945,7 @@ class Security_context {
};
/*
/*
*
A registry for item tree transformations performed during
query optimization. We register only those changes which require
a rollback to re-execute a prepared statement or stored procedure
...
...
@@ -954,7 +956,7 @@ struct Item_change_record;
typedef
I_List
<
Item_change_record
>
Item_change_list
;
/*
/*
*
Type of prelocked mode.
See comment for THD::prelocked_mode for complete description.
*/
...
...
@@ -963,7 +965,7 @@ enum prelocked_mode_type {NON_PRELOCKED= 0, PRELOCKED= 1,
PRELOCKED_UNDER_LOCK_TABLES
=
2
};
/*
/*
*
Class that holds information about tables which were opened and locked
by the thread. It is also used to save/restore this information in
push_open_tables_state()/pop_open_tables_state().
...
...
@@ -1048,14 +1050,17 @@ class Open_tables_state
}
};
/* class to save context when executing a function or trigger */
/**
@class Sub_statement_state
@brief Used to save context when executing a function or trigger
*/
/* Defines used for Sub_statement_state::in_sub_stmt */
#define SUB_STMT_TRIGGER 1
#define SUB_STMT_FUNCTION 2
class
Sub_statement_state
{
public:
...
...
@@ -1114,7 +1119,8 @@ class Internal_error_handler
};
/*
/**
@class THD
For each client connection we create a separate thread with THD serving as
a thread/connection descriptor
*/
...
...
@@ -1726,6 +1732,22 @@ class THD :public Statement,
private
:
/** The current internal error handler for this thread, or NULL. */
Internal_error_handler
*
m_internal_handler
;
/**
The lex to hold the parsed tree of conventional (non-prepared) queries.
Whereas for prepared and stored procedure statements we use an own lex
instance for each new query, for conventional statements we reuse
the same lex. (@see mysql_parse for details).
*/
LEX
main_lex
;
/**
This memory root is used for two purposes:
- for conventional queries, to allocate structures stored in main_lex
during parsing, and allocate runtime data (execution plan, etc.)
during execution.
- for prepared queries, only to allocate runtime data. The parsed
tree itself is reused between executions and thus is stored elsewhere.
*/
MEM_ROOT
main_mem_root
;
}
;
...
...
sql/sql_lex.cc
View file @
c2e0e5af
...
...
@@ -1648,6 +1648,36 @@ void st_select_lex::print_limit(THD *thd, String *str)
}
}
/**
@brief Restore the LEX and THD in case of a parse error.
This is a clean up call that is invoked by the Bison generated
parser before returning an error from MYSQLparse. If your
semantic actions manipulate with the global thread state (which
is a very bad practice and should not normally be employed) and
need a clean-up in case of error, and you can not use %destructor
rule in the grammar file itself, this function should be used
to implement the clean up.
*/
void
st_lex
::
cleanup_lex_after_parse_error
(
THD
*
thd
)
{
/*
Delete sphead for the side effect of restoring of the original
LEX state, thd->lex, thd->mem_root and thd->free_list if they
were replaced when parsing stored procedure statements. We
will never use sphead object after a parse error, so it's okay
to delete it only for the sake of the side effect.
TODO: make this functionality explicit in sp_head class.
Sic: we must nullify the member of the main lex, not the
current one that will be thrown away
*/
if
(
thd
->
lex
->
sphead
);
{
delete
thd
->
lex
->
sphead
;
thd
->
lex
->
sphead
=
NULL
;
}
}
/*
Initialize (or reset) Query_tables_list object.
...
...
sql/sql_lex.h
View file @
c2e0e5af
...
...
@@ -1182,6 +1182,10 @@ typedef struct st_lex : public Query_tables_list
{
return
context_stack
.
head
();
}
/*
Restore the LEX and THD in case of a parse error.
*/
static
void
cleanup_lex_after_parse_error
(
THD
*
thd
);
void
reset_n_backup_query_tables_list
(
Query_tables_list
*
backup
);
void
restore_backup_query_tables_list
(
Query_tables_list
*
backup
);
...
...
sql/sql_parse.cc
View file @
c2e0e5af
...
...
@@ -4506,9 +4506,6 @@ mysql_execute_command(THD *thd)
clean up the environment.
*/
create_sp_error:
lex
->
unit
.
cleanup
();
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
if
(
sp_result
!=
SP_OK
)
goto
error
;
send_ok
(
thd
);
...
...
@@ -4879,9 +4876,6 @@ mysql_execute_command(THD *thd)
/* Conditionally writes to binlog. */
res
=
mysql_create_or_drop_trigger
(
thd
,
all_tables
,
1
);
/* We don't care about trigger body after this point */
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
break
;
}
case
SQLCOM_DROP_TRIGGER
:
...
...
@@ -5904,15 +5898,7 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
else
#endif
{
if
(
thd
->
net
.
report_error
)
{
if
(
thd
->
lex
->
sphead
)
{
delete
thd
->
lex
->
sphead
;
thd
->
lex
->
sphead
=
NULL
;
}
}
else
if
(
!
thd
->
net
.
report_error
)
{
/*
Binlog logs a string starting from thd->query and having length
...
...
@@ -5932,7 +5918,6 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
query_cache_end_of_result
(
thd
);
}
}
lex
->
unit
.
cleanup
();
}
else
{
...
...
@@ -5940,19 +5925,14 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
DBUG_PRINT
(
"info"
,(
"Command aborted. Fatal_error: %d"
,
thd
->
is_fatal_error
));
/*
The first thing we do after parse error is freeing sp_head to
ensure that we have restored original memroot.
*/
if
(
thd
->
lex
->
sphead
)
{
/* Clean up after failed stored procedure/function */
delete
thd
->
lex
->
sphead
;
thd
->
lex
->
sphead
=
NULL
;
}
query_cache_abort
(
&
thd
->
net
);
lex
->
unit
.
cleanup
();
}
if
(
thd
->
lex
->
sphead
)
{
delete
thd
->
lex
->
sphead
;
thd
->
lex
->
sphead
=
0
;
}
lex
->
unit
.
cleanup
();
thd
->
proc_info
=
"freeing items"
;
thd
->
end_statement
();
thd
->
cleanup_after_query
();
...
...
sql/sql_prepare.cc
View file @
c2e0e5af
...
...
@@ -99,9 +99,12 @@ class Select_fetch_protocol_prep: public select_send
#endif
};
/******************************************************************************
Prepared_statement: a statement that can contain placeholders
******************************************************************************/
/****************************************************************************/
/**
@class Prepared_statement
@brief Prepared_statement: a statement that can contain placeholders
*/
class
Prepared_statement
:
public
Statement
{
...
...
@@ -141,6 +144,16 @@ class Prepared_statement: public Statement
bool
execute
(
String
*
expanded_query
,
bool
open_cursor
);
/* Destroy this statement */
bool
deallocate
();
private:
/**
Store the parsed tree of a prepared statement here.
*/
LEX
main_lex
;
/**
The memory root to allocate parsed tree elements (instances of Item,
SELECT_LEX and other classes).
*/
MEM_ROOT
main_mem_root
;
};
...
...
@@ -2034,6 +2047,7 @@ void mysql_sql_stmt_prepare(THD *thd)
delete
stmt
;
DBUG_VOID_RETURN
;
}
if
(
thd
->
stmt_map
.
insert
(
thd
,
stmt
))
{
/* The statement is deleted and an error is set if insert fails */
...
...
@@ -2629,17 +2643,18 @@ Select_fetch_protocol_prep::send_data(List<Item> &fields)
****************************************************************************/
Prepared_statement
::
Prepared_statement
(
THD
*
thd_arg
,
Protocol
*
protocol_arg
)
:
Statement
(
INITIALIZED
,
++
thd_arg
->
statement_id_counter
,
thd_arg
->
variables
.
query_alloc_block_size
,
thd_arg
->
variables
.
query_prealloc_size
),
:
Statement
(
&
main_lex
,
&
main_mem_root
,
INITIALIZED
,
++
thd_arg
->
statement_id_counter
),
thd
(
thd_arg
),
result
(
thd_arg
),
protocol
(
protocol_arg
),
param_array
(
0
),
param_count
(
0
),
last_errno
(
0
),
flags
((
uint
)
IS_IN_USE
)
flags
((
uint
)
IS_IN_USE
)
{
init_alloc_root
(
&
main_mem_root
,
thd_arg
->
variables
.
query_alloc_block_size
,
thd_arg
->
variables
.
query_prealloc_size
);
*
last_error
=
'\0'
;
}
...
...
@@ -2688,6 +2703,7 @@ Prepared_statement::~Prepared_statement()
*/
free_items
();
delete
lex
->
result
;
free_root
(
&
main_mem_root
,
MYF
(
0
));
DBUG_VOID_RETURN
;
}
...
...
@@ -2703,6 +2719,7 @@ void Prepared_statement::cleanup_stmt()
DBUG_ENTER
(
"Prepared_statement::cleanup_stmt"
);
DBUG_PRINT
(
"enter"
,(
"stmt: %p"
,
this
));
DBUG_ASSERT
(
lex
->
sphead
==
0
);
/* The order is important */
lex
->
unit
.
cleanup
();
cleanup_items
(
free_list
);
...
...
@@ -2789,15 +2806,6 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
error
=
MYSQLparse
((
void
*
)
thd
)
||
thd
->
is_fatal_error
||
thd
->
net
.
report_error
||
init_param_array
(
this
);
/*
The first thing we do after parse error is freeing sp_head to
ensure that we have restored original memroot.
*/
if
(
error
&&
lex
->
sphead
)
{
delete
lex
->
sphead
;
lex
->
sphead
=
NULL
;
}
/*
While doing context analysis of the query (in check_prepared_statement)
we allocate a lot of additional memory: for open tables, JOINs, derived
...
...
@@ -2823,12 +2831,18 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
if
(
error
==
0
)
error
=
check_prepared_statement
(
this
,
name
.
str
!=
0
);
/* Free sp_head if check_prepared_statement() failed. */
if
(
error
&&
lex
->
sphead
)
/*
Currently CREATE PROCEDURE/TRIGGER/EVENT are prohibited in prepared
statements: ensure we have no memory leak here if by someone tries
to PREPARE stmt FROM "CREATE PROCEDURE ..."
*/
DBUG_ASSERT
(
lex
->
sphead
==
NULL
||
error
!=
0
);
if
(
lex
->
sphead
)
{
delete
lex
->
sphead
;
lex
->
sphead
=
NULL
;
}
lex_end
(
lex
);
cleanup_stmt
();
thd
->
restore_backup_statement
(
this
,
&
stmt_backup
);
...
...
sql/sql_trigger.cc
View file @
c2e0e5af
...
...
@@ -983,11 +983,8 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
thd
->
spcont
=
0
;
if
(
MYSQLparse
((
void
*
)
thd
)
||
thd
->
is_fatal_error
)
{
/*
Free lex associated resources.
QQ: Do we really need all this stuff here ?
*/
delete
lex
.
sphead
;
/* Currently sphead is always deleted in case of a parse error */
DBUG_ASSERT
(
lex
.
sphead
==
0
);
goto
err_with_lex_cleanup
;
}
...
...
sql/sql_yacc.yy
View file @
c2e0e5af
...
...
@@ -52,11 +52,18 @@ const LEX_STRING null_lex_str={0,0};
ER_WARN_DEPRECATED_SYNTAX, \
ER(ER_WARN_DEPRECATED_SYNTAX), (A), (B));
#define YYABORT_UNLESS(A) \
#define MYSQL_YYABORT \
do \
{ \
LEX::cleanup_lex_after_parse_error(YYTHD);\
YYABORT; \
} while (0)
#define MYSQL_YYABORT_UNLESS(A) \
if (!(A)) \
{
\
yyerror(ER(ER_SYNTAX_ERROR));
\
YYABORT;
\
{
\
my_parse_error(ER(ER_SYNTAX_ERROR));
\
MYSQL_YYABORT;
\
}
#ifndef DBUG_OFF
...
...
@@ -65,6 +72,66 @@ const LEX_STRING null_lex_str={0,0};
#define YYDEBUG 0
#endif
/**
@brief Push an error message into MySQL error stack with line
and position information.
This function provides semantic action implementers with a way
to push the famous "You have a syntax error near..." error
message into the error stack, which is normally produced only if
a parse error is discovered internally by the Bison generated
parser.
*/
void my_parse_error(const char *s)
{
THD *thd= current_thd;
char *yytext= (char*) thd->lex->tok_start;
/* Push an error into the error stack */
my_printf_error(ER_PARSE_ERROR, ER(ER_PARSE_ERROR), MYF(0), s,
(yytext ? (char*) yytext : ""),
thd->lex->yylineno);
}
/**
@brief Bison callback to report a syntax/OOM error
This function is invoked by the bison-generated parser
when a syntax error, a parse error or an out-of-memory
condition occurs. This function is not invoked when the
parser is requested to abort by semantic action code
by means of YYABORT or YYACCEPT macros. This is why these
macros should not be used (use MYSQL_YYABORT/MYSQL_YYACCEPT
instead).
The parser will abort immediately after invoking this callback.
This function is not for use in semantic actions and is internal to
the parser, as it performs some pre-return cleanup.
In semantic actions, please use my_parse_error or my_error to
push an error into the error stack and MYSQL_YYABORT
to abort from the parser.
*/
void MYSQLerror(const char *s)
{
THD *thd= current_thd;
/*
Restore the original LEX if it was replaced when parsing
a stored procedure. We must ensure that a parsing error
does not leave any side effects in the THD.
*/
LEX::cleanup_lex_after_parse_error(thd);
/* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */
if (strcmp(s,"parse error") == 0 || strcmp(s,"syntax error") == 0)
s= ER(ER_SYNTAX_ERROR);
my_parse_error(s);
}
#ifndef DBUG_OFF
void turn_parser_debug_on()
{
...
...
@@ -1138,7 +1205,7 @@ query:
(!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT)))
{
my_message(ER_EMPTY_QUERY, ER(ER_EMPTY_QUERY), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -1210,8 +1277,8 @@ deallocate:
LEX *lex= thd->lex;
if (lex->stmt_prepare_mode)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
lex->prepared_stmt_name= $3;
...
...
@@ -1230,8 +1297,8 @@ prepare:
LEX *lex= thd->lex;
if (lex->stmt_prepare_mode)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_PREPARE;
lex->prepared_stmt_name= $2;
...
...
@@ -1260,8 +1327,8 @@ execute:
LEX *lex= thd->lex;
if (lex->stmt_prepare_mode)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_EXECUTE;
lex->prepared_stmt_name= $2;
...
...
@@ -1285,7 +1352,7 @@ execute_var_ident: '@' ident_or_text
LEX *lex=Lex;
LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&$2, sizeof(LEX_STRING));
if (!lexstr || lex->prepared_stmt_params.push_back(lexstr))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -1297,7 +1364,7 @@ help:
if (Lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "HELP");
YYABORT;
MYSQL_
YYABORT;
}
}
ident_or_text
...
...
@@ -1424,7 +1491,7 @@ create:
(using_update_log ?
TL_READ_NO_INSERT:
TL_READ)))
YYABORT;
MYSQL_
YYABORT;
lex->alter_info.reset();
lex->col_list.empty();
lex->change=NullS;
...
...
@@ -1442,7 +1509,7 @@ create:
lex->sql_command= SQLCOM_CREATE_INDEX;
if (!lex->current_select->add_table_to_list(lex->thd, $7, NULL,
TL_OPTION_UPDATING))
YYABORT;
MYSQL_
YYABORT;
lex->alter_info.reset();
lex->alter_info.flags= ALTER_ADD_INDEX;
lex->col_list.empty();
...
...
@@ -1503,12 +1570,12 @@ sp_name:
if (!$1.str || check_db_name($1.str))
{
my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
if (check_routine_name($3))
{
my_error(ER_SP_WRONG_NAME, MYF(0), $3.str);
YYABORT;
MYSQL_
YYABORT;
}
$$= new sp_name($1, $3);
$$->init_qname(YYTHD);
...
...
@@ -1520,10 +1587,10 @@ sp_name:
if (check_routine_name($1))
{
my_error(ER_SP_WRONG_NAME, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
if (thd->copy_db_to(&db.str, &db.length))
YYABORT;
MYSQL_
YYABORT;
$$= new sp_name(db, $1);
if ($$)
$$->init_qname(YYTHD);
...
...
@@ -1543,7 +1610,7 @@ create_function_tail:
and is considered a parsing error.
*/
my_error(ER_WRONG_USAGE, MYF(0), "SONAME", "DEFINER");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_CREATE_FUNCTION;
lex->udf.name = lex->spname->m_name;
...
...
@@ -1562,13 +1629,13 @@ create_function_tail:
if (lex->udf.type == UDFTYPE_AGGREGATE)
{
my_error(ER_SP_NO_AGGREGATE, MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
if (lex->sphead)
{
my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
YYABORT;
MYSQL_
YYABORT;
}
/* Order is important here: new - reset - init */
sp= new sp_head();
...
...
@@ -1609,7 +1676,7 @@ create_function_tail:
if (sp->fill_field_definition(YYTHD, lex,
(enum enum_field_types) $8,
&sp->m_return_field_def))
YYABORT;
MYSQL_
YYABORT;
bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
}
...
...
@@ -1626,14 +1693,14 @@ create_function_tail:
sp_head *sp= lex->sphead;
if (sp->is_not_allowed_in_function("function"))
YYABORT;
MYSQL_
YYABORT;
lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
sp->init_strings(YYTHD, lex);
if (!(sp->m_flags & sp_head::HAS_RETURN))
{
my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str);
YYABORT;
MYSQL_
YYABORT;
}
/* Restore flag if it was cleared above */
if (sp->m_old_cmq)
...
...
@@ -1763,7 +1830,7 @@ sp_fdparam:
if (spc->find_variable(&$1, TRUE))
{
my_error(ER_SP_DUP_PARAM, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
sp_variable_t *spvar= spc->push_variable(&$1,
(enum enum_field_types)$3,
...
...
@@ -1773,7 +1840,7 @@ sp_fdparam:
(enum enum_field_types) $3,
&spvar->field_def))
{
YYABORT;
MYSQL_
YYABORT;
}
spvar->field_def.field_name= spvar->name.str;
spvar->field_def.pack_flag |= FIELDFLAG_MAYBE_NULL;
...
...
@@ -1800,7 +1867,7 @@ sp_pdparam:
if (spc->find_variable(&$3, TRUE))
{
my_error(ER_SP_DUP_PARAM, MYF(0), $3.str);
YYABORT;
MYSQL_
YYABORT;
}
sp_variable_t *spvar= spc->push_variable(&$3,
(enum enum_field_types)$4,
...
...
@@ -1810,7 +1877,7 @@ sp_pdparam:
(enum enum_field_types) $4,
&spvar->field_def))
{
YYABORT;
MYSQL_
YYABORT;
}
spvar->field_def.field_name= spvar->name.str;
spvar->field_def.pack_flag |= FIELDFLAG_MAYBE_NULL;
...
...
@@ -1849,13 +1916,13 @@ sp_decls:
{ /* Variable or condition following cursor or handler */
my_message(ER_SP_VARCOND_AFTER_CURSHNDLR,
ER(ER_SP_VARCOND_AFTER_CURSHNDLR), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
if ($2.curs && $1.hndlrs)
{ /* Cursor following handler */
my_message(ER_SP_CURSOR_AFTER_HANDLER,
ER(ER_SP_CURSOR_AFTER_HANDLER), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
$$.vars= $1.vars + $2.vars;
$$.conds= $1.conds + $2.conds;
...
...
@@ -1893,7 +1960,7 @@ sp_decl:
sp_variable_t *spvar= pctx->find_variable(var_idx);
if (!spvar)
YYABORT;
MYSQL_
YYABORT;
spvar->type= var_type;
spvar->dflt= dflt_value_item;
...
...
@@ -1901,7 +1968,7 @@ sp_decl:
if (lex->sphead->fill_field_definition(YYTHD, lex, var_type,
&spvar->field_def))
{
YYABORT;
MYSQL_
YYABORT;
}
spvar->field_def.field_name= spvar->name.str;
...
...
@@ -1929,7 +1996,7 @@ sp_decl:
if (spc->find_cond(&$2, TRUE))
{
my_error(ER_SP_DUP_COND, MYF(0), $2.str);
YYABORT;
MYSQL_
YYABORT;
}
YYTHD->lex->spcont->push_cond(&$2, $5);
$$.vars= $$.hndlrs= $$.curs= 0;
...
...
@@ -1987,7 +2054,7 @@ sp_decl:
{
my_error(ER_SP_DUP_CURS, MYF(0), $2.str);
delete $5;
YYABORT;
MYSQL_
YYABORT;
}
i= new sp_instr_cpush(sp->instructions(), ctx, $5,
ctx->current_cursor_count());
...
...
@@ -2015,13 +2082,13 @@ sp_cursor_stmt:
{
my_message(ER_SP_BAD_CURSOR_QUERY, ER(ER_SP_BAD_CURSOR_QUERY),
MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
if (lex->result)
{
my_message(ER_SP_BAD_CURSOR_SELECT, ER(ER_SP_BAD_CURSOR_SELECT),
MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
lex->sp_lex_in_use= TRUE;
$$= lex;
...
...
@@ -2045,7 +2112,7 @@ sp_hcond_list:
if (ctx->find_handler($1))
{
my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2066,7 +2133,7 @@ sp_hcond_list:
if (ctx->find_handler($3))
{
my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2092,7 +2159,7 @@ sp_cond:
if (!sp_cond_check(&$3))
{
my_error(ER_SP_BAD_SQLSTATE, MYF(0), $3.str);
YYABORT;
MYSQL_
YYABORT;
}
$$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
$$->type= sp_cond_type_t::state;
...
...
@@ -2117,7 +2184,7 @@ sp_hcond:
if ($$ == NULL)
{
my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
}
| SQLWARNING_SYM /* SQLSTATEs 01??? */
...
...
@@ -2148,7 +2215,7 @@ sp_decl_idents:
if (spc->find_variable(&$1, TRUE))
{
my_error(ER_SP_DUP_VAR, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
spc->push_variable(&$1, (enum_field_types)0, sp_param_in);
$$= 1;
...
...
@@ -2163,7 +2230,7 @@ sp_decl_idents:
if (spc->find_variable(&$3, TRUE))
{
my_error(ER_SP_DUP_VAR, MYF(0), $3.str);
YYABORT;
MYSQL_
YYABORT;
}
spc->push_variable(&$3, (enum_field_types)0, sp_param_in);
$$= $1 + 1;
...
...
@@ -2191,7 +2258,7 @@ sp_proc_stmt:
if (lex->sql_command == SQLCOM_CHANGE_DB)
{ /* "USE db" doesn't work in a procedure */
my_error(ER_SP_BADSTATEMENT, MYF(0), "USE");
YYABORT;
MYSQL_
YYABORT;
}
/*
Don't add an instruction for SET statements, since all
...
...
@@ -2231,7 +2298,7 @@ sp_proc_stmt:
if (sp->m_type != TYPE_ENUM_FUNCTION)
{
my_message(ER_SP_BADRETURN, ER(ER_SP_BADRETURN), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2272,7 +2339,7 @@ sp_proc_stmt:
if (! lab)
{
my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", $2.str);
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2301,7 +2368,7 @@ sp_proc_stmt:
if (! lab || lab->type != SP_LAB_ITER)
{
my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", $2.str);
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2329,7 +2396,7 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
YYABORT;
MYSQL_
YYABORT;
}
i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
sp->add_instr(i);
...
...
@@ -2344,7 +2411,7 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$3, &offset))
{
my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $3.str);
YYABORT;
MYSQL_
YYABORT;
}
i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
sp->add_instr(i);
...
...
@@ -2361,7 +2428,7 @@ sp_proc_stmt:
if (! lex->spcont->find_cursor(&$2, &offset))
{
my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
YYABORT;
MYSQL_
YYABORT;
}
i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
sp->add_instr(i);
...
...
@@ -2385,7 +2452,7 @@ sp_fetch_list:
if (!spc || !(spv = spc->find_variable(&$1)))
{
my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2406,7 +2473,7 @@ sp_fetch_list:
if (!spc || !(spv = spc->find_variable(&$3)))
{
my_error(ER_SP_UNDECLARED_VAR, MYF(0), $3.str);
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2475,7 +2542,7 @@ simple_case_stmt:
{
LEX *lex= Lex;
if (case_stmt_action_expr(lex, $3))
YYABORT;
MYSQL_
YYABORT;
lex->sphead->restore_lex(YYTHD); /* For expr $3 */
}
...
...
@@ -2578,7 +2645,7 @@ sp_labeled_control:
if (lab)
{
my_error(ER_SP_LABEL_REDEFINE, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -2599,7 +2666,7 @@ sp_labeled_control:
my_strcasecmp(system_charset_info, $5.str, lab->name) != 0)
{
my_error(ER_SP_LABEL_MISMATCH, MYF(0), $5.str);
YYABORT;
MYSQL_
YYABORT;
}
}
lex->sphead->backpatch(lex->spcont->pop_label());
...
...
@@ -2716,11 +2783,11 @@ create2:
LEX *lex=Lex;
THD *thd= lex->thd;
if (!(lex->name= (char *)$2))
YYABORT;
MYSQL_
YYABORT;
if ($2->db.str == NULL &&
thd->copy_db_to(&($2->db.str), &($2->db.length)))
{
YYABORT;
MYSQL_
YYABORT;
}
}
| '(' LIKE table_ident ')'
...
...
@@ -2728,11 +2795,11 @@ create2:
LEX *lex=Lex;
THD *thd= lex->thd;
if (!(lex->name= (char *)$3))
YYABORT;
MYSQL_
YYABORT;
if ($3->db.str == NULL &&
thd->copy_db_to(&($3->db.str), &($3->db.length)))
{
YYABORT;
MYSQL_
YYABORT;
}
}
;
...
...
@@ -2844,8 +2911,8 @@ create_table_option:
Lex->create_info.table_options|= HA_OPTION_PACK_KEYS;
break;
default:
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;
}
...
...
@@ -2861,17 +2928,17 @@ create_table_option:
| RAID_TYPE opt_equal raid_types
{
my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_TYPE", "PARTITION");
YYABORT;
MYSQL_
YYABORT;
}
| RAID_CHUNKS opt_equal ulong_num
{
my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_CHUNKS", "PARTITION");
YYABORT;
MYSQL_
YYABORT;
}
| RAID_CHUNKSIZE opt_equal ulong_num
{
my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_CHUNKSIZE", "PARTITION");
YYABORT;
MYSQL_
YYABORT;
}
| UNION_SYM opt_equal '(' table_list ')'
{
...
...
@@ -2907,7 +2974,7 @@ default_charset:
my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
"CHARACTER SET ", cinfo->default_table_charset->csname,
"CHARACTER SET ", $4->csname);
YYABORT;
MYSQL_
YYABORT;
}
Lex->create_info.default_table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
...
...
@@ -2923,7 +2990,7 @@ default_collation:
{
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
$4->name, cinfo->default_table_charset->csname);
YYABORT;
MYSQL_
YYABORT;
}
Lex->create_info.default_table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
...
...
@@ -2935,7 +3002,7 @@ storage_engines:
$$ = ha_resolve_by_name($1.str,$1.length);
if ($$ == DB_TYPE_UNKNOWN) {
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
};
...
...
@@ -3070,7 +3137,7 @@ field_spec:
&lex->comment,
lex->change,&lex->interval_list,lex->charset,
lex->uint_geom_type))
YYABORT;
MYSQL_
YYABORT;
};
type:
...
...
@@ -3139,7 +3206,7 @@ type:
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
MYSQL_
YYABORT;
#endif
}
| MEDIUMBLOB { Lex->charset=&my_charset_bin;
...
...
@@ -3300,7 +3367,7 @@ attribute:
{
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
$2->name,Lex->charset->csname);
YYABORT;
MYSQL_
YYABORT;
}
else
{
...
...
@@ -3325,7 +3392,7 @@ charset_name:
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
}
| BINARY { $$= &my_charset_bin; }
...
...
@@ -3347,7 +3414,7 @@ old_or_new_charset_name:
!($$=get_old_charset_by_name($1.str)))
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
}
| BINARY { $$= &my_charset_bin; }
...
...
@@ -3363,7 +3430,7 @@ collation_name:
if (!($$=get_charset_by_name($1.str,MYF(0))))
{
my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
};
...
...
@@ -3390,7 +3457,7 @@ opt_binary:
MY_CS_PRIMARY,MYF(0))))
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
YYABORT;
MYSQL_
YYABORT;
}
}
| charset charset_name opt_bin_mod { Lex->charset=$2; }
...
...
@@ -3409,7 +3476,7 @@ opt_bin_charset:
MY_CS_PRIMARY,MYF(0))))
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
YYABORT;
MYSQL_
YYABORT;
}
}
| charset charset_name { Lex->charset=$2; } ;
...
...
@@ -3472,7 +3539,7 @@ key_type:
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
MYSQL_
YYABORT;
#endif
};
...
...
@@ -3505,7 +3572,7 @@ opt_unique_or_fulltext:
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
MYSQL_
YYABORT;
#endif
}
;
...
...
@@ -3565,7 +3632,7 @@ alter:
lex->duplicates= DUP_ERROR;
if (!lex->select_lex.add_table_to_list(thd, $4, NULL,
TL_OPTION_UPDATING))
YYABORT;
MYSQL_
YYABORT;
lex->col_list.empty();
lex->select_lex.init_order();
lex->select_lex.db=
...
...
@@ -3591,7 +3658,7 @@ alter:
lex->sql_command=SQLCOM_ALTER_DB;
lex->name= $3;
if (lex->name == NULL && thd->copy_db_to(&lex->name, NULL))
YYABORT;
MYSQL_
YYABORT;
}
| ALTER PROCEDURE sp_name
{
...
...
@@ -3600,7 +3667,7 @@ alter:
if (lex->sphead)
{
my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
YYABORT;
MYSQL_
YYABORT;
}
bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
}
...
...
@@ -3618,7 +3685,7 @@ alter:
if (lex->sphead)
{
my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
YYABORT;
MYSQL_
YYABORT;
}
bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
}
...
...
@@ -3697,7 +3764,7 @@ alter_list_item:
&lex->comment,
$3.str, &lex->interval_list, lex->charset,
lex->uint_geom_type))
YYABORT;
MYSQL_
YYABORT;
}
opt_place
| DROP opt_column field_ident opt_restrict
...
...
@@ -3758,13 +3825,13 @@ alter_list_item:
if (lex->select_lex.db == NULL &&
thd->copy_db_to(&lex->select_lex.db, NULL))
{
YYABORT;
MYSQL_
YYABORT;
}
if (check_table_name($3->table.str,$3->table.length) ||
$3->db.str && check_db_name($3->db.str))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
YYABORT;
MYSQL_
YYABORT;
}
lex->name= $3->table.str;
lex->alter_info.flags|= ALTER_RENAME;
...
...
@@ -3781,7 +3848,7 @@ alter_list_item:
{
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
$5->name, $4->csname);
YYABORT;
MYSQL_
YYABORT;
}
LEX *lex= Lex;
lex->create_info.table_charset=
...
...
@@ -3919,7 +3986,7 @@ slave_until:
{
my_message(ER_BAD_SLAVE_UNTIL_COND,
ER(ER_BAD_SLAVE_UNTIL_COND), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
}
...
...
@@ -4011,7 +4078,7 @@ check:
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "CHECK");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_CHECK;
lex->check_opt.init();
...
...
@@ -4071,12 +4138,12 @@ rename_list:
user TO_SYM user
{
if (Lex->users_list.push_back($1) || Lex->users_list.push_back($3))
YYABORT;
MYSQL_
YYABORT;
}
| rename_list ',' user TO_SYM user
{
if (Lex->users_list.push_back($3) || Lex->users_list.push_back($5))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -4093,7 +4160,7 @@ table_to_table:
TL_IGNORE) ||
!sl->add_table_to_list(lex->thd, $3,NULL,TL_OPTION_UPDATING,
TL_IGNORE))
YYABORT;
MYSQL_
YYABORT;
};
keycache:
...
...
@@ -4118,7 +4185,7 @@ assign_to_keycache:
TL_READ,
sel->get_use_index(),
(List<String> *)0))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -4150,7 +4217,7 @@ preload_keys:
TL_READ,
sel->get_use_index(),
(List<String> *)0))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -4205,16 +4272,16 @@ select_paren:
SELECT_LEX * sel= lex->current_select;
if (sel->set_braces(1))
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
if (sel->linkage == UNION_TYPE &&
!sel->master_unit()->first_select()->braces &&
sel->master_unit()->first_select()->linkage ==
UNION_TYPE)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
/* select in braces, can't contain global parameters */
if (sel->master_unit()->fake_select_lex)
...
...
@@ -4230,14 +4297,14 @@ select_init2:
SELECT_LEX * sel= lex->current_select;
if (lex->current_select->set_braces(0))
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
if (sel->linkage == UNION_TYPE &&
sel->master_unit()->first_select()->braces)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
}
union_clause
...
...
@@ -4286,7 +4353,7 @@ select_options:
if (test_all_bits(Select->options, SELECT_ALL | SELECT_DISTINCT))
{
my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT");
YYABORT;
MYSQL_
YYABORT;
}
}
;
...
...
@@ -4300,7 +4367,7 @@ select_option:
| HIGH_PRIORITY
{
if (check_simple_select())
YYABORT;
MYSQL_
YYABORT;
Lex->lock_option= TL_READ_HIGH_PRIORITY;
}
| DISTINCT { Select->options|= SELECT_DISTINCT; }
...
...
@@ -4309,13 +4376,13 @@ select_option:
| SQL_BUFFER_RESULT
{
if (check_simple_select())
YYABORT;
MYSQL_
YYABORT;
Select->options|= OPTION_BUFFER_RESULT;
}
| SQL_CALC_FOUND_ROWS
{
if (check_simple_select())
YYABORT;
MYSQL_
YYABORT;
Select->options|= OPTION_FOUND_ROWS;
}
| SQL_NO_CACHE_SYM
...
...
@@ -4364,7 +4431,7 @@ select_item_list:
new Item_field(&thd->lex->current_select->
context,
NULL, NULL, "*")))
YYABORT;
MYSQL_
YYABORT;
(thd->lex->current_select->with_wild)++;
};
...
...
@@ -4373,7 +4440,7 @@ select_item:
remember_name select_item2 remember_end select_alias
{
if (add_item_to_list(YYTHD, $2))
YYABORT;
MYSQL_
YYABORT;
if ($4.str)
{
$2->is_autogenerated_name= FALSE;
...
...
@@ -4653,7 +4720,7 @@ simple_expr:
lex->dec ? atoi(lex->dec) : 0,
lex->charset);
if (!$$)
YYABORT;
MYSQL_
YYABORT;
}
| CASE_SYM opt_expr when_list opt_else END
{ $$= new Item_func_case(* $3, $2, $4 ); }
...
...
@@ -4664,7 +4731,7 @@ simple_expr:
Lex->dec ? atoi(Lex->dec) : 0,
Lex->charset);
if (!$$)
YYABORT;
MYSQL_
YYABORT;
}
| CONVERT_SYM '(' expr USING charset_name ')'
{ $$= new Item_func_conv_charset($3,$5); }
...
...
@@ -4675,7 +4742,7 @@ simple_expr:
Item_splocal *il= static_cast<Item_splocal *>($3);
my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str);
YYABORT;
MYSQL_
YYABORT;
}
$$= new Item_default_value(Lex->current_context(), $3);
}
...
...
@@ -4688,7 +4755,7 @@ simple_expr:
my_error(ER_FEATURE_DISABLED, MYF(0),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
MYSQL_
YYABORT;
}
$$= ((Item*(*)(void))($1.symbol->create_func))();
}
...
...
@@ -4699,7 +4766,7 @@ simple_expr:
my_error(ER_FEATURE_DISABLED, MYF(0),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
MYSQL_
YYABORT;
}
$$= ((Item*(*)(Item*))($1.symbol->create_func))($3);
}
...
...
@@ -4710,7 +4777,7 @@ simple_expr:
my_error(ER_FEATURE_DISABLED, MYF(0),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
MYSQL_
YYABORT;
}
$$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);
}
...
...
@@ -4721,7 +4788,7 @@ simple_expr:
my_error(ER_FEATURE_DISABLED, MYF(0),
$1.symbol->group->name,
$1.symbol->group->needed_define);
YYABORT;
MYSQL_
YYABORT;
}
$$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);
}
...
...
@@ -4752,7 +4819,7 @@ simple_expr:
| CONVERT_TZ_SYM '(' expr ',' expr ',' expr ')'
{
if (Lex->add_time_zone_tables_to_query_tables(YYTHD))
YYABORT;
MYSQL_
YYABORT;
$$= new Item_func_convert_tz($3, $5, $7);
}
| CURDATE optional_braces
...
...
@@ -4827,7 +4894,7 @@ simple_expr:
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
YYABORT;
MYSQL_
YYABORT;
#endif
}
| GET_FORMAT '(' date_time_type ',' expr ')'
...
...
@@ -4845,8 +4912,8 @@ simple_expr:
{
if ($1->type() != Item::ROW_ITEM)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
$$= new Item_func_interval((Item_row *)$1);
}
...
...
@@ -5006,8 +5073,8 @@ simple_expr:
{
if (lex->current_select->inc_in_sum_expr())
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
}
lex->current_select->udf_list.push_front(udf);
...
...
@@ -5090,7 +5157,7 @@ simple_expr:
}
break;
default:
YYABORT;
MYSQL_
YYABORT;
}
}
else
...
...
@@ -5099,7 +5166,7 @@ simple_expr:
THD *thd= lex->thd;
LEX_STRING db;
if (thd->copy_db_to(&db.str, &db.length))
YYABORT;
MYSQL_
YYABORT;
sp_name *name= new sp_name(db, $1);
if (name)
name->init_qname(thd);
...
...
@@ -5260,8 +5327,8 @@ udf_expr:
Disallow using AS to specify explicit names for the arguments
of stored routine calls
*/
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
$2->is_autogenerated_name= FALSE;
...
...
@@ -5340,7 +5407,7 @@ variable:
if (! Lex->parsing_options.allows_variable)
{
my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
}
variable_aux
...
...
@@ -5366,11 +5433,11 @@ variable_aux:
{
if ($3.str && $4.str && check_reserved_words(&$3))
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
if (!($$= get_system_var(YYTHD, $2, $3, $4)))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -5404,8 +5471,8 @@ in_sum_expr:
LEX *lex= Lex;
if (lex->current_select->inc_in_sum_expr())
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
}
expr
...
...
@@ -5485,12 +5552,12 @@ table_ref:
{
LEX *lex= Lex;
if (!($$= lex->current_select->nest_last_join(lex->thd)))
YYABORT;
MYSQL_
YYABORT;
}
;
join_table_list:
derived_table_list { YYABORT_UNLESS($$=$1); }
derived_table_list {
MYSQL_
YYABORT_UNLESS($$=$1); }
;
/* Warning - may return NULL in case of incomplete SELECT */
...
...
@@ -5498,7 +5565,7 @@ derived_table_list:
table_ref { $$=$1; }
| derived_table_list ',' table_ref
{
YYABORT_UNLESS($1 && ($$=$3));
MYSQL_
YYABORT_UNLESS($1 && ($$=$3));
}
;
...
...
@@ -5517,16 +5584,16 @@ join_table:
left-associative joins.
*/
table_ref %prec TABLE_REF_PRIORITY normal_join table_ref
{ YYABORT_UNLESS($1 && ($$=$3)); }
{
MYSQL_
YYABORT_UNLESS($1 && ($$=$3)); }
| table_ref STRAIGHT_JOIN table_factor
{ YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
{
MYSQL_
YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
| table_ref normal_join table_ref
ON
{
YYABORT_UNLESS($1 && $3);
MYSQL_
YYABORT_UNLESS($1 && $3);
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $1, $3))
YYABORT;
MYSQL_
YYABORT;
Select->parsing_place= IN_ON;
}
expr
...
...
@@ -5538,10 +5605,10 @@ join_table:
| table_ref STRAIGHT_JOIN table_factor
ON
{
YYABORT_UNLESS($1 && $3);
MYSQL_
YYABORT_UNLESS($1 && $3);
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $1, $3))
YYABORT;
MYSQL_
YYABORT;
Select->parsing_place= IN_ON;
}
expr
...
...
@@ -5554,13 +5621,13 @@ join_table:
| table_ref normal_join table_ref
USING
{
YYABORT_UNLESS($1 && $3);
MYSQL_
YYABORT_UNLESS($1 && $3);
}
'(' using_list ')'
{ add_join_natural($1,$3,$7,Select); $$=$3; }
| table_ref NATURAL JOIN_SYM table_factor
{
YYABORT_UNLESS($1 && ($$=$4));
MYSQL_
YYABORT_UNLESS($1 && ($$=$4));
add_join_natural($1,$4,NULL,Select);
}
...
...
@@ -5568,10 +5635,10 @@ join_table:
| table_ref LEFT opt_outer JOIN_SYM table_ref
ON
{
YYABORT_UNLESS($1 && $5);
MYSQL_
YYABORT_UNLESS($1 && $5);
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $1, $5))
YYABORT;
MYSQL_
YYABORT;
Select->parsing_place= IN_ON;
}
expr
...
...
@@ -5584,7 +5651,7 @@ join_table:
}
| table_ref LEFT opt_outer JOIN_SYM table_factor
{
YYABORT_UNLESS($1 && $5);
MYSQL_
YYABORT_UNLESS($1 && $5);
}
USING '(' using_list ')'
{
...
...
@@ -5594,7 +5661,7 @@ join_table:
}
| table_ref NATURAL LEFT opt_outer JOIN_SYM table_factor
{
YYABORT_UNLESS($1 && $6);
MYSQL_
YYABORT_UNLESS($1 && $6);
add_join_natural($1,$6,NULL,Select);
$6->outer_join|=JOIN_TYPE_LEFT;
$$=$6;
...
...
@@ -5604,39 +5671,39 @@ join_table:
| table_ref RIGHT opt_outer JOIN_SYM table_ref
ON
{
YYABORT_UNLESS($1 && $5);
MYSQL_
YYABORT_UNLESS($1 && $5);
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $1, $5))
YYABORT;
MYSQL_
YYABORT;
Select->parsing_place= IN_ON;
}
expr
{
LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
YYABORT;
MYSQL_
YYABORT;
add_join_on($$, $8);
Lex->pop_context();
Select->parsing_place= NO_MATTER;
}
| table_ref RIGHT opt_outer JOIN_SYM table_factor
{
YYABORT_UNLESS($1 && $5);
MYSQL_
YYABORT_UNLESS($1 && $5);
}
USING '(' using_list ')'
{
LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
YYABORT;
MYSQL_
YYABORT;
add_join_natural($$,$5,$9,Select);
}
| table_ref NATURAL RIGHT opt_outer JOIN_SYM table_factor
{
YYABORT_UNLESS($1 && $6);
MYSQL_
YYABORT_UNLESS($1 && $6);
add_join_natural($6,$1,NULL,Select);
LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
YYABORT;
MYSQL_
YYABORT;
};
normal_join:
...
...
@@ -5661,7 +5728,7 @@ table_factor:
lex->lock_option,
sel->get_use_index(),
sel->get_ignore_index())))
YYABORT;
MYSQL_
YYABORT;
sel->add_joined_table($$);
}
| '{' ident table_ref LEFT OUTER JOIN_SYM table_ref
...
...
@@ -5669,19 +5736,19 @@ table_factor:
{
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $3, $7))
YYABORT;
MYSQL_
YYABORT;
}
expr '}'
{
LEX *lex= Lex;
YYABORT_UNLESS($3 && $7);
MYSQL_
YYABORT_UNLESS($3 && $7);
add_join_on($7,$10);
Lex->pop_context();
$7->outer_join|=JOIN_TYPE_LEFT;
$$=$7;
if (!($$= lex->current_select->nest_last_join(lex->thd)))
YYABORT;
MYSQL_
YYABORT;
}
| select_derived_init get_select_lex select_derived2
{
...
...
@@ -5691,8 +5758,8 @@ table_factor:
{
if (sel->set_braces(1))
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
/* select in braces, can't contain global parameters */
if (sel->master_unit()->fake_select_lex)
...
...
@@ -5700,7 +5767,7 @@ table_factor:
sel->master_unit()->fake_select_lex;
}
if ($2->init_nested_join(lex->thd))
YYABORT;
MYSQL_
YYABORT;
$$= 0;
/* incomplete derived tables return NULL, we must be
nested in select_derived rule to be here. */
...
...
@@ -5734,7 +5801,7 @@ table_factor:
TL_READ,(List<String> *)0,
(List<String> *)0)))
YYABORT;
MYSQL_
YYABORT;
sel->add_joined_table($$);
lex->pop_context();
}
...
...
@@ -5742,8 +5809,8 @@ table_factor:
if ($4 || $6)
{
/* simple nested joins cannot have aliases or unions */
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
else
$$= $3;
...
...
@@ -5756,7 +5823,7 @@ select_derived:
{
LEX *lex= Lex;
if ($1->init_nested_join(lex->thd))
YYABORT;
MYSQL_
YYABORT;
}
derived_table_list
{
...
...
@@ -5765,11 +5832,11 @@ select_derived:
for derived tables, both must equal NULL */
if (!($$= $1->end_nested_join(lex->thd)) && $3)
YYABORT;
MYSQL_
YYABORT;
if (!$3 && $$)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
}
;
...
...
@@ -5781,12 +5848,12 @@ select_derived2:
if (lex->sql_command == (int)SQLCOM_HA_READ ||
lex->sql_command == (int)SQLCOM_KILL)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
mysql_new_select(lex, 1))
YYABORT;
MYSQL_
YYABORT;
mysql_init_select(lex);
lex->current_select->linkage= DERIVED_TABLE_TYPE;
lex->current_select->parsing_place= SELECT_LIST;
...
...
@@ -5810,7 +5877,7 @@ select_derived_init:
if (! lex->parsing_options.allows_derived)
{
my_error(ER_VIEW_SELECT_DERIVED, MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
SELECT_LEX *sel= lex->current_select;
...
...
@@ -5818,8 +5885,8 @@ select_derived_init:
if (!sel->embedding || sel->end_nested_join(lex->thd))
{
/* we are not in parentheses */
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
embedding= Select->embedding;
$$= embedding &&
...
...
@@ -5883,7 +5950,7 @@ using_list:
ident
{
if (!($$= new List<String>))
YYABORT;
MYSQL_
YYABORT;
$$->push_back(new (YYTHD->mem_root)
String((const char *) $1.str, $1.length,
system_charset_info));
...
...
@@ -6003,9 +6070,9 @@ group_clause:
group_list:
group_list ',' order_ident order_dir
{ if (add_group_to_list(YYTHD, $3,(bool) $4)) YYABORT; }
{ if (add_group_to_list(YYTHD, $3,(bool) $4))
MYSQL_
YYABORT; }
| order_ident order_dir
{ if (add_group_to_list(YYTHD, $1,(bool) $2)) YYABORT; };
{ if (add_group_to_list(YYTHD, $1,(bool) $2))
MYSQL_
YYABORT; };
olap_opt:
/* empty */ {}
...
...
@@ -6016,11 +6083,11 @@ olap_opt:
{
my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE",
"global union parameters");
YYABORT;
MYSQL_
YYABORT;
}
lex->current_select->olap= CUBE_TYPE;
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE");
YYABORT; /* To be deleted in 5.1 */
MYSQL_
YYABORT; /* To be deleted in 5.1 */
}
| WITH ROLLUP_SYM
{
...
...
@@ -6029,7 +6096,7 @@ olap_opt:
{
my_error(ER_WRONG_USAGE, MYF(0), "WITH ROLLUP",
"global union parameters");
YYABORT;
MYSQL_
YYABORT;
}
lex->current_select->olap= ROLLUP_TYPE;
}
...
...
@@ -6054,7 +6121,7 @@ alter_order_item:
THD *thd= YYTHD;
bool ascending= ($2 == 1) ? true : false;
if (add_order_to_list(thd, $1, ascending))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -6077,7 +6144,7 @@ order_clause:
{
my_error(ER_WRONG_USAGE, MYF(0),
"CUBE/ROLLUP", "ORDER BY");
YYABORT;
MYSQL_
YYABORT;
}
if (lex->sql_command != SQLCOM_ALTER_TABLE && !unit->fake_select_lex)
{
...
...
@@ -6094,15 +6161,15 @@ order_clause:
(first_sl->order_list.elements ||
first_sl->select_limit) &&
unit->add_fake_select_lex(lex->thd))
YYABORT;
MYSQL_
YYABORT;
}
} order_list;
order_list:
order_list ',' order_ident order_dir
{ if (add_order_to_list(YYTHD, $3,(bool) $4)) YYABORT; }
{ if (add_order_to_list(YYTHD, $3,(bool) $4))
MYSQL_
YYABORT; }
| order_ident order_dir
{ if (add_order_to_list(YYTHD, $1,(bool) $2)) YYABORT; };
{ if (add_order_to_list(YYTHD, $1,(bool) $2))
MYSQL_
YYABORT; };
order_dir:
/* empty */ { $$ = 1; }
...
...
@@ -6199,13 +6266,13 @@ procedure_clause:
if (! lex->parsing_options.allows_select_procedure)
{
my_error(ER_VIEW_SELECT_CLAUSE, MYF(0), "PROCEDURE");
YYABORT;
MYSQL_
YYABORT;
}
if (&lex->select_lex != lex->current_select)
{
my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "subquery");
YYABORT;
MYSQL_
YYABORT;
}
lex->proc_list.elements=0;
lex->proc_list.first=0;
...
...
@@ -6214,7 +6281,7 @@ procedure_clause:
current_select->
context,
NULL,NULL,$2.str)))
YYABORT;
MYSQL_
YYABORT;
Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
}
'(' procedure_list ')';
...
...
@@ -6233,7 +6300,7 @@ procedure_item:
{
LEX *lex= Lex;
if (add_proc_to_list(lex->thd, $2))
YYABORT;
MYSQL_
YYABORT;
if (!$2->name)
$2->set_name($1,(uint) ((char*) lex->tok_end - $1),
YYTHD->charset());
...
...
@@ -6245,7 +6312,7 @@ select_var_list_init:
{
LEX *lex=Lex;
if (!lex->describe && (!(lex->result= new select_dumpvar())))
YYABORT;
MYSQL_
YYABORT;
}
select_var_list
{}
...
...
@@ -6277,7 +6344,7 @@ select_var_ident:
if (!lex->spcont || !(t=lex->spcont->find_variable(&$1)))
{
my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
if (lex->result)
{
...
...
@@ -6306,7 +6373,7 @@ into:
if (! Lex->parsing_options.allows_select_into)
{
my_error(ER_VIEW_SELECT_CLAUSE, MYF(0), "INTO");
YYABORT;
MYSQL_
YYABORT;
}
}
into_destination
...
...
@@ -6319,7 +6386,7 @@ into_destination:
lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
if (!(lex->exchange= new sql_exchange($2.str, 0)) ||
!(lex->result= new select_export(lex->exchange)))
YYABORT;
MYSQL_
YYABORT;
}
opt_field_term opt_line_term
| DUMPFILE TEXT_STRING_filesystem
...
...
@@ -6329,9 +6396,9 @@ into_destination:
{
lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
if (!(lex->exchange= new sql_exchange($2.str,1)))
YYABORT;
MYSQL_
YYABORT;
if (!(lex->result= new select_dump(lex->exchange)))
YYABORT;
MYSQL_
YYABORT;
}
}
| select_var_list_init
...
...
@@ -6378,7 +6445,7 @@ drop:
$3.str));
if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL,
TL_OPTION_UPDATING))
YYABORT;
MYSQL_
YYABORT;
}
| DROP DATABASE if_exists ident
{
...
...
@@ -6393,7 +6460,7 @@ drop:
if (lex->sphead)
{
my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_DROP_FUNCTION;
lex->drop_if_exists= $3;
...
...
@@ -6405,7 +6472,7 @@ drop:
if (lex->sphead)
{
my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_DROP_PROCEDURE;
lex->drop_if_exists= $3;
...
...
@@ -6438,7 +6505,7 @@ table_name:
table_ident
{
if (!Select->add_table_to_list(YYTHD, $1, NULL, TL_OPTION_UPDATING))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -6536,7 +6603,7 @@ insert_field_spec:
LEX *lex=Lex;
if (!(lex->insert_list = new List_item) ||
lex->many_values.push_back(lex->insert_list))
YYABORT;
MYSQL_
YYABORT;
}
ident_eq_list;
...
...
@@ -6566,7 +6633,7 @@ ident_eq_value:
LEX *lex=Lex;
if (lex->field_list.push_back($1) ||
lex->insert_list->push_back($3))
YYABORT;
MYSQL_
YYABORT;
};
equal: EQ {}
...
...
@@ -6582,13 +6649,13 @@ no_braces:
'('
{
if (!(Lex->insert_list = new List_item))
YYABORT;
MYSQL_
YYABORT;
}
opt_values ')'
{
LEX *lex=Lex;
if (lex->many_values.push_back(lex->insert_list))
YYABORT;
MYSQL_
YYABORT;
};
opt_values:
...
...
@@ -6599,12 +6666,12 @@ values:
values ',' expr_or_default
{
if (Lex->insert_list->push_back($3))
YYABORT;
MYSQL_
YYABORT;
}
| expr_or_default
{
if (Lex->insert_list->push_back($1))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -6641,7 +6708,7 @@ update:
/* it is single table update and it is update of derived table */
my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
lex->select_lex.get_table_list()->alias, "UPDATE");
YYABORT;
MYSQL_
YYABORT;
}
/*
In case of multi-update setting write lock for all tables may
...
...
@@ -6661,7 +6728,7 @@ update_elem:
simple_ident_nospvar equal expr_or_default
{
if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3))
YYABORT;
MYSQL_
YYABORT;
};
insert_update_list:
...
...
@@ -6674,7 +6741,7 @@ insert_update_elem:
LEX *lex= Lex;
if (lex->update_list.push_back($1) ||
lex->value_list.push_back($3))
YYABORT;
MYSQL_
YYABORT;
};
opt_low_priority:
...
...
@@ -6701,7 +6768,7 @@ single_multi:
{
if (!Select->add_table_to_list(YYTHD, $2, NULL, TL_OPTION_UPDATING,
Lex->lock_option))
YYABORT;
MYSQL_
YYABORT;
}
where_clause opt_order_clause
delete_limit_clause {}
...
...
@@ -6710,14 +6777,14 @@ single_multi:
FROM join_table_list where_clause
{
if (multi_delete_set_locks_and_link_aux_tables(Lex))
YYABORT;
MYSQL_
YYABORT;
}
| FROM table_wild_list
{ mysql_init_multi_delete(Lex); }
USING join_table_list where_clause
{
if (multi_delete_set_locks_and_link_aux_tables(Lex))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -6731,7 +6798,7 @@ table_wild_one:
if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
TL_OPTION_UPDATING |
TL_OPTION_ALIAS, Lex->lock_option))
YYABORT;
MYSQL_
YYABORT;
}
| ident '.' ident opt_wild opt_table_alias
{
...
...
@@ -6741,7 +6808,7 @@ table_wild_one:
TL_OPTION_UPDATING |
TL_OPTION_ALIAS,
Lex->lock_option))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -6796,7 +6863,7 @@ show_param:
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_DATABASES;
if (prepare_schema_table(YYTHD, lex, 0, SCH_SCHEMATA))
YYABORT;
MYSQL_
YYABORT;
}
| opt_full TABLES opt_db wild_and_where
{
...
...
@@ -6805,7 +6872,7 @@ show_param:
lex->orig_sql_command= SQLCOM_SHOW_TABLES;
lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES))
YYABORT;
MYSQL_
YYABORT;
}
| opt_full TRIGGERS_SYM opt_db wild_and_where
{
...
...
@@ -6814,7 +6881,7 @@ show_param:
lex->orig_sql_command= SQLCOM_SHOW_TRIGGERS;
lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_TRIGGERS))
YYABORT;
MYSQL_
YYABORT;
}
| TABLE_SYM STATUS_SYM opt_db wild_and_where
{
...
...
@@ -6823,7 +6890,7 @@ show_param:
lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATUS;
lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES))
YYABORT;
MYSQL_
YYABORT;
}
| OPEN_SYM TABLES opt_db wild_and_where
{
...
...
@@ -6832,7 +6899,7 @@ show_param:
lex->orig_sql_command= SQLCOM_SHOW_OPEN_TABLES;
lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
YYABORT;
MYSQL_
YYABORT;
}
| ENGINE_SYM storage_engines
{ Lex->create_info.db_type= $2; }
...
...
@@ -6845,7 +6912,7 @@ show_param:
if ($5)
$4->change_db($5);
if (prepare_schema_table(YYTHD, lex, $4, SCH_COLUMNS))
YYABORT;
MYSQL_
YYABORT;
}
| NEW_SYM MASTER_SYM FOR_SYM SLAVE WITH MASTER_LOG_FILE_SYM EQ
TEXT_STRING_sys AND_SYM MASTER_LOG_POS_SYM EQ ulonglong_num
...
...
@@ -6878,7 +6945,7 @@ show_param:
if ($4)
$3->change_db($4);
if (prepare_schema_table(YYTHD, lex, $3, SCH_STATISTICS))
YYABORT;
MYSQL_
YYABORT;
}
| COLUMN_SYM TYPES_SYM
{
...
...
@@ -6916,7 +6983,7 @@ show_param:
lex->orig_sql_command= SQLCOM_SHOW_STATUS;
lex->option_type= $1;
if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS))
YYABORT;
MYSQL_
YYABORT;
}
| INNOBASE_SYM STATUS_SYM
{ Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); }
...
...
@@ -6931,7 +6998,7 @@ show_param:
lex->orig_sql_command= SQLCOM_SHOW_VARIABLES;
lex->option_type= $1;
if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES))
YYABORT;
MYSQL_
YYABORT;
}
| charset wild_and_where
{
...
...
@@ -6939,7 +7006,7 @@ show_param:
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_CHARSETS;
if (prepare_schema_table(YYTHD, lex, 0, SCH_CHARSETS))
YYABORT;
MYSQL_
YYABORT;
}
| COLLATION_SYM wild_and_where
{
...
...
@@ -6947,7 +7014,7 @@ show_param:
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_COLLATIONS;
if (prepare_schema_table(YYTHD, lex, 0, SCH_COLLATIONS))
YYABORT;
MYSQL_
YYABORT;
}
| BERKELEY_DB_SYM LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW BDB LOGS", "SHOW ENGINE BDB LOGS"); }
...
...
@@ -6959,7 +7026,7 @@ show_param:
lex->sql_command= SQLCOM_SHOW_GRANTS;
LEX_USER *curr_user;
if (!(curr_user= (LEX_USER*) lex->thd->alloc(sizeof(st_lex_user))))
YYABORT;
MYSQL_
YYABORT;
bzero(curr_user, sizeof(st_lex_user));
lex->grant_user= curr_user;
}
...
...
@@ -6981,7 +7048,7 @@ show_param:
LEX *lex= Lex;
lex->sql_command = SQLCOM_SHOW_CREATE;
if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL,0))
YYABORT;
MYSQL_
YYABORT;
lex->only_view= 0;
}
| CREATE VIEW_SYM table_ident
...
...
@@ -6989,7 +7056,7 @@ show_param:
LEX *lex= Lex;
lex->sql_command = SQLCOM_SHOW_CREATE;
if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL, 0))
YYABORT;
MYSQL_
YYABORT;
lex->only_view= 1;
}
| MASTER_SYM STATUS_SYM
...
...
@@ -7020,9 +7087,9 @@ show_param:
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_STATUS_PROC;
if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
YYABORT;
MYSQL_
YYABORT;
if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
YYABORT;
MYSQL_
YYABORT;
}
| FUNCTION_SYM STATUS_SYM wild_and_where
{
...
...
@@ -7030,15 +7097,15 @@ show_param:
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_STATUS_FUNC;
if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
YYABORT;
MYSQL_
YYABORT;
if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
YYABORT;
MYSQL_
YYABORT;
}
| PROCEDURE CODE_SYM sp_name
{
#ifdef DBUG_OFF
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
#else
Lex->sql_command= SQLCOM_SHOW_PROC_CODE;
Lex->spname= $3;
...
...
@@ -7047,8 +7114,8 @@ show_param:
| FUNCTION_SYM CODE_SYM sp_name
{
#ifdef DBUG_OFF
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
#else
Lex->sql_command= SQLCOM_SHOW_FUNC_CODE;
Lex->spname= $3;
...
...
@@ -7068,7 +7135,7 @@ show_engine_param:
break;
default:
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
YYABORT;
MYSQL_
YYABORT;
}
}
| LOGS_SYM
...
...
@@ -7079,7 +7146,7 @@ show_engine_param:
break;
default:
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "LOGS");
YYABORT;
MYSQL_
YYABORT;
}
};
...
...
@@ -7138,7 +7205,7 @@ describe:
lex->select_lex.db= 0;
lex->verbose= 0;
if (prepare_schema_table(YYTHD, lex, $2, SCH_COLUMNS))
YYABORT;
MYSQL_
YYABORT;
}
opt_describe_column {}
| describe_command opt_extended_describe
...
...
@@ -7280,7 +7347,7 @@ load: LOAD DATA_SYM
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD DATA");
YYABORT;
MYSQL_
YYABORT;
}
lex->fname_start= lex->ptr;
}
...
...
@@ -7293,14 +7360,14 @@ load: LOAD DATA_SYM
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD TABLE");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
WARN_DEPRECATED("LOAD TABLE FROM MASTER",
"mysqldump or future "
"BACKUP/RESTORE DATABASE facility");
if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
YYABORT;
MYSQL_
YYABORT;
};
load_data:
...
...
@@ -7313,7 +7380,7 @@ load_data:
lex->duplicates= DUP_ERROR;
lex->ignore= 0;
if (!(lex->exchange= new sql_exchange($4.str, 0)))
YYABORT;
MYSQL_
YYABORT;
}
opt_duplicate INTO
{
...
...
@@ -7325,7 +7392,7 @@ load_data:
LEX *lex=Lex;
if (!Select->add_table_to_list(YYTHD, $10, NULL, TL_OPTION_UPDATING,
lex->lock_option))
YYABORT;
MYSQL_
YYABORT;
lex->field_list.empty();
lex->update_list.empty();
lex->value_list.empty();
...
...
@@ -7504,13 +7571,13 @@ param_marker:
if (! lex->parsing_options.allows_variable)
{
my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
item= new Item_param((uint) (lex->tok_start - (uchar *) thd->query));
if (!($$= item) || lex->param_list.push_back(item))
{
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
}
;
...
...
@@ -7576,7 +7643,7 @@ NUM_literal:
$$= new Item_decimal($1.str, $1.length, YYTHD->charset());
if (YYTHD->net.report_error)
{
YYABORT;
MYSQL_
YYABORT;
}
}
| FLOAT_NUM
...
...
@@ -7584,7 +7651,7 @@ NUM_literal:
$$ = new Item_float($1.str, $1.length);
if (YYTHD->net.report_error)
{
YYABORT;
MYSQL_
YYABORT;
}
}
;
...
...
@@ -7629,7 +7696,7 @@ simple_ident:
if (! lex->parsing_options.allows_variable)
{
my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
Item_splocal *splocal;
...
...
@@ -7689,14 +7756,14 @@ simple_ident_q:
!new_row)
{
my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "OLD", "on INSERT");
YYABORT;
MYSQL_
YYABORT;
}
if (lex->trg_chistics.event == TRG_EVENT_DELETE &&
new_row)
{
my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "NEW", "on DELETE");
YYABORT;
MYSQL_
YYABORT;
}
DBUG_ASSERT(!new_row ||
...
...
@@ -7711,7 +7778,7 @@ simple_ident_q:
$3.str,
SELECT_ACL,
read_only)))
YYABORT;
MYSQL_
YYABORT;
/*
Let us add this item to list of all Item_trigger_field objects
...
...
@@ -7782,13 +7849,13 @@ field_ident:
if (my_strcasecmp(table_alias_charset, $1.str, table->db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
if (my_strcasecmp(table_alias_charset, $3.str,
table->table_name))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3.str);
YYABORT;
MYSQL_
YYABORT;
}
$$=$5;
}
...
...
@@ -7798,7 +7865,7 @@ field_ident:
if (my_strcasecmp(table_alias_charset, $1.str, table->alias))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), $1.str);
YYABORT;
MYSQL_
YYABORT;
}
$$=$3;
}
...
...
@@ -7830,7 +7897,7 @@ IDENT_sys:
{
my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
cs->csname, $1.str + wlen);
YYABORT;
MYSQL_
YYABORT;
}
$$= $1;
}
...
...
@@ -7907,32 +7974,32 @@ user:
{
THD *thd= YYTHD;
if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
YYABORT;
MYSQL_
YYABORT;
$$->user = $1;
$$->host.str= (char *) "%";
$$->host.length= 1;
if (check_string_length(&$$->user,
ER(ER_USERNAME), USERNAME_LENGTH))
YYABORT;
MYSQL_
YYABORT;
}
| ident_or_text '@' ident_or_text
{
THD *thd= YYTHD;
if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
YYABORT;
MYSQL_
YYABORT;
$$->user = $1; $$->host=$3;
if (check_string_length(&$$->user,
ER(ER_USERNAME), USERNAME_LENGTH) ||
check_string_length(&$$->host,
ER(ER_HOSTNAME), HOSTNAME_LENGTH))
YYABORT;
MYSQL_
YYABORT;
}
| CURRENT_USER optional_braces
{
if (!($$=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user))))
YYABORT;
MYSQL_
YYABORT;
/*
empty LEX_USER means current_user and
will be handled in the get_current_user() function
...
...
@@ -8275,7 +8342,7 @@ option_type_value:
if (!(i= new sp_instr_stmt(sp->instructions(), lex->spcont,
lex)))
YYABORT;
MYSQL_
YYABORT;
/*
Extract the query statement from the tokenizer. The
...
...
@@ -8288,7 +8355,7 @@ option_type_value:
qbuff.length= lex->tok_end - sp->m_tmp_query;
if (!(qbuff.str= alloc_root(YYTHD->mem_root, qbuff.length + 5)))
YYABORT;
MYSQL_
YYABORT;
strmake(strmake(qbuff.str, "SET ", 4), (char *)sp->m_tmp_query,
qbuff.length);
...
...
@@ -8344,8 +8411,8 @@ sys_option_value:
LINT_INIT(sp_fld);
if ($1)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
if ($4)
it= $4;
...
...
@@ -8367,7 +8434,7 @@ sys_option_value:
lex->spcont,
trg_fld,
it, lex)))
YYABORT;
MYSQL_
YYABORT;
/*
Let us add this item to list of all Item_trigger_field
...
...
@@ -8394,8 +8461,8 @@ sys_option_value:
Item *it;
if ($1)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
spv= ctx->find_variable(&$2.base_name);
...
...
@@ -8451,9 +8518,9 @@ option_value:
if (spc && spc->find_variable(&names))
my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), names.str);
else
yy
error(ER(ER_SYNTAX_ERROR));
my_parse_
error(ER(ER_SYNTAX_ERROR));
YYABORT;
MYSQL_
YYABORT;
}
| NAMES_SYM charset_name_or_default opt_collate
{
...
...
@@ -8464,7 +8531,7 @@ option_value:
{
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
$3->name, $2->csname);
YYABORT;
MYSQL_
YYABORT;
}
lex->var_list.push_back(new set_var_collation_client($3,$3,$3));
}
...
...
@@ -8481,10 +8548,10 @@ option_value:
if (spc && spc->find_variable(&pw))
{
my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), pw.str);
YYABORT;
MYSQL_
YYABORT;
}
if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER))))
YYABORT;
MYSQL_
YYABORT;
user->host=null_lex_str;
user->user.str=thd->security_ctx->priv_user;
thd->lex->var_list.push_back(new set_var_password(user, $3));
...
...
@@ -8508,7 +8575,7 @@ internal_variable_name:
/* Not an SP local variable */
sys_var *tmp=find_sys_var($1.str, $1.length);
if (!tmp)
YYABORT;
MYSQL_
YYABORT;
$$.var= tmp;
$$.base_name= null_lex_str;
/*
...
...
@@ -8517,7 +8584,7 @@ internal_variable_name:
*/
if (tmp == &sys_time_zone &&
lex->add_time_zone_tables_to_query_tables(YYTHD))
YYABORT;
MYSQL_
YYABORT;
else if (spc && tmp == &sys_autocommit)
{
/*
...
...
@@ -8539,8 +8606,8 @@ internal_variable_name:
LEX *lex= Lex;
if (check_reserved_words(&$1))
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_TRIGGER &&
(!my_strcasecmp(system_charset_info, $1.str, "NEW") ||
...
...
@@ -8549,18 +8616,18 @@ internal_variable_name:
if ($1.str[0]=='O' || $1.str[0]=='o')
{
my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", "");
YYABORT;
MYSQL_
YYABORT;
}
if (lex->trg_chistics.event == TRG_EVENT_DELETE)
{
my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0),
"NEW", "on DELETE");
YYABORT;
MYSQL_
YYABORT;
}
if (lex->trg_chistics.action_time == TRG_ACTION_AFTER)
{
my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "NEW", "after ");
YYABORT;
MYSQL_
YYABORT;
}
/* This special combination will denote field of NEW row */
$$.var= &trg_new_row_fake_var;
...
...
@@ -8570,7 +8637,7 @@ internal_variable_name:
{
sys_var *tmp=find_sys_var($3.str, $3.length);
if (!tmp)
YYABORT;
MYSQL_
YYABORT;
if (!tmp->is_struct())
my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
$$.var= tmp;
...
...
@@ -8581,7 +8648,7 @@ internal_variable_name:
{
sys_var *tmp=find_sys_var($3.str, $3.length);
if (!tmp)
YYABORT;
MYSQL_
YYABORT;
if (!tmp->is_struct())
my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
$$.var= tmp;
...
...
@@ -8633,7 +8700,7 @@ lock:
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "LOCK");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_LOCK_TABLES;
}
...
...
@@ -8653,7 +8720,7 @@ table_lock:
table_ident opt_table_alias lock_option
{
if (!Select->add_table_to_list(YYTHD, $1, $2, 0, (thr_lock_type) $3))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -8672,7 +8739,7 @@ unlock:
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "UNLOCK");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_UNLOCK_TABLES;
}
...
...
@@ -8692,11 +8759,11 @@ handler:
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_HA_OPEN;
if (!lex->current_select->add_table_to_list(lex->thd, $2, $4, 0))
YYABORT;
MYSQL_
YYABORT;
}
| HANDLER_SYM table_ident_nodb CLOSE_SYM
{
...
...
@@ -8704,11 +8771,11 @@ handler:
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_HA_CLOSE;
if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
YYABORT;
MYSQL_
YYABORT;
}
| HANDLER_SYM table_ident_nodb READ_SYM
{
...
...
@@ -8716,14 +8783,14 @@ handler:
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
YYABORT;
MYSQL_
YYABORT;
}
lex->sql_command = SQLCOM_HA_READ;
lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */
lex->current_select->select_limit= new Item_int((int32) 1);
lex->current_select->offset_limit= 0;
if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
YYABORT;
MYSQL_
YYABORT;
}
handler_read_or_scan where_clause opt_limit_clause {}
;
...
...
@@ -8749,7 +8816,7 @@ handler_rkey_function:
lex->ha_read_mode = RKEY;
lex->ha_rkey_mode=$1;
if (!(lex->insert_list = new List_item))
YYABORT;
MYSQL_
YYABORT;
} '(' values ')' { }
;
...
...
@@ -8781,8 +8848,8 @@ revoke_command:
LEX *lex= Lex;
if (lex->columns.elements)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_REVOKE;
lex->type= TYPE_ENUM_FUNCTION;
...
...
@@ -8794,8 +8861,8 @@ revoke_command:
LEX *lex= Lex;
if (lex->columns.elements)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_REVOKE;
lex->type= TYPE_ENUM_PROCEDURE;
...
...
@@ -8827,8 +8894,8 @@ grant_command:
LEX *lex= Lex;
if (lex->columns.elements)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_GRANT;
lex->type= TYPE_ENUM_FUNCTION;
...
...
@@ -8840,8 +8907,8 @@ grant_command:
LEX *lex= Lex;
if (lex->columns.elements)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
lex->sql_command= SQLCOM_GRANT;
lex->type= TYPE_ENUM_PROCEDURE;
...
...
@@ -8918,7 +8985,7 @@ require_list_element:
if (lex->x509_subject)
{
my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT");
YYABORT;
MYSQL_
YYABORT;
}
lex->x509_subject=$2.str;
}
...
...
@@ -8928,7 +8995,7 @@ require_list_element:
if (lex->x509_issuer)
{
my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER");
YYABORT;
MYSQL_
YYABORT;
}
lex->x509_issuer=$2.str;
}
...
...
@@ -8938,7 +9005,7 @@ require_list_element:
if (lex->ssl_cipher)
{
my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER");
YYABORT;
MYSQL_
YYABORT;
}
lex->ssl_cipher=$2.str;
}
...
...
@@ -8950,14 +9017,14 @@ grant_ident:
LEX *lex= Lex;
THD *thd= lex->thd;
if (thd->copy_db_to(&lex->current_select->db, NULL))
YYABORT;
MYSQL_
YYABORT;
if (lex->grant == GLOBAL_ACLS)
lex->grant = DB_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
}
| ident '.' '*'
...
...
@@ -8970,7 +9037,7 @@ grant_ident:
{
my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
}
| '*' '.' '*'
...
...
@@ -8983,14 +9050,14 @@ grant_ident:
{
my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
YYABORT;
MYSQL_
YYABORT;
}
}
| table_ident
{
LEX *lex=Lex;
if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL,0))
YYABORT;
MYSQL_
YYABORT;
if (lex->grant == GLOBAL_ACLS)
lex->grant = TABLE_ACLS & ~GRANT_ACL;
}
...
...
@@ -8998,21 +9065,21 @@ grant_ident:
user_list:
user { if (Lex->users_list.push_back($1)) YYABORT;}
user { if (Lex->users_list.push_back($1))
MYSQL_
YYABORT;}
| user_list ',' user
{
if (Lex->users_list.push_back($3))
YYABORT;
MYSQL_
YYABORT;
}
;
grant_list:
grant_user { if (Lex->users_list.push_back($1)) YYABORT;}
grant_user { if (Lex->users_list.push_back($1))
MYSQL_
YYABORT;}
| grant_list ',' grant_user
{
if (Lex->users_list.push_back($3))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -9235,17 +9302,17 @@ union_list:
{
/* Only the last SELECT can have INTO...... */
my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO");
YYABORT;
MYSQL_
YYABORT;
}
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
/* This counter shouldn't be incremented for UNION parts */
Lex->nest_level--;
if (mysql_new_select(lex, 0))
YYABORT;
MYSQL_
YYABORT;
mysql_init_select(lex);
lex->current_select->linkage=UNION_TYPE;
if ($2) /* UNION DISTINCT - remember position */
...
...
@@ -9339,8 +9406,8 @@ subselect_start:
if (lex->sql_command == (int)SQLCOM_HA_READ ||
lex->sql_command == (int)SQLCOM_KILL)
{
yy
error(ER(ER_SYNTAX_ERROR));
YYABORT;
my_parse_
error(ER(ER_SYNTAX_ERROR));
MYSQL_
YYABORT;
}
/*
we are making a "derived table" for the parenthesis
...
...
@@ -9350,7 +9417,7 @@ subselect_start:
SELECT * FROM ((SELECT ...) UNION ...)
*/
if (mysql_new_select(Lex, 1))
YYABORT;
MYSQL_
YYABORT;
};
subselect_end:
...
...
@@ -9468,7 +9535,7 @@ view_tail:
lex->sql_command= SQLCOM_CREATE_VIEW;
/* first table in list is target VIEW name */
if (!lex->select_lex.add_table_to_list(thd, $3, NULL, TL_OPTION_UPDATING))
YYABORT;
MYSQL_
YYABORT;
}
view_list_opt AS view_select view_check_option
{}
...
...
@@ -9559,11 +9626,11 @@ trigger_tail:
if (lex->sphead)
{
my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER");
YYABORT;
MYSQL_
YYABORT;
}
if (!(sp= new sp_head()))
YYABORT;
MYSQL_
YYABORT;
sp->reset_thd_mem_root(YYTHD);
sp->init(lex);
sp->init_sp_name(YYTHD, $3);
...
...
@@ -9602,7 +9669,7 @@ trigger_tail:
sp->restore_thd_mem_root(YYTHD);
if (sp->is_not_allowed_in_function("trigger"))
YYABORT;
MYSQL_
YYABORT;
/*
We have to do it after parsing trigger body, because some of
...
...
@@ -9613,7 +9680,7 @@ trigger_tail:
(LEX_STRING*) 0,
TL_OPTION_UPDATING,
TL_IGNORE))
YYABORT;
MYSQL_
YYABORT;
}
;
...
...
@@ -9641,7 +9708,7 @@ sp_tail:
if (lex->sphead)
{
my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE");
YYABORT;
MYSQL_
YYABORT;
}
lex->stmt_definition_begin= $2;
...
...
@@ -9727,23 +9794,23 @@ xa: XA_SYM begin_or_start xid opt_join_or_resume
xid: text_string
{
YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE);
MYSQL_
YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE);
if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
YYABORT;
MYSQL_
YYABORT;
Lex->xid->set(1L, $1->ptr(), $1->length(), 0, 0);
}
| text_string ',' text_string
{
YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
MYSQL_
YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
YYABORT;
MYSQL_
YYABORT;
Lex->xid->set(1L, $1->ptr(), $1->length(), $3->ptr(), $3->length());
}
| text_string ',' text_string ',' ulong_num
{
YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
MYSQL_
YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
YYABORT;
MYSQL_
YYABORT;
Lex->xid->set($5, $1->ptr(), $1->length(), $3->ptr(), $3->length());
}
;
...
...
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