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
59350ce0
Commit
59350ce0
authored
Jul 11, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13292 Move the code from sp_head::init() to sp_head::sp_head()
parent
42cb3dcb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
40 deletions
+18
-40
sql/sp_head.cc
sql/sp_head.cc
+16
-37
sql/sp_head.h
sql/sp_head.h
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-2
No files found.
sql/sp_head.cc
View file @
59350ce0
...
...
@@ -540,15 +540,30 @@ sp_head::operator delete(void *ptr, size_t size) throw()
}
sp_head
::
sp_head
()
sp_head
::
sp_head
(
stored_procedure_type
type
)
:
Query_arena
(
&
main_mem_root
,
STMT_INITIALIZED_FOR_SP
),
Database_qualified_name
(
&
null_clex_str
,
&
null_clex_str
),
m_type
(
type
),
m_flags
(
0
),
m_explicit_name
(
false
),
/*
FIXME: the only use case when name is NULL is events, and it should
be rewritten soon. Remove the else part and replace 'if' with
an assert when this is done.
*/
m_qname
(
null_clex_str
),
m_params
(
null_clex_str
),
m_body
(
null_clex_str
),
m_body_utf8
(
null_clex_str
),
m_defstr
(
null_clex_str
),
m_sp_cache_version
(
0
),
m_creation_ctx
(
0
),
unsafe_flags
(
0
),
m_recursion_level
(
0
),
m_next_cached_sp
(
0
),
m_param_begin
(
NULL
),
m_param_end
(
NULL
),
m_body_begin
(
NULL
),
m_cont_level
(
0
)
{
m_first_instance
=
this
;
...
...
@@ -556,12 +571,6 @@ sp_head::sp_head()
m_last_cached_sp
=
this
;
m_return_field_def
.
charset
=
NULL
;
/*
FIXME: the only use case when name is NULL is events, and it should
be rewritten soon. Remove the else part and replace 'if' with
an assert when this is done.
*/
m_qname
=
null_clex_str
;
DBUG_ENTER
(
"sp_head::sp_head"
);
...
...
@@ -573,9 +582,6 @@ sp_head::sp_head()
my_hash_init
(
&
m_sroutines
,
system_charset_info
,
0
,
0
,
0
,
sp_sroutine_key
,
0
,
0
);
m_body_utf8
.
str
=
NULL
;
m_body_utf8
.
length
=
0
;
DBUG_VOID_RETURN
;
}
...
...
@@ -597,33 +603,6 @@ sp_head::init(LEX *lex)
lex
->
trg_table_fields
.
empty
();
my_init_dynamic_array
(
&
m_instr
,
sizeof
(
sp_instr
*
),
16
,
8
,
MYF
(
0
));
m_param_begin
=
NULL
;
m_param_end
=
NULL
;
m_body_begin
=
NULL
;
m_qname
.
str
=
NULL
;
m_qname
.
length
=
0
;
m_explicit_name
=
false
;
m_db
.
str
=
NULL
;
m_db
.
length
=
0
;
m_name
.
str
=
NULL
;
m_name
.
length
=
0
;
m_params
.
str
=
NULL
;
m_params
.
length
=
0
;
m_body
.
str
=
NULL
;
m_body
.
length
=
0
;
m_defstr
.
str
=
NULL
;
m_defstr
.
length
=
0
;
m_return_field_def
.
charset
=
NULL
;
DBUG_VOID_RETURN
;
}
...
...
sql/sp_head.h
View file @
59350ce0
...
...
@@ -303,7 +303,7 @@ class sp_head :private Query_arena,
static
void
operator
delete
(
void
*
ptr
,
size_t
size
)
throw
();
sp_head
();
sp_head
(
stored_procedure_type
type
);
/// Initialize after we have reset mem_root
void
...
...
sql/sql_lex.cc
View file @
59350ce0
...
...
@@ -5825,11 +5825,10 @@ sp_head *LEX::make_sp_head(THD *thd, sp_name *name,
sp_head
*
sp
;
/* Order is important here: new - reset - init */
if
((
sp
=
new
sp_head
()))
if
((
sp
=
new
sp_head
(
type
)))
{
sp
->
reset_thd_mem_root
(
thd
);
sp
->
init
(
this
);
sp
->
m_type
=
type
;
if
(
name
)
sp
->
init_sp_name
(
thd
,
name
);
sp
->
m_chistics
=
&
sp_chistics
;
...
...
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