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
1404f3be
Commit
1404f3be
authored
Nov 09, 2020
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-24117: Memory management problem ...: Add a testcase
Add a testcase.
parent
f81eef62
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
0 deletions
+112
-0
mysql-test/r/range.result
mysql-test/r/range.result
+33
-0
mysql-test/r/range_mrr_icp.result
mysql-test/r/range_mrr_icp.result
+33
-0
mysql-test/t/range.test
mysql-test/t/range.test
+46
-0
No files found.
mysql-test/r/range.result
View file @
1404f3be
...
@@ -3054,5 +3054,38 @@ a b
...
@@ -3054,5 +3054,38 @@ a b
set eq_range_index_dive_limit=default;
set eq_range_index_dive_limit=default;
drop table t1;
drop table t1;
#
#
# MDEV-24117: Memory management problem in statistics state...
# (just the testcase)
#
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int);
insert into t1
select A.a + B.a* 10 + C.a * 100 + D.a * 1000
from t0 A, t0 B, t0 C, t0 D
where D.a<4;
create table t2 (
a int,
b int,
key(a)
);
insert into t2 values (1,1),(2,2),(3,3);
set @query=(select group_concat(a) from t1);
set @tmp_24117= @@max_session_mem_used;
#
# On debug build, the usage was
# - 2.8M without the bug
# - 1G with the bug.
set max_session_mem_used=64*1024*1024;
set @query=concat('explain select * from t2 where a in (', @query, ')');
prepare s from @query;
# This should not fail with an error:
execute s;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a NULL NULL NULL 3 Using where
set max_session_mem_used=@tmp_24117;
deallocate prepare s;
drop table t0,t1,t2;
#
# End of 10.2 tests
# End of 10.2 tests
#
#
mysql-test/r/range_mrr_icp.result
View file @
1404f3be
...
@@ -3066,6 +3066,39 @@ a b
...
@@ -3066,6 +3066,39 @@ a b
set eq_range_index_dive_limit=default;
set eq_range_index_dive_limit=default;
drop table t1;
drop table t1;
#
#
# MDEV-24117: Memory management problem in statistics state...
# (just the testcase)
#
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int);
insert into t1
select A.a + B.a* 10 + C.a * 100 + D.a * 1000
from t0 A, t0 B, t0 C, t0 D
where D.a<4;
create table t2 (
a int,
b int,
key(a)
);
insert into t2 values (1,1),(2,2),(3,3);
set @query=(select group_concat(a) from t1);
set @tmp_24117= @@max_session_mem_used;
#
# On debug build, the usage was
# - 2.8M without the bug
# - 1G with the bug.
set max_session_mem_used=64*1024*1024;
set @query=concat('explain select * from t2 where a in (', @query, ')');
prepare s from @query;
# This should not fail with an error:
execute s;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a NULL NULL NULL 3 Using where
set max_session_mem_used=@tmp_24117;
deallocate prepare s;
drop table t0,t1,t2;
#
# End of 10.2 tests
# End of 10.2 tests
#
#
set optimizer_switch=@mrr_icp_extra_tmp;
set optimizer_switch=@mrr_icp_extra_tmp;
mysql-test/t/range.test
View file @
1404f3be
...
@@ -2095,6 +2095,52 @@ set eq_range_index_dive_limit=default;
...
@@ -2095,6 +2095,52 @@ set eq_range_index_dive_limit=default;
drop
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-24117: Memory management problem in statistics state...
--
echo
# (just the testcase)
--
echo
#
create
table
t0
(
a
int
);
insert
into
t0
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
create
table
t1
(
a
int
);
# 4K rows
insert
into
t1
select
A
.
a
+
B
.
a
*
10
+
C
.
a
*
100
+
D
.
a
*
1000
from
t0
A
,
t0
B
,
t0
C
,
t0
D
where
D
.
a
<
4
;
create
table
t2
(
a
int
,
b
int
,
key
(
a
)
);
insert
into
t2
values
(
1
,
1
),(
2
,
2
),(
3
,
3
);
set
@
query
=
(
select
group_concat
(
a
)
from
t1
);
set
@
tmp_24117
=
@@
max_session_mem_used
;
--
echo
#
--
echo
# On debug build, the usage was
--
echo
# - 2.8M without the bug
--
echo
# - 1G with the bug.
set
max_session_mem_used
=
64
*
1024
*
1024
;
set
@
query
=
concat
(
'explain select * from t2 where a in ('
,
@
query
,
')'
);
prepare
s
from
@
query
;
--
echo
# This should not fail with an error:
execute
s
;
set
max_session_mem_used
=@
tmp_24117
;
deallocate
prepare
s
;
drop
table
t0
,
t1
,
t2
;
--
echo
#
--
echo
#
--
echo
# End of 10.2 tests
--
echo
# End of 10.2 tests
--
echo
#
--
echo
#
...
...
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