mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merging lex-pointer change from 4.1 to 5.0.
libmysqld/lib_sql.cc: Auto merged sql/filesort.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/item_func.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/mysql_priv.h: Auto merged sql/protocol.cc: Auto merged sql/slave.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_error.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged
This commit is contained in:
@ -54,7 +54,7 @@ Item::Item():
|
|||||||
thd->free_list= this;
|
thd->free_list= this;
|
||||||
/*
|
/*
|
||||||
Item constructor can be called during execution other then SQL_COM
|
Item constructor can be called during execution other then SQL_COM
|
||||||
command => we should check thd->lex.current_select on zero (thd->lex
|
command => we should check thd->lex->current_select on zero (thd->lex
|
||||||
can be uninitialised)
|
can be uninitialised)
|
||||||
*/
|
*/
|
||||||
if (thd->lex->current_select)
|
if (thd->lex->current_select)
|
||||||
|
@ -1885,7 +1885,7 @@ extern "C" int my_message_sql(uint error, const char *str,
|
|||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
thd->lex.current_select == 0 if lex structure is not inited
|
thd->lex->current_select == 0 if lex structure is not inited
|
||||||
(not query command (COM_QUERY))
|
(not query command (COM_QUERY))
|
||||||
*/
|
*/
|
||||||
if (thd->lex->current_select &&
|
if (thd->lex->current_select &&
|
||||||
|
@ -289,7 +289,7 @@ TODO list:
|
|||||||
|
|
||||||
if (thd->temp_tables || global_merge_table_count)
|
if (thd->temp_tables || global_merge_table_count)
|
||||||
|
|
||||||
- Another option would be to set thd->lex.safe_to_cache_query to 0
|
- Another option would be to set thd->lex->safe_to_cache_query to 0
|
||||||
in 'get_lock_data' if any of the tables was a tmp table or a
|
in 'get_lock_data' if any of the tables was a tmp table or a
|
||||||
MRG_ISAM table.
|
MRG_ISAM table.
|
||||||
(This could be done with almost no speed penalty)
|
(This could be done with almost no speed penalty)
|
||||||
|
@ -92,6 +92,7 @@ THD::THD():user_time(0), is_fatal_error(0),
|
|||||||
global_read_lock(0), bootstrap(0), spcont(NULL)
|
global_read_lock(0), bootstrap(0), spcont(NULL)
|
||||||
{
|
{
|
||||||
host= user= priv_user= db= ip= 0;
|
host= user= priv_user= db= ip= 0;
|
||||||
|
lex= &main_lex;
|
||||||
host_or_ip= "connecting host";
|
host_or_ip= "connecting host";
|
||||||
locked=some_tables_deleted=no_errors=password= 0;
|
locked=some_tables_deleted=no_errors=password= 0;
|
||||||
query_start_used= 0;
|
query_start_used= 0;
|
||||||
|
@ -455,7 +455,7 @@ int yylex(void *arg, void *yythd)
|
|||||||
int tokval, result_state;
|
int tokval, result_state;
|
||||||
uint length;
|
uint length;
|
||||||
enum my_lex_states state;
|
enum my_lex_states state;
|
||||||
LEX *lex= (((THD *)yythd)->lex);
|
LEX *lex= ((THD *)yythd)->lex;
|
||||||
YYSTYPE *yylval=(YYSTYPE*) arg;
|
YYSTYPE *yylval=(YYSTYPE*) arg;
|
||||||
CHARSET_INFO *cs= ((THD *) yythd)->charset();
|
CHARSET_INFO *cs= ((THD *) yythd)->charset();
|
||||||
uchar *state_map= cs->state_map;
|
uchar *state_map= cs->state_map;
|
||||||
|
@ -641,7 +641,7 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
|
|||||||
SELECT_LEX *select_lex)
|
SELECT_LEX *select_lex)
|
||||||
{
|
{
|
||||||
THD *thd= stmt->thd;
|
THD *thd= stmt->thd;
|
||||||
LEX *lex= thd->lex;
|
LEX *lex= &thd->main_lex;
|
||||||
select_result *result= thd->lex->result;
|
select_result *result= thd->lex->result;
|
||||||
DBUG_ENTER("mysql_test_select_fields");
|
DBUG_ENTER("mysql_test_select_fields");
|
||||||
|
|
||||||
@ -703,7 +703,7 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
|
|||||||
static bool send_prepare_results(PREP_STMT *stmt)
|
static bool send_prepare_results(PREP_STMT *stmt)
|
||||||
{
|
{
|
||||||
THD *thd= stmt->thd;
|
THD *thd= stmt->thd;
|
||||||
LEX *lex= thd->lex;
|
LEX *lex= &thd->main_lex;
|
||||||
enum enum_sql_command sql_command= thd->lex->sql_command;
|
enum enum_sql_command sql_command= thd->lex->sql_command;
|
||||||
DBUG_ENTER("send_prepare_results");
|
DBUG_ENTER("send_prepare_results");
|
||||||
DBUG_PRINT("enter",("command: %d, param_count: %ld",
|
DBUG_PRINT("enter",("command: %d, param_count: %ld",
|
||||||
@ -812,7 +812,7 @@ static bool init_param_items(PREP_STMT *stmt)
|
|||||||
Item_param **to;
|
Item_param **to;
|
||||||
uint32 length= thd->query_length;
|
uint32 length= thd->query_length;
|
||||||
|
|
||||||
stmt->lex= *thd->lex;
|
stmt->lex= thd->main_lex;
|
||||||
|
|
||||||
if (mysql_bin_log.is_open())
|
if (mysql_bin_log.is_open())
|
||||||
{
|
{
|
||||||
@ -972,8 +972,8 @@ void mysql_stmt_execute(THD *thd, char *packet)
|
|||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
LEX *thd_lex= thd->lex;
|
LEX thd_lex= thd->main_lex;
|
||||||
thd->lex= &stmt->lex;
|
thd->main_lex= stmt->lex;
|
||||||
|
|
||||||
for (sl= stmt->lex.all_selects_list;
|
for (sl= stmt->lex.all_selects_list;
|
||||||
sl;
|
sl;
|
||||||
@ -1012,7 +1012,7 @@ void mysql_stmt_execute(THD *thd, char *packet)
|
|||||||
if (!(specialflag & SPECIAL_NO_PRIOR))
|
if (!(specialflag & SPECIAL_NO_PRIOR))
|
||||||
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
|
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
|
||||||
|
|
||||||
thd->lex= thd_lex;
|
thd->main_lex= thd_lex;
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -700,7 +700,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
|
|||||||
mi->rli.until_condition= RELAY_LOG_INFO::UNTIL_MASTER_POS;
|
mi->rli.until_condition= RELAY_LOG_INFO::UNTIL_MASTER_POS;
|
||||||
mi->rli.until_log_pos= thd->lex->mi.pos;
|
mi->rli.until_log_pos= thd->lex->mi.pos;
|
||||||
/*
|
/*
|
||||||
We don't check thd->lex.mi.log_file_name for NULL here
|
We don't check thd->lex->mi.log_file_name for NULL here
|
||||||
since it is checked in sql_yacc.yy
|
since it is checked in sql_yacc.yy
|
||||||
*/
|
*/
|
||||||
strmake(mi->rli.until_log_name, thd->lex->mi.log_file_name,
|
strmake(mi->rli.until_log_name, thd->lex->mi.log_file_name,
|
||||||
|
@ -3551,7 +3551,7 @@ static void
|
|||||||
make_join_readinfo(JOIN *join, uint options)
|
make_join_readinfo(JOIN *join, uint options)
|
||||||
{
|
{
|
||||||
uint i;
|
uint i;
|
||||||
SELECT_LEX *select_lex = &(join->thd->lex->select_lex);
|
SELECT_LEX *select_lex= &join->thd->lex->select_lex;
|
||||||
DBUG_ENTER("make_join_readinfo");
|
DBUG_ENTER("make_join_readinfo");
|
||||||
|
|
||||||
for (i=join->const_tables ; i < join->tables ; i++)
|
for (i=join->const_tables ; i < join->tables ; i++)
|
||||||
@ -8957,7 +8957,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
|
|||||||
List<Item> field_list;
|
List<Item> field_list;
|
||||||
List<Item> item_list;
|
List<Item> item_list;
|
||||||
THD *thd=join->thd;
|
THD *thd=join->thd;
|
||||||
SELECT_LEX *select_lex = &(join->thd->lex->select_lex);
|
SELECT_LEX *select_lex= &join->thd->lex->select_lex;
|
||||||
select_result *result=join->result;
|
select_result *result=join->result;
|
||||||
Item *item_null= new Item_null();
|
Item *item_null= new Item_null();
|
||||||
CHARSET_INFO *cs= &my_charset_latin1;
|
CHARSET_INFO *cs= &my_charset_latin1;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#define MYSQL_YACC
|
#define MYSQL_YACC
|
||||||
#define YYINITDEPTH 100
|
#define YYINITDEPTH 100
|
||||||
#define YYMAXDEPTH 3200 /* Because of 64K stack */
|
#define YYMAXDEPTH 3200 /* Because of 64K stack */
|
||||||
#define Lex ((YYTHD->lex))
|
#define Lex (YYTHD->lex)
|
||||||
#define Select Lex->current_select
|
#define Select Lex->current_select
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
#include "slave.h"
|
#include "slave.h"
|
||||||
|
Reference in New Issue
Block a user