Commit e31d7282 authored by Mikael Ronstrom's avatar Mikael Ronstrom

BUG#59549, fix compiler error on Windows, step 2

parent 14a46479
...@@ -551,7 +551,7 @@ sp_head::operator delete(void *ptr, size_t size) throw() ...@@ -551,7 +551,7 @@ sp_head::operator delete(void *ptr, size_t size) throw()
sp_head::sp_head() sp_head::sp_head()
:Query_arena(&main_mem_root, INITIALIZED_FOR_SP), :Query_arena(&main_mem_root, ES_INITIALIZED_FOR_SP),
m_flags(0), m_flags(0),
m_sp_cache_version(0), m_sp_cache_version(0),
unsafe_flags(0), unsafe_flags(0),
...@@ -1209,7 +1209,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success) ...@@ -1209,7 +1209,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
Query_arena *old_arena; Query_arena *old_arena;
/* per-instruction arena */ /* per-instruction arena */
MEM_ROOT execute_mem_root; MEM_ROOT execute_mem_root;
Query_arena execute_arena(&execute_mem_root, INITIALIZED_FOR_SP), Query_arena execute_arena(&execute_mem_root, ES_INITIALIZED_FOR_SP),
backup_arena; backup_arena;
query_id_t old_query_id; query_id_t old_query_id;
TABLE *old_derived_tables; TABLE *old_derived_tables;
...@@ -1489,7 +1489,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success) ...@@ -1489,7 +1489,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
thd->m_reprepare_observer= save_reprepare_observer; thd->m_reprepare_observer= save_reprepare_observer;
thd->stmt_arena= old_arena; thd->stmt_arena= old_arena;
state= EXECUTED; state= ES_EXECUTED;
/* /*
Restore the caller's original warning information area: Restore the caller's original warning information area:
...@@ -1647,7 +1647,7 @@ sp_head::execute_trigger(THD *thd, ...@@ -1647,7 +1647,7 @@ sp_head::execute_trigger(THD *thd,
sp_rcontext *nctx = NULL; sp_rcontext *nctx = NULL;
bool err_status= FALSE; bool err_status= FALSE;
MEM_ROOT call_mem_root; MEM_ROOT call_mem_root;
Query_arena call_arena(&call_mem_root, Query_arena::INITIALIZED_FOR_SP); Query_arena call_arena(&call_mem_root, Query_arena::ES_INITIALIZED_FOR_SP);
Query_arena backup_arena; Query_arena backup_arena;
DBUG_ENTER("sp_head::execute_trigger"); DBUG_ENTER("sp_head::execute_trigger");
...@@ -1788,7 +1788,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, ...@@ -1788,7 +1788,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
String binlog_buf(buf, sizeof(buf), &my_charset_bin); String binlog_buf(buf, sizeof(buf), &my_charset_bin);
bool err_status= FALSE; bool err_status= FALSE;
MEM_ROOT call_mem_root; MEM_ROOT call_mem_root;
Query_arena call_arena(&call_mem_root, Query_arena::INITIALIZED_FOR_SP); Query_arena call_arena(&call_mem_root, Query_arena::ES_INITIALIZED_FOR_SP);
Query_arena backup_arena; Query_arena backup_arena;
DBUG_ENTER("sp_head::execute_function"); DBUG_ENTER("sp_head::execute_function");
DBUG_PRINT("info", ("function %s", m_name.str)); DBUG_PRINT("info", ("function %s", m_name.str));
...@@ -2545,7 +2545,7 @@ sp_head::restore_thd_mem_root(THD *thd) ...@@ -2545,7 +2545,7 @@ sp_head::restore_thd_mem_root(THD *thd)
DBUG_ENTER("sp_head::restore_thd_mem_root"); DBUG_ENTER("sp_head::restore_thd_mem_root");
Item *flist= free_list; // The old list Item *flist= free_list; // The old list
set_query_arena(thd); // Get new free_list and mem_root set_query_arena(thd); // Get new free_list and mem_root
state= INITIALIZED_FOR_SP; state= ES_INITIALIZED_FOR_SP;
DBUG_PRINT("info", ("mem_root 0x%lx returned from thd mem root 0x%lx", DBUG_PRINT("info", ("mem_root 0x%lx returned from thd mem root 0x%lx",
(ulong) &mem_root, (ulong) &thd->mem_root)); (ulong) &mem_root, (ulong) &thd->mem_root));
...@@ -3009,7 +3009,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, ...@@ -3009,7 +3009,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
(thd->stmt_da->sql_errno() != ER_CANT_REOPEN_TABLE && (thd->stmt_da->sql_errno() != ER_CANT_REOPEN_TABLE &&
thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE &&
thd->stmt_da->sql_errno() != ER_UPDATE_TABLE_USED)) thd->stmt_da->sql_errno() != ER_UPDATE_TABLE_USED))
thd->stmt_arena->state= Query_arena::EXECUTED; thd->stmt_arena->state= Query_arena::ES_EXECUTED;
/* /*
Merge here with the saved parent's values Merge here with the saved parent's values
......
...@@ -560,7 +560,7 @@ public: ...@@ -560,7 +560,7 @@ public:
/// Should give each a name or type code for debugging purposes? /// Should give each a name or type code for debugging purposes?
sp_instr(uint ip, sp_pcontext *ctx) sp_instr(uint ip, sp_pcontext *ctx)
:Query_arena(0, INITIALIZED_FOR_SP), marked(0), m_ip(ip), m_ctx(ctx) :Query_arena(0, ES_INITIALIZED_FOR_SP), marked(0), m_ip(ip), m_ctx(ctx)
{} {}
virtual ~sp_instr() virtual ~sp_instr()
......
...@@ -493,7 +493,7 @@ bool Drop_table_error_handler::handle_condition(THD *thd, ...@@ -493,7 +493,7 @@ bool Drop_table_error_handler::handle_condition(THD *thd,
THD::THD() THD::THD()
:Statement(&main_lex, &main_mem_root, CONVENTIONAL_EXECUTION, :Statement(&main_lex, &main_mem_root, ES_CONVENTIONAL_EXECUTION,
/* statement id */ 0), /* statement id */ 0),
rli_fake(0), rli_fake(0),
user_time(0), in_sub_stmt(0), user_time(0), in_sub_stmt(0),
......
...@@ -624,14 +624,14 @@ public: ...@@ -624,14 +624,14 @@ public:
/* /*
The states relfects three diffrent life cycles for three The states relfects three diffrent life cycles for three
different types of statements: different types of statements:
Prepared statement: INITIALIZED -> PREPARED -> EXECUTED. Prepared statement: ES_INITIALIZED -> ES_PREPARED -> ES_EXECUTED.
Stored procedure: INITIALIZED_FOR_SP -> EXECUTED. Stored procedure: ES_INITIALIZED_FOR_SP -> ES_EXECUTED.
Other statements: CONVENTIONAL_EXECUTION never changes. Other statements: ES_CONVENTIONAL_EXECUTION never changes.
*/ */
enum enum_state enum enum_state
{ {
INITIALIZED= 0, INITIALIZED_FOR_SP= 1, PREPARED= 2, ES_INITIALIZED= 0, ES_INITIALIZED_FOR_SP= 1, ES_PREPARED= 2,
CONVENTIONAL_EXECUTION= 3, EXECUTED= 4, ERROR= -1 ES_CONVENTIONAL_EXECUTION= 3, ES_EXECUTED= 4, ES_ERROR= -1
}; };
enum_state state; enum_state state;
...@@ -654,18 +654,18 @@ public: ...@@ -654,18 +654,18 @@ public:
virtual Type type() const; virtual Type type() const;
virtual ~Query_arena() {}; virtual ~Query_arena() {};
inline bool is_stmt_prepare() const { return state == INITIALIZED; } inline bool is_stmt_prepare() const { return state == ES_INITIALIZED; }
inline bool is_first_sp_execute() const inline bool is_first_sp_execute() const
{ return state == INITIALIZED_FOR_SP; } { return state == ES_INITIALIZED_FOR_SP; }
inline bool is_stmt_prepare_or_first_sp_execute() const inline bool is_stmt_prepare_or_first_sp_execute() const
{ return (int)state < (int)PREPARED; } { return (int)state < (int)ES_PREPARED; }
inline bool is_stmt_prepare_or_first_stmt_execute() const inline bool is_stmt_prepare_or_first_stmt_execute() const
{ return (int)state <= (int)PREPARED; } { return (int)state <= (int)ES_PREPARED; }
inline bool is_first_stmt_execute() const { return state == PREPARED; } inline bool is_first_stmt_execute() const { return state == ES_PREPARED; }
inline bool is_stmt_execute() const inline bool is_stmt_execute() const
{ return state == PREPARED || state == EXECUTED; } { return state == ES_PREPARED || state == ES_EXECUTED; }
inline bool is_conventional() const inline bool is_conventional() const
{ return state == CONVENTIONAL_EXECUTION; } { return state == ES_CONVENTIONAL_EXECUTION; }
inline void* alloc(size_t size) { return alloc_root(mem_root,size); } inline void* alloc(size_t size) { return alloc_root(mem_root,size); }
inline void* calloc(size_t size) inline void* calloc(size_t size)
......
...@@ -46,7 +46,7 @@ protected: ...@@ -46,7 +46,7 @@ protected:
select_result *result; select_result *result;
public: public:
Server_side_cursor(MEM_ROOT *mem_root_arg, select_result *result_arg) Server_side_cursor(MEM_ROOT *mem_root_arg, select_result *result_arg)
:Query_arena(mem_root_arg, INITIALIZED), result(result_arg) :Query_arena(mem_root_arg, ES_INITIALIZED), result(result_arg)
{} {}
virtual bool is_open() const= 0; virtual bool is_open() const= 0;
......
...@@ -2712,7 +2712,7 @@ void mysqld_stmt_reset(THD *thd, char *packet) ...@@ -2712,7 +2712,7 @@ void mysqld_stmt_reset(THD *thd, char *packet)
*/ */
reset_stmt_params(stmt); reset_stmt_params(stmt);
stmt->state= Query_arena::PREPARED; stmt->state= Query_arena::ES_PREPARED;
general_log_print(thd, thd->command, NullS); general_log_print(thd, thd->command, NullS);
...@@ -2830,7 +2830,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) ...@@ -2830,7 +2830,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
if (param_number >= stmt->param_count) if (param_number >= stmt->param_count)
{ {
/* Error will be sent in execute call */ /* Error will be sent in execute call */
stmt->state= Query_arena::ERROR; stmt->state= Query_arena::ES_ERROR;
stmt->last_errno= ER_WRONG_ARGUMENTS; stmt->last_errno= ER_WRONG_ARGUMENTS;
sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS), sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS),
"mysqld_stmt_send_long_data"); "mysqld_stmt_send_long_data");
...@@ -2846,7 +2846,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) ...@@ -2846,7 +2846,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
if (param->set_longdata(thd->extra_data, thd->extra_length)) if (param->set_longdata(thd->extra_data, thd->extra_length))
#endif #endif
{ {
stmt->state= Query_arena::ERROR; stmt->state= Query_arena::ES_ERROR;
stmt->last_errno= ER_OUTOFMEMORY; stmt->last_errno= ER_OUTOFMEMORY;
sprintf(stmt->last_error, ER(ER_OUTOFMEMORY), 0); sprintf(stmt->last_error, ER(ER_OUTOFMEMORY), 0);
} }
...@@ -2999,7 +2999,7 @@ end: ...@@ -2999,7 +2999,7 @@ end:
Prepared_statement::Prepared_statement(THD *thd_arg) Prepared_statement::Prepared_statement(THD *thd_arg)
:Statement(NULL, &main_mem_root, :Statement(NULL, &main_mem_root,
INITIALIZED, ++thd_arg->statement_id_counter), ES_INITIALIZED, ++thd_arg->statement_id_counter),
thd(thd_arg), thd(thd_arg),
result(thd_arg), result(thd_arg),
param_array(0), param_array(0),
...@@ -3272,7 +3272,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) ...@@ -3272,7 +3272,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
{ {
setup_set_params(); setup_set_params();
lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_PREPARE; lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_PREPARE;
state= Query_arena::PREPARED; state= Query_arena::ES_PREPARED;
flags&= ~ (uint) IS_IN_USE; flags&= ~ (uint) IS_IN_USE;
/* /*
...@@ -3446,7 +3446,7 @@ Prepared_statement::execute_server_runnable(Server_runnable *server_runnable) ...@@ -3446,7 +3446,7 @@ Prepared_statement::execute_server_runnable(Server_runnable *server_runnable)
Item_change_list save_change_list; Item_change_list save_change_list;
thd->change_list.move_elements_to(&save_change_list); thd->change_list.move_elements_to(&save_change_list);
state= CONVENTIONAL_EXECUTION; state= ES_CONVENTIONAL_EXECUTION;
if (!(lex= new (mem_root) st_lex_local)) if (!(lex= new (mem_root) st_lex_local))
return TRUE; return TRUE;
...@@ -3657,7 +3657,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) ...@@ -3657,7 +3657,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
status_var_increment(thd->status_var.com_stmt_execute); status_var_increment(thd->status_var.com_stmt_execute);
/* Check if we got an error when sending long data */ /* Check if we got an error when sending long data */
if (state == Query_arena::ERROR) if (state == Query_arena::ES_ERROR)
{ {
my_message(last_errno, last_error, MYF(0)); my_message(last_errno, last_error, MYF(0));
return TRUE; return TRUE;
...@@ -3787,8 +3787,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) ...@@ -3787,8 +3787,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
thd->set_statement(&stmt_backup); thd->set_statement(&stmt_backup);
thd->stmt_arena= old_stmt_arena; thd->stmt_arena= old_stmt_arena;
if (state == Query_arena::PREPARED) if (state == Query_arena::ES_PREPARED)
state= Query_arena::EXECUTED; state= Query_arena::ES_EXECUTED;
if (error == 0 && this->lex->sql_command == SQLCOM_CALL) if (error == 0 && this->lex->sql_command == SQLCOM_CALL)
{ {
......
...@@ -1933,7 +1933,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, ...@@ -1933,7 +1933,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
Query_arena *backup_stmt_arena_ptr= thd->stmt_arena; Query_arena *backup_stmt_arena_ptr= thd->stmt_arena;
Query_arena backup_arena; Query_arena backup_arena;
Query_arena part_func_arena(&outparam->mem_root, Query_arena::INITIALIZED); Query_arena part_func_arena(&outparam->mem_root, Query_arena::ES_INITIALIZED);
thd->set_n_backup_active_arena(&part_func_arena, &backup_arena); thd->set_n_backup_active_arena(&part_func_arena, &backup_arena);
thd->stmt_arena= &part_func_arena; thd->stmt_arena= &part_func_arena;
bool tmp; bool tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment