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
e822f61d
Commit
e822f61d
authored
May 26, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleunup items of instruction after every instruction execution
parent
5e83cf32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
sql/sp_head.cc
sql/sp_head.cc
+21
-0
sql/sp_head.h
sql/sp_head.h
+8
-9
No files found.
sql/sp_head.cc
View file @
e822f61d
...
@@ -406,6 +406,8 @@ sp_head::execute(THD *thd)
...
@@ -406,6 +406,8 @@ sp_head::execute(THD *thd)
break
;
break
;
DBUG_PRINT
(
"execute"
,
(
"Instruction %u"
,
ip
));
DBUG_PRINT
(
"execute"
,
(
"Instruction %u"
,
ip
));
ret
=
i
->
execute
(
thd
,
&
ip
);
ret
=
i
->
execute
(
thd
,
&
ip
);
if
(
i
->
free_list
)
cleanup_items
(
i
->
free_list
);
// Check if an exception has occurred and a handler has been found
// Check if an exception has occurred and a handler has been found
// Note: We havo to check even if ret==0, since warnings (and some
// Note: We havo to check even if ret==0, since warnings (and some
// errors don't return a non-zero value.
// errors don't return a non-zero value.
...
@@ -434,9 +436,11 @@ sp_head::execute(THD *thd)
...
@@ -434,9 +436,11 @@ sp_head::execute(THD *thd)
done:
done:
DBUG_PRINT
(
"info"
,
(
"ret=%d killed=%d query_error=%d"
,
DBUG_PRINT
(
"info"
,
(
"ret=%d killed=%d query_error=%d"
,
ret
,
thd
->
killed
,
thd
->
query_error
));
ret
,
thd
->
killed
,
thd
->
query_error
));
if
(
thd
->
current_arena
)
if
(
thd
->
current_arena
)
cleanup_items
(
thd
->
current_arena
->
free_list
);
cleanup_items
(
thd
->
current_arena
->
free_list
);
thd
->
current_arena
=
0
;
thd
->
current_arena
=
0
;
if
(
thd
->
killed
||
thd
->
query_error
||
thd
->
net
.
report_error
)
if
(
thd
->
killed
||
thd
->
query_error
||
thd
->
net
.
report_error
)
ret
=
-
1
;
ret
=
-
1
;
/* If the DB has changed, the pointer has changed too, but the
/* If the DB has changed, the pointer has changed too, but the
...
@@ -860,6 +864,23 @@ sp_head::show_create_procedure(THD *thd)
...
@@ -860,6 +864,23 @@ sp_head::show_create_procedure(THD *thd)
DBUG_RETURN
(
res
);
DBUG_RETURN
(
res
);
}
}
/*
Add instruction to SP
SYNOPSIS
sp_head::add_instr()
instr Instruction
*/
void
sp_head
::
add_instr
(
sp_instr
*
instr
)
{
instr
->
free_list
=
m_thd
->
free_list
;
m_thd
->
free_list
=
0
;
insert_dynamic
(
&
m_instr
,
(
gptr
)
&
instr
);
}
int
int
sp_head
::
show_create_function
(
THD
*
thd
)
sp_head
::
show_create_function
(
THD
*
thd
)
{
{
...
...
sql/sp_head.h
View file @
e822f61d
...
@@ -108,7 +108,7 @@ class sp_head :private Item_arena
...
@@ -108,7 +108,7 @@ class sp_head :private Item_arena
static
void
*
static
void
*
operator
new
(
size_t
size
);
operator
new
(
size_t
size
);
static
void
static
void
operator
delete
(
void
*
ptr
,
size_t
size
);
operator
delete
(
void
*
ptr
,
size_t
size
);
sp_head
();
sp_head
();
...
@@ -123,7 +123,7 @@ class sp_head :private Item_arena
...
@@ -123,7 +123,7 @@ class sp_head :private Item_arena
int
int
create
(
THD
*
thd
);
create
(
THD
*
thd
);
virtual
~
sp_head
();
virtual
~
sp_head
();
// Free memory
// Free memory
...
@@ -142,11 +142,8 @@ class sp_head :private Item_arena
...
@@ -142,11 +142,8 @@ class sp_head :private Item_arena
int
int
show_create_function
(
THD
*
thd
);
show_create_function
(
THD
*
thd
);
inline
void
void
add_instr
(
sp_instr
*
i
)
add_instr
(
sp_instr
*
instr
);
{
insert_dynamic
(
&
m_instr
,
(
gptr
)
&
i
);
}
inline
uint
inline
uint
instructions
()
instructions
()
...
@@ -249,13 +246,15 @@ class sp_instr : public Sql_alloc
...
@@ -249,13 +246,15 @@ class sp_instr : public Sql_alloc
public:
public:
Item
*
free_list
;
// My Items
// 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_instr
(
uint
ip
)
:
Sql_alloc
(
),
m_ip
(
ip
)
:
Sql_alloc
(),
free_list
(
0
),
m_ip
(
ip
)
{}
{}
virtual
~
sp_instr
()
virtual
~
sp_instr
()
{}
{
free_items
(
free_list
);
}
// Execute this instrution. '*nextp' will be set to the index of the next
// Execute this instrution. '*nextp' will be set to the index of the next
// instruction to execute. (For most instruction this will be the
// instruction to execute. (For most instruction this will be the
...
...
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