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
0aa7a4b4
Commit
0aa7a4b4
authored
Feb 10, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
after merge & valgrind test fixes (BUG#2120)
parent
ff0a6e96
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
30 deletions
+50
-30
sql/sql_derived.cc
sql/sql_derived.cc
+2
-0
sql/sql_lex.cc
sql/sql_lex.cc
+1
-0
sql/sql_lex.h
sql/sql_lex.h
+2
-1
sql/sql_select.cc
sql/sql_select.cc
+37
-29
sql/sql_select.h
sql/sql_select.h
+2
-0
sql/sql_union.cc
sql/sql_union.cc
+6
-0
No files found.
sql/sql_derived.cc
View file @
0aa7a4b4
...
@@ -204,6 +204,8 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
...
@@ -204,6 +204,8 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
table
->
file
->
info
(
HA_STATUS_VARIABLE
);
table
->
file
->
info
(
HA_STATUS_VARIABLE
);
}
}
if
(
!
lex
->
describe
)
unit
->
cleanup
();
if
(
res
)
if
(
res
)
free_tmp_table
(
thd
,
table
);
free_tmp_table
(
thd
,
table
);
else
else
...
...
sql/sql_lex.cc
View file @
0aa7a4b4
...
@@ -988,6 +988,7 @@ void st_select_lex_unit::init_query()
...
@@ -988,6 +988,7 @@ void st_select_lex_unit::init_query()
union_result
=
0
;
union_result
=
0
;
table
=
0
;
table
=
0
;
fake_select_lex
=
0
;
fake_select_lex
=
0
;
cleaned
=
0
;
}
}
void
st_select_lex
::
init_query
()
void
st_select_lex
::
init_query
()
...
...
sql/sql_lex.h
View file @
0aa7a4b4
...
@@ -305,7 +305,8 @@ class st_select_lex_unit: public st_select_lex_node {
...
@@ -305,7 +305,8 @@ class st_select_lex_unit: public st_select_lex_node {
ulong
found_rows_for_union
;
ulong
found_rows_for_union
;
bool
prepared
,
// prepare phase already performed for UNION (unit)
bool
prepared
,
// prepare phase already performed for UNION (unit)
optimized
,
// optimize phase already performed for UNION (unit)
optimized
,
// optimize phase already performed for UNION (unit)
executed
;
// already executed
executed
,
// already executed
cleaned
;
public:
public:
// list of fields which points to temporary table for union
// list of fields which points to temporary table for union
...
...
sql/sql_select.cc
View file @
0aa7a4b4
...
@@ -1510,12 +1510,7 @@ JOIN::cleanup()
...
@@ -1510,12 +1510,7 @@ JOIN::cleanup()
JOIN_TAB
*
tab
,
*
end
;
JOIN_TAB
*
tab
,
*
end
;
for
(
tab
=
join_tab
,
end
=
tab
+
tables
;
tab
!=
end
;
tab
++
)
for
(
tab
=
join_tab
,
end
=
tab
+
tables
;
tab
!=
end
;
tab
++
)
{
{
delete
tab
->
select
;
tab
->
cleanup
();
delete
tab
->
quick
;
tab
->
select
=
0
;
tab
->
quick
=
0
;
x_free
(
tab
->
cache
.
buff
);
tab
->
cache
.
buff
=
0
;
}
}
}
}
tmp_join
->
tmp_join
=
0
;
tmp_join
->
tmp_join
=
0
;
...
@@ -3759,6 +3754,41 @@ bool error_if_full_join(JOIN *join)
...
@@ -3759,6 +3754,41 @@ bool error_if_full_join(JOIN *join)
}
}
/*
cleanup JOIN_TAB
SYNOPSIS
JOIN_TAB::cleanup()
*/
void
JOIN_TAB
::
cleanup
()
{
delete
select
;
select
=
0
;
delete
quick
;
quick
=
0
;
x_free
(
cache
.
buff
);
cache
.
buff
=
0
;
if
(
table
)
{
if
(
table
->
key_read
)
{
table
->
key_read
=
0
;
table
->
file
->
extra
(
HA_EXTRA_NO_KEYREAD
);
}
/* Don't free index if we are using read_record */
if
(
!
read_record
.
table
)
table
->
file
->
index_end
();
/*
We need to reset this for next select
(Tested in part_of_refkey)
*/
table
->
reginfo
.
join_tab
=
0
;
}
end_read_record
(
&
read_record
);
}
/*
/*
Free resources of given join
Free resources of given join
...
@@ -3803,29 +3833,7 @@ JOIN::join_free(bool full)
...
@@ -3803,29 +3833,7 @@ JOIN::join_free(bool full)
{
{
for
(
tab
=
join_tab
,
end
=
tab
+
tables
;
tab
!=
end
;
tab
++
)
for
(
tab
=
join_tab
,
end
=
tab
+
tables
;
tab
!=
end
;
tab
++
)
{
{
delete
tab
->
select
;
tab
->
cleanup
();
delete
tab
->
quick
;
tab
->
select
=
0
;
tab
->
quick
=
0
;
x_free
(
tab
->
cache
.
buff
);
tab
->
cache
.
buff
=
0
;
if
(
tab
->
table
)
{
if
(
tab
->
table
->
key_read
)
{
tab
->
table
->
key_read
=
0
;
tab
->
table
->
file
->
extra
(
HA_EXTRA_NO_KEYREAD
);
}
/* Don't free index if we are using read_record */
if
(
!
tab
->
read_record
.
table
)
tab
->
table
->
file
->
index_end
();
/*
We need to reset this for next select
(Tested in part_of_refkey)
*/
tab
->
table
->
reginfo
.
join_tab
=
0
;
}
end_read_record
(
&
tab
->
read_record
);
}
}
table
=
0
;
table
=
0
;
}
}
...
...
sql/sql_select.h
View file @
0aa7a4b4
...
@@ -108,6 +108,8 @@ typedef struct st_join_table {
...
@@ -108,6 +108,8 @@ typedef struct st_join_table {
TABLE_REF
ref
;
TABLE_REF
ref
;
JOIN_CACHE
cache
;
JOIN_CACHE
cache
;
JOIN
*
join
;
JOIN
*
join
;
void
cleanup
();
}
JOIN_TAB
;
}
JOIN_TAB
;
...
...
sql/sql_union.cc
View file @
0aa7a4b4
...
@@ -442,6 +442,12 @@ int st_select_lex_unit::cleanup()
...
@@ -442,6 +442,12 @@ int st_select_lex_unit::cleanup()
int
error
=
0
;
int
error
=
0
;
DBUG_ENTER
(
"st_select_lex_unit::cleanup"
);
DBUG_ENTER
(
"st_select_lex_unit::cleanup"
);
if
(
cleaned
)
{
DBUG_RETURN
(
0
);
}
cleaned
=
0
;
if
(
union_result
)
if
(
union_result
)
{
{
delete
union_result
;
delete
union_result
;
...
...
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