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
0ab24bef
Commit
0ab24bef
authored
Sep 08, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
0a7e4186
629557ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
6 deletions
+64
-6
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+30
-0
mysql-test/t/subselect4.test
mysql-test/t/subselect4.test
+32
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-6
No files found.
mysql-test/r/subselect4.result
0 → 100644
View file @
0ab24bef
#
# Bug #46791: Assertion failed:(table->key_read==0),function unknown
# function,file sql_base.cc
#
CREATE TABLE t1 (a INT, b INT, KEY(a));
INSERT INTO t1 VALUES (1,1),(2,2);
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,1),(2,2);
CREATE TABLE t3 LIKE t1;
# should have 1 impossible where and 2 dependent subqueries
EXPLAIN
SELECT 1 FROM t1
WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3))
ORDER BY count(*);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 5 NULL 2 Using index; Using temporary
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
# should not crash the next statement
SELECT 1 FROM t1
WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3))
ORDER BY count(*);
1
1
# should not crash: the crash is caused by the previous statement
SELECT 1;
1
1
DROP TABLE t1,t2,t3;
End of 5.0 tests.
mysql-test/t/subselect4.test
0 → 100644
View file @
0ab24bef
# General purpose bug fix tests go here : subselect.test too large
--
echo
#
--
echo
# Bug #46791: Assertion failed:(table->key_read==0),function unknown
--
echo
# function,file sql_base.cc
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
KEY
(
a
));
INSERT
INTO
t1
VALUES
(
1
,
1
),(
2
,
2
);
CREATE
TABLE
t2
LIKE
t1
;
INSERT
INTO
t2
VALUES
(
1
,
1
),(
2
,
2
);
CREATE
TABLE
t3
LIKE
t1
;
--
echo
# should have 1 impossible where and 2 dependent subqueries
EXPLAIN
SELECT
1
FROM
t1
WHERE
NOT
EXISTS
(
SELECT
1
FROM
t2
WHERE
1
=
(
SELECT
MIN
(
t2
.
b
)
FROM
t3
))
ORDER
BY
count
(
*
);
--
echo
# should not crash the next statement
SELECT
1
FROM
t1
WHERE
NOT
EXISTS
(
SELECT
1
FROM
t2
WHERE
1
=
(
SELECT
MIN
(
t2
.
b
)
FROM
t3
))
ORDER
BY
count
(
*
);
--
echo
# should not crash: the crash is caused by the previous statement
SELECT
1
;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
End
of
5.0
tests
.
sql/sql_select.cc
View file @
0ab24bef
...
@@ -1523,12 +1523,8 @@ JOIN::optimize()
...
@@ -1523,12 +1523,8 @@ JOIN::optimize()
}
}
}
}
/*
/* If this join belongs to an uncacheable query save the original join */
If this join belongs to an uncacheable subquery save
if
(
select_lex
->
uncacheable
&&
init_save_join_tab
())
the original join
*/
if
(
select_lex
->
uncacheable
&&
!
is_top_level_join
()
&&
init_save_join_tab
())
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
}
}
...
...
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