This patch does 1) fix my build breakage 2) Complete the removal of all symbols which could clash with another parser.
sql/mysql_priv.h: Porting update sql/mysqld.cc: Porting update sql/sp.cc: Porting update sql/sql_lex.cc: Porting update sql/sql_lex.h: Porting update sql/sql_parse.cc: Porting update sql/sql_prepare.cc: Portinng update sql/sql_trigger.cc: Porting update sql/sql_view.cc: Porting update
This commit is contained in:
parent
85d705b651
commit
01d69c4b96
@ -1093,7 +1093,7 @@ File open_binlog(IO_CACHE *log, const char *log_file_name,
|
|||||||
const char **errmsg);
|
const char **errmsg);
|
||||||
|
|
||||||
/* mysqld.cc */
|
/* mysqld.cc */
|
||||||
extern void yyerror(const char*);
|
extern void MYSQLerror(const char*);
|
||||||
|
|
||||||
/* item_func.cc */
|
/* item_func.cc */
|
||||||
extern bool check_reserved_words(LEX_STRING *name);
|
extern bool check_reserved_words(LEX_STRING *name);
|
||||||
@ -1415,7 +1415,7 @@ void free_list(I_List <i_string_pair> *list);
|
|||||||
void free_list(I_List <i_string> *list);
|
void free_list(I_List <i_string> *list);
|
||||||
|
|
||||||
/* sql_yacc.cc */
|
/* sql_yacc.cc */
|
||||||
extern int yyparse(void *thd);
|
extern int MYSQLparse(void *thd);
|
||||||
|
|
||||||
/* frm_crypt.cc */
|
/* frm_crypt.cc */
|
||||||
#ifdef HAVE_CRYPTED_FRM
|
#ifdef HAVE_CRYPTED_FRM
|
||||||
|
@ -1524,7 +1524,7 @@ static void network_init(void)
|
|||||||
|
|
||||||
#endif /*!EMBEDDED_LIBRARY*/
|
#endif /*!EMBEDDED_LIBRARY*/
|
||||||
|
|
||||||
void yyerror(const char *s)
|
void MYSQLerror(const char *s)
|
||||||
{
|
{
|
||||||
THD *thd=current_thd;
|
THD *thd=current_thd;
|
||||||
char *yytext= (char*) thd->lex->tok_start;
|
char *yytext= (char*) thd->lex->tok_start;
|
||||||
|
@ -269,7 +269,7 @@ db_find_routine_aux(THD *thd, int type, sp_name *name, TABLE *table)
|
|||||||
static int
|
static int
|
||||||
db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
|
db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
|
||||||
{
|
{
|
||||||
extern int yyparse(void *thd);
|
extern int MYSQLparse(void *thd);
|
||||||
TABLE *table;
|
TABLE *table;
|
||||||
const char *params, *returns, *body;
|
const char *params, *returns, *body;
|
||||||
int ret;
|
int ret;
|
||||||
@ -459,7 +459,7 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
|
|||||||
lex_start(thd, (uchar*)defstr.c_ptr(), defstr.length());
|
lex_start(thd, (uchar*)defstr.c_ptr(), defstr.length());
|
||||||
|
|
||||||
thd->spcont= 0;
|
thd->spcont= 0;
|
||||||
if (yyparse(thd) || thd->is_fatal_error || newlex.sphead == NULL)
|
if (MYSQLparse(thd) || thd->is_fatal_error || newlex.sphead == NULL)
|
||||||
{
|
{
|
||||||
sp_head *sp= newlex.sphead;
|
sp_head *sp= newlex.sphead;
|
||||||
|
|
||||||
|
@ -507,14 +507,14 @@ static inline uint int_token(const char *str,uint length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
yylex remember the following states from the following yylex()
|
MYSQLlex remember the following states from the following MYSQLlex()
|
||||||
|
|
||||||
- MY_LEX_EOQ Found end of query
|
- MY_LEX_EOQ Found end of query
|
||||||
- MY_LEX_OPERATOR_OR_IDENT Last state was an ident, text or number
|
- MY_LEX_OPERATOR_OR_IDENT Last state was an ident, text or number
|
||||||
(which can't be followed by a signed number)
|
(which can't be followed by a signed number)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int yylex(void *arg, void *yythd)
|
int MYSQLlex(void *arg, void *yythd)
|
||||||
{
|
{
|
||||||
reg1 uchar c;
|
reg1 uchar c;
|
||||||
int tokval, result_state;
|
int tokval, result_state;
|
||||||
|
@ -716,7 +716,7 @@ typedef struct st_lex
|
|||||||
uchar *buf; /* The beginning of string, used by SPs */
|
uchar *buf; /* The beginning of string, used by SPs */
|
||||||
uchar *ptr,*tok_start,*tok_end,*end_of_query;
|
uchar *ptr,*tok_start,*tok_end,*end_of_query;
|
||||||
|
|
||||||
/* The values of tok_start/tok_end as they were one call of yylex before */
|
/* The values of tok_start/tok_end as they were one call of MYSQLlex before */
|
||||||
uchar *tok_start_prev, *tok_end_prev;
|
uchar *tok_start_prev, *tok_end_prev;
|
||||||
|
|
||||||
char *length,*dec,*change,*name;
|
char *length,*dec,*change,*name;
|
||||||
@ -1065,7 +1065,7 @@ extern void lex_init(void);
|
|||||||
extern void lex_free(void);
|
extern void lex_free(void);
|
||||||
extern void lex_start(THD *thd, uchar *buf,uint length);
|
extern void lex_start(THD *thd, uchar *buf,uint length);
|
||||||
extern void lex_end(LEX *lex);
|
extern void lex_end(LEX *lex);
|
||||||
extern int yylex(void *arg, void *yythd);
|
extern int MYSQLlex(void *arg, void *yythd);
|
||||||
|
|
||||||
extern pthread_key(LEX*,THR_LEX);
|
extern pthread_key(LEX*,THR_LEX);
|
||||||
|
|
||||||
|
@ -4244,7 +4244,7 @@ end_with_restore_list:
|
|||||||
/*
|
/*
|
||||||
We must cleanup the unit and the lex here because
|
We must cleanup the unit and the lex here because
|
||||||
sp_grant_privileges calls (indirectly) db_find_routine,
|
sp_grant_privileges calls (indirectly) db_find_routine,
|
||||||
which in turn may call yyparse with THD::lex.
|
which in turn may call MYSQLparse with THD::lex.
|
||||||
TODO: fix db_find_routine to use a temporary lex.
|
TODO: fix db_find_routine to use a temporary lex.
|
||||||
*/
|
*/
|
||||||
lex->unit.cleanup();
|
lex->unit.cleanup();
|
||||||
@ -5659,7 +5659,7 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
|
|||||||
sp_cache_flush_obsolete(&thd->sp_proc_cache);
|
sp_cache_flush_obsolete(&thd->sp_proc_cache);
|
||||||
sp_cache_flush_obsolete(&thd->sp_func_cache);
|
sp_cache_flush_obsolete(&thd->sp_func_cache);
|
||||||
|
|
||||||
if (!yyparse((void *)thd) && ! thd->is_fatal_error)
|
if (!MYSQLparse((void *)thd) && ! thd->is_fatal_error)
|
||||||
{
|
{
|
||||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||||
if (mqh_used && thd->user_connect &&
|
if (mqh_used && thd->user_connect &&
|
||||||
@ -5739,7 +5739,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
|
|||||||
DBUG_ENTER("mysql_test_parse_for_slave");
|
DBUG_ENTER("mysql_test_parse_for_slave");
|
||||||
|
|
||||||
mysql_init_query(thd, (uchar*) inBuf, length);
|
mysql_init_query(thd, (uchar*) inBuf, length);
|
||||||
if (!yyparse((void*) thd) && ! thd->is_fatal_error &&
|
if (!MYSQLparse((void*) thd) && ! thd->is_fatal_error &&
|
||||||
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
|
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
|
||||||
error= 1; /* Ignore question */
|
error= 1; /* Ignore question */
|
||||||
thd->end_statement();
|
thd->end_statement();
|
||||||
|
@ -2757,7 +2757,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
|
|||||||
lex->safe_to_cache_query= FALSE;
|
lex->safe_to_cache_query= FALSE;
|
||||||
lex->stmt_prepare_mode= TRUE;
|
lex->stmt_prepare_mode= TRUE;
|
||||||
|
|
||||||
error= yyparse((void *)thd) || thd->is_fatal_error ||
|
error= MYSQLparse((void *)thd) || thd->is_fatal_error ||
|
||||||
thd->net.report_error || init_param_array(this);
|
thd->net.report_error || init_param_array(this);
|
||||||
/*
|
/*
|
||||||
While doing context analysis of the query (in check_prepared_statement)
|
While doing context analysis of the query (in check_prepared_statement)
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
|
#define MYSQL_LEX 1
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
#include "sp_head.h"
|
#include "sp_head.h"
|
||||||
#include "sql_trigger.h"
|
#include "sql_trigger.h"
|
||||||
@ -932,7 +933,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
|
|||||||
lex_start(thd, (uchar*)trg_create_str->str, trg_create_str->length);
|
lex_start(thd, (uchar*)trg_create_str->str, trg_create_str->length);
|
||||||
|
|
||||||
thd->spcont= 0;
|
thd->spcont= 0;
|
||||||
if (yyparse((void *)thd) || thd->is_fatal_error)
|
if (MYSQLparse((void *)thd) || thd->is_fatal_error)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Free lex associated resources.
|
Free lex associated resources.
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define MYSQL_LEX 1
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
#include "parse_file.h"
|
#include "parse_file.h"
|
||||||
@ -889,7 +890,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
|
|||||||
MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES);
|
MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES);
|
||||||
CHARSET_INFO *save_cs= thd->variables.character_set_client;
|
CHARSET_INFO *save_cs= thd->variables.character_set_client;
|
||||||
thd->variables.character_set_client= system_charset_info;
|
thd->variables.character_set_client= system_charset_info;
|
||||||
res= yyparse((void *)thd);
|
res= MYSQLparse((void *)thd);
|
||||||
thd->variables.character_set_client= save_cs;
|
thd->variables.character_set_client= save_cs;
|
||||||
thd->variables.sql_mode= save_mode;
|
thd->variables.sql_mode= save_mode;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user