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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e31d7282
Commit
e31d7282
authored
Jan 20, 2011
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#59549, fix compiler error on Windows, step 2
parent
14a46479
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
32 deletions
+32
-32
sql/sp_head.cc
sql/sp_head.cc
+7
-7
sql/sp_head.h
sql/sp_head.h
+1
-1
sql/sql_class.cc
sql/sql_class.cc
+1
-1
sql/sql_class.h
sql/sql_class.h
+12
-12
sql/sql_cursor.h
sql/sql_cursor.h
+1
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+9
-9
sql/table.cc
sql/table.cc
+1
-1
No files found.
sql/sp_head.cc
View file @
e31d7282
...
...
@@ -551,7 +551,7 @@ sp_head::operator delete(void *ptr, size_t size) throw()
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_sp_cache_version
(
0
),
unsafe_flags
(
0
),
...
...
@@ -1209,7 +1209,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
Query_arena
*
old_arena
;
/* per-instruction arena */
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
;
query_id_t
old_query_id
;
TABLE
*
old_derived_tables
;
...
...
@@ -1489,7 +1489,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
thd
->
m_reprepare_observer
=
save_reprepare_observer
;
thd
->
stmt_arena
=
old_arena
;
state
=
EXECUTED
;
state
=
E
S_E
XECUTED
;
/*
Restore the caller's original warning information area:
...
...
@@ -1647,7 +1647,7 @@ sp_head::execute_trigger(THD *thd,
sp_rcontext
*
nctx
=
NULL
;
bool
err_status
=
FALSE
;
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
;
DBUG_ENTER
(
"sp_head::execute_trigger"
);
...
...
@@ -1788,7 +1788,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
String
binlog_buf
(
buf
,
sizeof
(
buf
),
&
my_charset_bin
);
bool
err_status
=
FALSE
;
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
;
DBUG_ENTER
(
"sp_head::execute_function"
);
DBUG_PRINT
(
"info"
,
(
"function %s"
,
m_name
.
str
));
...
...
@@ -2545,7 +2545,7 @@ sp_head::restore_thd_mem_root(THD *thd)
DBUG_ENTER
(
"sp_head::restore_thd_mem_root"
);
Item
*
flist
=
free_list
;
// The old list
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"
,
(
ulong
)
&
mem_root
,
(
ulong
)
&
thd
->
mem_root
));
...
...
@@ -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_NO_SUCH_TABLE
&&
thd
->
stmt_da
->
sql_errno
()
!=
ER_UPDATE_TABLE_USED
))
thd
->
stmt_arena
->
state
=
Query_arena
::
EXECUTED
;
thd
->
stmt_arena
->
state
=
Query_arena
::
E
S_E
XECUTED
;
/*
Merge here with the saved parent's values
...
...
sql/sp_head.h
View file @
e31d7282
...
...
@@ -560,7 +560,7 @@ public:
/// Should give each a name or type code for debugging purposes?
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
()
...
...
sql/sql_class.cc
View file @
e31d7282
...
...
@@ -493,7 +493,7 @@ bool Drop_table_error_handler::handle_condition(THD *thd,
THD
::
THD
()
:
Statement
(
&
main_lex
,
&
main_mem_root
,
CONVENTIONAL_EXECUTION
,
:
Statement
(
&
main_lex
,
&
main_mem_root
,
ES_
CONVENTIONAL_EXECUTION
,
/* statement id */
0
),
rli_fake
(
0
),
user_time
(
0
),
in_sub_stmt
(
0
),
...
...
sql/sql_class.h
View file @
e31d7282
...
...
@@ -624,14 +624,14 @@ public:
/*
The states relfects three diffrent life cycles for three
different types of statements:
Prepared statement:
INITIALIZED -> PREPARED ->
EXECUTED.
Stored procedure:
INITIALIZED_FOR_SP ->
EXECUTED.
Other statements: CONVENTIONAL_EXECUTION never changes.
Prepared statement:
ES_INITIALIZED -> ES_PREPARED -> ES_
EXECUTED.
Stored procedure:
ES_INITIALIZED_FOR_SP -> ES_
EXECUTED.
Other statements:
ES_
CONVENTIONAL_EXECUTION never changes.
*/
enum
enum_state
{
INITIALIZED
=
0
,
INITIALIZED_FOR_SP
=
1
,
PREPARED
=
2
,
CONVENTIONAL_EXECUTION
=
3
,
EXECUTED
=
4
,
ERROR
=
-
1
ES_INITIALIZED
=
0
,
ES_INITIALIZED_FOR_SP
=
1
,
ES_
PREPARED
=
2
,
ES_CONVENTIONAL_EXECUTION
=
3
,
ES_EXECUTED
=
4
,
ES_
ERROR
=
-
1
};
enum_state
state
;
...
...
@@ -654,18 +654,18 @@ public:
virtual
Type
type
()
const
;
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
{
return
state
==
INITIALIZED_FOR_SP
;
}
{
return
state
==
ES_
INITIALIZED_FOR_SP
;
}
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
{
return
(
int
)
state
<=
(
int
)
PREPARED
;
}
inline
bool
is_first_stmt_execute
()
const
{
return
state
==
PREPARED
;
}
{
return
(
int
)
state
<=
(
int
)
ES_
PREPARED
;
}
inline
bool
is_first_stmt_execute
()
const
{
return
state
==
ES_
PREPARED
;
}
inline
bool
is_stmt_execute
()
const
{
return
state
==
PREPARED
||
state
==
EXECUTED
;
}
{
return
state
==
ES_PREPARED
||
state
==
ES_
EXECUTED
;
}
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
*
calloc
(
size_t
size
)
...
...
sql/sql_cursor.h
View file @
e31d7282
...
...
@@ -46,7 +46,7 @@ protected:
select_result
*
result
;
public:
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
;
...
...
sql/sql_prepare.cc
View file @
e31d7282
...
...
@@ -2712,7 +2712,7 @@ void mysqld_stmt_reset(THD *thd, char *packet)
*/
reset_stmt_params
(
stmt
);
stmt
->
state
=
Query_arena
::
PREPARED
;
stmt
->
state
=
Query_arena
::
ES_
PREPARED
;
general_log_print
(
thd
,
thd
->
command
,
NullS
);
...
...
@@ -2830,7 +2830,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
if
(
param_number
>=
stmt
->
param_count
)
{
/* Error will be sent in execute call */
stmt
->
state
=
Query_arena
::
ERROR
;
stmt
->
state
=
Query_arena
::
E
S_E
RROR
;
stmt
->
last_errno
=
ER_WRONG_ARGUMENTS
;
sprintf
(
stmt
->
last_error
,
ER
(
ER_WRONG_ARGUMENTS
),
"mysqld_stmt_send_long_data"
);
...
...
@@ -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
))
#endif
{
stmt
->
state
=
Query_arena
::
ERROR
;
stmt
->
state
=
Query_arena
::
E
S_E
RROR
;
stmt
->
last_errno
=
ER_OUTOFMEMORY
;
sprintf
(
stmt
->
last_error
,
ER
(
ER_OUTOFMEMORY
),
0
);
}
...
...
@@ -2999,7 +2999,7 @@ end:
Prepared_statement
::
Prepared_statement
(
THD
*
thd_arg
)
:
Statement
(
NULL
,
&
main_mem_root
,
INITIALIZED
,
++
thd_arg
->
statement_id_counter
),
ES_
INITIALIZED
,
++
thd_arg
->
statement_id_counter
),
thd
(
thd_arg
),
result
(
thd_arg
),
param_array
(
0
),
...
...
@@ -3272,7 +3272,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
{
setup_set_params
();
lex
->
context_analysis_only
&=
~
CONTEXT_ANALYSIS_ONLY_PREPARE
;
state
=
Query_arena
::
PREPARED
;
state
=
Query_arena
::
ES_
PREPARED
;
flags
&=
~
(
uint
)
IS_IN_USE
;
/*
...
...
@@ -3446,7 +3446,7 @@ Prepared_statement::execute_server_runnable(Server_runnable *server_runnable)
Item_change_list
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
))
return
TRUE
;
...
...
@@ -3657,7 +3657,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
status_var_increment
(
thd
->
status_var
.
com_stmt_execute
);
/* Check if we got an error when sending long data */
if
(
state
==
Query_arena
::
ERROR
)
if
(
state
==
Query_arena
::
E
S_E
RROR
)
{
my_message
(
last_errno
,
last_error
,
MYF
(
0
));
return
TRUE
;
...
...
@@ -3787,8 +3787,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
thd
->
set_statement
(
&
stmt_backup
);
thd
->
stmt_arena
=
old_stmt_arena
;
if
(
state
==
Query_arena
::
PREPARED
)
state
=
Query_arena
::
EXECUTED
;
if
(
state
==
Query_arena
::
ES_
PREPARED
)
state
=
Query_arena
::
E
S_E
XECUTED
;
if
(
error
==
0
&&
this
->
lex
->
sql_command
==
SQLCOM_CALL
)
{
...
...
sql/table.cc
View file @
e31d7282
...
...
@@ -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_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
->
stmt_arena
=
&
part_func_arena
;
bool
tmp
;
...
...
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