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
57432d0c
Commit
57432d0c
authored
Jul 08, 2011
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case for bug lp:611396
The bug itself has been fixed by MWL#89.
parent
0f36ab3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+33
-0
mysql-test/t/subselect4.test
mysql-test/t/subselect4.test
+33
-0
No files found.
mysql-test/r/subselect4.result
View file @
57432d0c
...
...
@@ -1940,4 +1940,37 @@ f1 f2 f3
set @@optimizer_switch = @old_optimizer_switch;
drop table t1, t2;
drop view v2;
#
# LP BUG#611396 RQG: crash in Item_field::register_field_in_read_map with semijoin=off
# and prepared statements and materialization
CREATE TABLE t1 ( f1 int(11), f2 int(11)) ;
CREATE TABLE t2 ( f1 int(11), f4 varchar(1), PRIMARY KEY (f1)) ;
INSERT INTO t2 VALUES ('23','j'),('24','e');
CREATE TABLE t3 ( f1 int(11), f4 varchar(1)) ;
INSERT INTO t3 VALUES ('8','j');
set @old_optimizer_switch = @@optimizer_switch;
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
EXPLAIN
SELECT t2.f1, (SELECT f2 FROM t1 WHERE (7) IN (SELECT f1 FROM t1))
FROM t2 JOIN t3 ON t3.f4 = t2.f4
WHERE t3.f1 = 8
GROUP BY 1, 2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 Using temporary; Using filesort
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found
PREPARE st1 FROM "
SELECT t2.f1, (SELECT f2 FROM t1 WHERE (7) IN (SELECT f1 FROM t1))
FROM t2 JOIN t3 ON t3.f4 = t2.f4
WHERE t3.f1 = 8
GROUP BY 1, 2";
EXECUTE st1;
f1 (SELECT f2 FROM t1 WHERE (7) IN (SELECT f1 FROM t1))
23 NULL
EXECUTE st1;
f1 (SELECT f2 FROM t1 WHERE (7) IN (SELECT f1 FROM t1))
23 NULL
set @@optimizer_switch = @old_optimizer_switch;
drop table t1, t2, t3;
set optimizer_switch=@subselect4_tmp;
mysql-test/t/subselect4.test
View file @
57432d0c
...
...
@@ -1594,4 +1594,37 @@ set @@optimizer_switch = @old_optimizer_switch;
drop
table
t1
,
t2
;
drop
view
v2
;
--
echo
#
--
echo
# LP BUG#611396 RQG: crash in Item_field::register_field_in_read_map with semijoin=off
--
echo
# and prepared statements and materialization
CREATE
TABLE
t1
(
f1
int
(
11
),
f2
int
(
11
))
;
CREATE
TABLE
t2
(
f1
int
(
11
),
f4
varchar
(
1
),
PRIMARY
KEY
(
f1
))
;
INSERT
INTO
t2
VALUES
(
'23'
,
'j'
),(
'24'
,
'e'
);
CREATE
TABLE
t3
(
f1
int
(
11
),
f4
varchar
(
1
))
;
INSERT
INTO
t3
VALUES
(
'8'
,
'j'
);
set
@
old_optimizer_switch
=
@@
optimizer_switch
;
set
@@
optimizer_switch
=
'materialization=on,in_to_exists=off,semijoin=off'
;
EXPLAIN
SELECT
t2
.
f1
,
(
SELECT
f2
FROM
t1
WHERE
(
7
)
IN
(
SELECT
f1
FROM
t1
))
FROM
t2
JOIN
t3
ON
t3
.
f4
=
t2
.
f4
WHERE
t3
.
f1
=
8
GROUP
BY
1
,
2
;
PREPARE
st1
FROM
"
SELECT t2.f1, (SELECT f2 FROM t1 WHERE (7) IN (SELECT f1 FROM t1))
FROM t2 JOIN t3 ON t3.f4 = t2.f4
WHERE t3.f1 = 8
GROUP BY 1, 2"
;
EXECUTE
st1
;
EXECUTE
st1
;
set
@@
optimizer_switch
=
@
old_optimizer_switch
;
drop
table
t1
,
t2
,
t3
;
set
optimizer_switch
=@
subselect4_tmp
;
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