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
a4477d29
Commit
a4477d29
authored
Apr 29, 2015
by
Vicentiu Ciorbaru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing test cases for MDEV-7912 patch
parent
a5fa434d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
17 deletions
+14
-17
mysql-test/r/uniques_crash-7912.result
mysql-test/r/uniques_crash-7912.result
+1
-8
mysql-test/t/uniques_crash-7912.test
mysql-test/t/uniques_crash-7912.test
+13
-5
sql/uniques.cc
sql/uniques.cc
+0
-4
No files found.
mysql-test/r/uniques_crash-7912.result
View file @
a4477d29
call mtr.add_suppression("Out of memory");
set sql_mode="";
set sql_mode="";
drop table if exists t1,t2;
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
create table `t1` (`a` datetime not null) engine=InnoDB;
create table `t1` (`a` datetime not null) engine=InnoDB;
create table `t2` (`a` int not null) engine=innodb;
create table `t2` (`a` int not null) engine=innodb;
replace into t1 values (),();
replace into t1 values (),();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
insert into t2 values(0);
insert into t2 values(0);
set session sort_buffer_size = 1024*1024*1024*1024;
set session sort_buffer_size = 1024*1024*1024*1024;
SET session debug_dbug= '+d,make_merge_buff_alloc_fail';
delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;
delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;
ERROR HY000: Out of memory (Needed 2 bytes)
SET SESSION debug_dbug=DEFAULT;
drop table t2;
drop table t2;
drop table t1;
drop table t1;
mysql-test/t/uniques_crash-7912.test
View file @
a4477d29
#
# MDEV-7912
# MDEV-7912
#
# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers
# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_debug
.
inc
--
source
include
/
windows
.
inc
call
mtr
.
add_suppression
(
"Out of memory"
);
set
sql_mode
=
""
;
set
sql_mode
=
""
;
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
drop
table
if
exists
t1
,
t2
;
create
table
`t1`
(
`a`
datetime
not
null
)
engine
=
InnoDB
;
create
table
`t1`
(
`a`
datetime
not
null
)
engine
=
InnoDB
;
create
table
`t2`
(
`a`
int
not
null
)
engine
=
innodb
;
create
table
`t2`
(
`a`
int
not
null
)
engine
=
innodb
;
replace
into
t1
values
(),();
replace
into
t1
values
(),();
insert
into
t2
values
(
0
);
insert
into
t2
values
(
0
);
set
session
sort_buffer_size
=
1024
*
1024
*
1024
*
1024
;
set
session
sort_buffer_size
=
1024
*
1024
*
1024
*
1024
;
SET
session
debug_dbug
=
'+d,make_merge_buff_alloc_fail'
;
#Either fail with EE_OUTOFMEMORY, or succeed
--
error
5
#EE_OUTOFMEMORY
--
error
0
,
5
delete
d2
from
t2
as
d1
,
t1
as
d2
where
d1
.
a
<=>
d2
.
a
;
delete
d2
from
t2
as
d1
,
t1
as
d2
where
d1
.
a
<=>
d2
.
a
;
SET
SESSION
debug_dbug
=
DEFAULT
;
--
enable_warnings
drop
table
t2
;
drop
table
t2
;
drop
table
t1
;
drop
table
t1
;
\ No newline at end of file
sql/uniques.cc
View file @
a4477d29
...
@@ -608,8 +608,6 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
...
@@ -608,8 +608,6 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
if
(
flush_io_cache
(
&
file
)
||
reinit_io_cache
(
&
file
,
READ_CACHE
,
0L
,
0
,
0
))
if
(
flush_io_cache
(
&
file
)
||
reinit_io_cache
(
&
file
,
READ_CACHE
,
0L
,
0
,
0
))
return
1
;
return
1
;
size_t
buff_sz
=
(
max_in_memory_size
/
full_size
+
1
)
*
full_size
;
size_t
buff_sz
=
(
max_in_memory_size
/
full_size
+
1
)
*
full_size
;
DBUG_EXECUTE_IF
(
"make_merge_buff_alloc_fail"
,
DBUG_SET
(
"+d,simulate_out_of_memory"
););
if
(
!
(
merge_buffer
=
(
uchar
*
)
my_malloc
(
buff_sz
,
MYF
(
MY_WME
))))
if
(
!
(
merge_buffer
=
(
uchar
*
)
my_malloc
(
buff_sz
,
MYF
(
MY_WME
))))
return
1
;
return
1
;
if
(
buff_sz
<
(
ulong
)
(
full_size
*
(
file_ptrs
.
elements
+
1
)))
if
(
buff_sz
<
(
ulong
)
(
full_size
*
(
file_ptrs
.
elements
+
1
)))
...
@@ -739,8 +737,6 @@ bool Unique::get(TABLE *table)
...
@@ -739,8 +737,6 @@ bool Unique::get(TABLE *table)
/* Not enough memory; Save the result to file && free memory used by tree */
/* Not enough memory; Save the result to file && free memory used by tree */
if
(
flush
())
if
(
flush
())
return
1
;
return
1
;
DBUG_EXECUTE_IF
(
"make_merge_buff_alloc_fail"
,
DBUG_SET
(
"+d,simulate_out_of_memory"
););
size_t
buff_sz
=
(
max_in_memory_size
/
full_size
+
1
)
*
full_size
;
size_t
buff_sz
=
(
max_in_memory_size
/
full_size
+
1
)
*
full_size
;
if
(
!
(
sort_buffer
=
(
uchar
*
)
my_malloc
(
buff_sz
,
MYF
(
MY_WME
))))
if
(
!
(
sort_buffer
=
(
uchar
*
)
my_malloc
(
buff_sz
,
MYF
(
MY_WME
))))
return
1
;
return
1
;
...
...
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