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
8dae5a8a
Commit
8dae5a8a
authored
Mar 18, 2014
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
5d0c0160
8c04dd33
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
1 deletion
+60
-1
mysql-test/r/subselect_mat.result
mysql-test/r/subselect_mat.result
+14
-0
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+14
-0
mysql-test/t/subselect_sj_mat.test
mysql-test/t/subselect_sj_mat.test
+18
-0
sql/sql_select.cc
sql/sql_select.cc
+14
-1
No files found.
mysql-test/r/subselect_mat.result
View file @
8dae5a8a
...
...
@@ -2041,6 +2041,20 @@ EXECUTE stmt;
a
DROP TABLE t1, t2;
DROP VIEW v2;
#
# MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON
#
SET @tmp_mdev5811= @@big_tables;
SET big_tables = ON;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
SELECT * FROM t1 AS t1_1, t1 AS t1_2
WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 );
a a
DROP TABLE t1,t2;
SET big_tables=@tmp_mdev5811;
# End of 5.3 tests
set @subselect_mat_test_optimizer_switch_value=null;
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
...
...
mysql-test/r/subselect_sj_mat.result
View file @
8dae5a8a
...
...
@@ -2081,4 +2081,18 @@ EXECUTE stmt;
a
DROP TABLE t1, t2;
DROP VIEW v2;
#
# MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON
#
SET @tmp_mdev5811= @@big_tables;
SET big_tables = ON;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
SELECT * FROM t1 AS t1_1, t1 AS t1_2
WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 );
a a
DROP TABLE t1,t2;
SET big_tables=@tmp_mdev5811;
# End of 5.3 tests
mysql-test/t/subselect_sj_mat.test
View file @
8dae5a8a
...
...
@@ -1726,4 +1726,22 @@ EXECUTE stmt;
DROP
TABLE
t1
,
t2
;
DROP
VIEW
v2
;
--
echo
#
--
echo
# MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON
--
echo
#
SET
@
tmp_mdev5811
=
@@
big_tables
;
SET
big_tables
=
ON
;
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
CREATE
TABLE
t2
(
b
INT
);
INSERT
INTO
t2
VALUES
(
3
),(
4
);
SELECT
*
FROM
t1
AS
t1_1
,
t1
AS
t1_2
WHERE
(
t1_1
.
a
,
t1_2
.
a
)
IN
(
SELECT
MAX
(
b
),
MIN
(
b
)
FROM
t2
);
DROP
TABLE
t1
,
t2
;
SET
big_tables
=@
tmp_mdev5811
;
--
echo
# End of 5.3 tests
sql/sql_select.cc
View file @
8dae5a8a
...
...
@@ -14976,7 +14976,20 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
keyinfo
->
key_length
=
0
;
// Will compute the sum of the parts below.
keyinfo
->
name
=
(
char
*
)
"distinct_key"
;
keyinfo
->
algorithm
=
HA_KEY_ALG_UNDEF
;
keyinfo
->
rec_per_key
=
0
;
/*
Needed by non-merged semi-joins: SJ-Materialized table must have a valid
rec_per_key array, because it participates in join optimization. Since
the table has no data, the only statistics we can provide is "unknown",
i.e. zero values.
(For table record count, we calculate and set JOIN_TAB::found_records,
see get_delayed_table_estimates()).
*/
size_t
rpk_size
=
keyinfo
->
key_parts
*
sizeof
(
keyinfo
->
rec_per_key
[
0
]);
if
(
!
(
keyinfo
->
rec_per_key
=
(
ulong
*
)
alloc_root
(
&
table
->
mem_root
,
rpk_size
)))
goto
err
;
bzero
(
keyinfo
->
rec_per_key
,
rpk_size
);
/*
Create an extra field to hold NULL bits so that unique indexes on
...
...
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