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
27395a2f
Commit
27395a2f
authored
Nov 16, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed joincleunup to avoid double deletin tables, and too earlyfull cleanup in case of EXPLAIN
fixed cleunup of TMP_TABLE_PARAM (BUG#6406)
parent
77540c89
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+12
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+10
-0
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+4
-2
No files found.
mysql-test/r/subselect.result
View file @
27395a2f
...
...
@@ -1991,3 +1991,15 @@ ac
NULL
drop tables t1,t2;
set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
insert into t2 values (1,3),(2,1);
select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b;
a b (select max(b) from t2 where t1.b=t2.a)
1 1 3
1 2 1
1 3 NULL
2 4 NULL
2 5 NULL
drop table t1, t2;
mysql-test/t/subselect.test
View file @
27395a2f
...
...
@@ -1289,3 +1289,13 @@ drop tables t1,t2;
connect
(
root
,
localhost
,
root
,,
test
,
$MASTER_MYPORT
,
$MASTER_MYSOCK
);
connection
root
;
set
@
got_val
=
(
SELECT
1
FROM
(
SELECT
'A'
as
my_col
)
as
T1
)
;
#
# primary query with temporary table and subquery with groupping
#
create
table
t1
(
a
int
,
b
int
);
create
table
t2
(
a
int
,
b
int
);
insert
into
t1
values
(
1
,
1
),(
1
,
2
),(
1
,
3
),(
2
,
4
),(
2
,
5
);
insert
into
t2
values
(
1
,
3
),(
2
,
1
);
select
distinct
a
,
b
,
(
select
max
(
b
)
from
t2
where
t1
.
b
=
t2
.
a
)
from
t1
order
by
t1
.
b
;
drop
table
t1
,
t2
;
sql/sql_class.h
View file @
27395a2f
...
...
@@ -1305,7 +1305,7 @@ class TMP_TABLE_PARAM :public Sql_alloc
if
(
copy_field
)
/* Fix for Intel compiler */
{
delete
[]
copy_field
;
copy_field
=
0
;
save_copy_field
=
copy_field
=
0
;
}
}
};
...
...
sql/sql_select.cc
View file @
27395a2f
...
...
@@ -936,7 +936,7 @@ JOIN::optimize()
}
}
if
(
select_lex
->
master_unit
()
->
uncacheable
)
if
(
select_lex
->
uncacheable
)
{
if
(
!
(
tmp_join
=
(
JOIN
*
)
thd
->
alloc
(
sizeof
(
JOIN
))))
DBUG_RETURN
(
-
1
);
...
...
@@ -3833,7 +3833,8 @@ JOIN::join_free(bool full)
JOIN_TAB
*
tab
,
*
end
;
DBUG_ENTER
(
"JOIN::join_free"
);
full
=
full
||
!
select_lex
->
uncacheable
;
full
=
full
||
(
!
select_lex
->
uncacheable
&&
!
thd
->
lex
->
describe
);
if
(
table
)
{
...
...
@@ -3862,6 +3863,7 @@ JOIN::join_free(bool full)
for
(
tab
=
join_tab
,
end
=
tab
+
tables
;
tab
!=
end
;
tab
++
)
tab
->
cleanup
();
table
=
0
;
tables
=
0
;
}
else
{
...
...
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