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
0e763988
Commit
0e763988
authored
Feb 22, 2008
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B30604-5.0-opt
parents
5b508f2d
8af4b43b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
185 deletions
+97
-185
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+31
-97
mysql-test/r/tablelock.result
mysql-test/r/tablelock.result
+9
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+38
-86
mysql-test/t/tablelock.test
mysql-test/t/tablelock.test
+13
-0
sql/sql_base.cc
sql/sql_base.cc
+6
-2
No files found.
mysql-test/r/subselect.result
View file @
0e763988
...
@@ -4147,103 +4147,37 @@ DROP TABLE t1,t2;
...
@@ -4147,103 +4147,37 @@ DROP TABLE t1,t2;
create table t1(a int,b int,key(a),key(b));
create table t1(a int,b int,key(a),key(b));
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
(6,7),(7,4),(5,3);
(6,7),(7,4),(5,3);
select sum(a),a from t1 where a> (
5
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
4
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
3
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
2
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
1
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
26
select sum(a) from t1 where a> ( select sum(a) from t1
25
)group by b limit 1)group by b limit 1
24
)group by b limit 1)group by b limit 1)group by b limit 1
23
)group by b limit 1)group by b limit 1)group by b limit 1
22
)group by b limit 1)group by b limit 1)group by b limit 1)
21
group by a;
20
sum(a) a
19
select sum(a),a from t1 where a> (
18
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
17
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
16
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
15
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
14
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
13
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
12
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
11
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
10
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
9
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
8
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
7
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
6
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
5
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
4
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
3
select sum(a) from t1
2
)group by b limit 1)group by b limit 1)group by b limit 1
1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1)
group by a;
ERROR HY000: Thread stack overrun detected
explain select sum(a),a from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1
)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1)
group by a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a a 5 NULL 9 Using where; Using index
2 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
3 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
4 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
5 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
6 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
7 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
8 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
9 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
10 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
11 SUBQUERY t1 range a a 5 NULL 9 Using where; Using temporary; Using filesort
12 SUBQUERY t1 range a a 5 NULL 1 Using where; Using temporary; Using filesort
13 SUBQUERY t1 index NULL a 5 NULL 9 Using index
explain select sum(a),a from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
select sum(a) from t1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1
)group by b limit 1)group by b limit 1)group by b limit 1)
group by a;
ERROR HY000: Thread stack overrun detected
drop table t1;
drop table t1;
CREATE TABLE t1 (a1 INT, a2 INT);
CREATE TABLE t1 (a1 INT, a2 INT);
CREATE TABLE t2 (b1 INT, b2 INT);
CREATE TABLE t2 (b1 INT, b2 INT);
...
...
mysql-test/r/tablelock.result
View file @
0e763988
...
@@ -46,3 +46,12 @@ CREATE TABLE t2 (a int);
...
@@ -46,3 +46,12 @@ CREATE TABLE t2 (a int);
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
drop table t2,t1;
drop table t2,t1;
unlock tables;
unlock tables;
create temporary table t1(f1 int);
lock tables t1 write;
insert into t1 values (1);
show columns from t1;
Field Type Null Key Default Extra
f1 int(11) YES NULL
insert into t1 values(2);
drop table t1;
unlock tables;
mysql-test/t/subselect.test
View file @
0e763988
...
@@ -3006,92 +3006,44 @@ DROP TABLE t1,t2;
...
@@ -3006,92 +3006,44 @@ DROP TABLE t1,t2;
create
table
t1
(
a
int
,
b
int
,
key
(
a
),
key
(
b
));
create
table
t1
(
a
int
,
b
int
,
key
(
a
),
key
(
b
));
insert
into
t1
(
a
,
b
)
values
(
1
,
2
),(
2
,
1
),(
2
,
3
),(
3
,
4
),(
5
,
4
),(
5
,
5
),
insert
into
t1
(
a
,
b
)
values
(
1
,
2
),(
2
,
1
),(
2
,
3
),(
3
,
4
),(
5
,
4
),(
5
,
5
),
(
6
,
7
),(
7
,
4
),(
5
,
3
);
(
6
,
7
),(
7
,
4
),(
5
,
3
);
# test for the stack overflow bug
select
sum
(
a
),
a
from
t1
where
a
>
(
let
$nesting
=
26
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$should_work_nesting
=
5
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$start
=
select
sum
(
a
),
a
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$end
=
)
group
by
a
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$start_app
=
where
a
>
(
select
sum
(
a
)
from
t1
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$end_pre
=
)
group
by
b
limit
1
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
)
group
by
b
limit
1
)
group
by
b
limit
1
--
disable_result_log
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
--
disable_query_log
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
# At least 4 level nesting should work without errors
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
while
(
$should_work_nesting
)
group
by
a
;
{
--
replace_regex
/
overrun
.*
$
/
overrun
detected
/
--
echo
$should_work_nesting
--
error
1436
eval
$start
$end
;
select
sum
(
a
),
a
from
t1
where
a
>
(
eval
explain
$start
$end
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$start
=
$start
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
$start_app
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$end
=
$end_pre
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
$end
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
dec
$should_work_nesting
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
}
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
# Other may fail with the 'stack overrun error'
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
while
(
$nesting
)
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
{
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
--
echo
$nesting
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
--
error
0
,
1436
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
eval
$start
$end
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
--
error
0
,
1436
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
eval
explain
$start
$end
;
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
let
$start
=
$start
select
sum
(
a
)
from
t1
$start_app
;
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
let
$end
=
$end_pre
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
$end
;
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
dec
$nesting
;
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
}
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
--
enable_result_log
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
--
enable_query_log
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
a
;
# test for the memory consumption & subquery slowness bug
explain
select
sum
(
a
),
a
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
a
;
--
replace_regex
/
overrun
.*
$
/
overrun
detected
/
--
error
1436
explain
select
sum
(
a
),
a
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
where
a
>
(
select
sum
(
a
)
from
t1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
b
limit
1
)
group
by
a
;
drop
table
t1
;
drop
table
t1
;
#
#
...
...
mysql-test/t/tablelock.test
View file @
0e763988
...
@@ -49,3 +49,16 @@ drop table t2,t1;
...
@@ -49,3 +49,16 @@ drop table t2,t1;
unlock
tables
;
unlock
tables
;
# End of 4.1 tests
# End of 4.1 tests
#
# Bug#23588 SHOW COLUMNS on a temporary table causes locking issues
#
create
temporary
table
t1
(
f1
int
);
lock
tables
t1
write
;
insert
into
t1
values
(
1
);
show
columns
from
t1
;
insert
into
t1
values
(
2
);
drop
table
t1
;
unlock
tables
;
# End of 5.0 tests
sql/sql_base.cc
View file @
0e763988
...
@@ -2852,8 +2852,12 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
...
@@ -2852,8 +2852,12 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
}
}
if
(
tables
->
lock_type
!=
TL_UNLOCK
&&
!
thd
->
locked_tables
)
if
(
tables
->
lock_type
!=
TL_UNLOCK
&&
!
thd
->
locked_tables
)
tables
->
table
->
reginfo
.
lock_type
=
tables
->
lock_type
==
TL_WRITE_DEFAULT
?
{
thd
->
update_lock_default
:
tables
->
lock_type
;
if
(
tables
->
lock_type
==
TL_WRITE_DEFAULT
)
tables
->
table
->
reginfo
.
lock_type
=
thd
->
update_lock_default
;
else
if
(
tables
->
table
->
s
->
tmp_table
==
NO_TMP_TABLE
)
tables
->
table
->
reginfo
.
lock_type
=
tables
->
lock_type
;
}
tables
->
table
->
grant
=
tables
->
grant
;
tables
->
table
->
grant
=
tables
->
grant
;
process_view_routines:
process_view_routines:
...
...
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