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
178ab560
Commit
178ab560
authored
Apr 30, 2024
by
Monty
Committed by
Sergei Golubchik
May 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-34016 Assertion `info->key_del_used == 0' failed in maria_close with limited tmp space
parent
d2304554
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
6 deletions
+47
-6
mysql-test/main/tmp_space_usage.result
mysql-test/main/tmp_space_usage.result
+18
-3
mysql-test/main/tmp_space_usage.test
mysql-test/main/tmp_space_usage.test
+21
-2
storage/maria/ma_page.c
storage/maria/ma_page.c
+3
-1
storage/maria/ma_sort.c
storage/maria/ma_sort.c
+5
-0
No files found.
mysql-test/main/tmp_space_usage.result
View file @
178ab560
...
...
@@ -94,9 +94,6 @@ drop table t1,t2;
SET @@max_tmp_session_space_usage= 64*1024;
set @@binlog_format="statement";
CREATE OR REPLACE TABLE t1 (a INT, b INT);
select benchmark(1,1);
benchmark(1,1)
0
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100000;
ALTER TABLE t1 ORDER BY a, b;
ERROR HY000: Local temporary space limit reached
...
...
@@ -161,6 +158,7 @@ ERROR HY000: Global temporary space limit reached
# MDEV-33751 Assertion `thd' failed in int
# temp_file_size_cb_func(tmp_file_tracking*, int)
#
set @save_max_tmp_total_space_usage=@@global.max_tmp_total_space_usage;
set @@global.max_tmp_total_space_usage=64*1024*1024;
set @@max_tmp_session_space_usage=1179648;
select @@max_tmp_session_space_usage;
...
...
@@ -177,4 +175,21 @@ ERROR HY000: Local temporary space limit reached
DROP TABLE t1;
set @@aria_repair_threads=@save_aria_repair_threads;
set @@max_heap_table_size=@save_max_heap_table_size;
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
#
# MDEV-34016 Assertion `info->key_del_used == 0' failed in maria_close
# with limited tmp space
#
set @save_max_tmp_total_space_usage=@@global.max_tmp_total_space_usage;
connect c1, localhost, root,,;
CREATE TABLE t1 (a varchar(1024)) engine=aria;
INSERT INTO t1 VALUES ('this'),('is'),('just'),('a'),('filling'),('for'),(REPEAT('a',500));
set @@global.max_tmp_total_space_usage=2*1024*1024;
SET max_tmp_session_space_usage= 1024*1024, max_heap_table_size= 4*1024*1024;
SELECT DISTINCT a, seq FROM t1 JOIN seq_1_to_600;
ERROR HY000: Got error 200 "Local temporary space limit reached" when merging index
DROP TABLE t1;
connection default;
disconnect c1;
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
# End of 11.5 tests
mysql-test/main/tmp_space_usage.test
View file @
178ab560
...
...
@@ -142,7 +142,6 @@ SET @@max_tmp_session_space_usage= 64*1024;
set
@@
binlog_format
=
"statement"
;
CREATE
OR
REPLACE
TABLE
t1
(
a
INT
,
b
INT
);
select
benchmark
(
1
,
1
);
INSERT
INTO
t1
SELECT
seq
,
seq
FROM
seq_1_to_100000
;
--
error
41
ALTER
TABLE
t1
ORDER
BY
a
,
b
;
...
...
@@ -214,7 +213,8 @@ select count(distinct concat(seq,repeat('x',1000))) from seq_1_to_1000;
--
echo
# temp_file_size_cb_func(tmp_file_tracking*, int)
--
echo
#
set
@@
global
.
max_tmp_session_space_usage
=
64
*
1024
*
1024
;
set
@
save_max_tmp_total_space_usage
=@@
global
.
max_tmp_total_space_usage
;
set
@@
global
.
max_tmp_total_space_usage
=
64
*
1024
*
1024
;
set
@@
max_tmp_session_space_usage
=
1179648
;
select
@@
max_tmp_session_space_usage
;
set
@
save_aria_repair_threads
=@@
aria_repair_threads
;
...
...
@@ -230,5 +230,24 @@ DROP TABLE t1;
set
@@
aria_repair_threads
=@
save_aria_repair_threads
;
set
@@
max_heap_table_size
=@
save_max_heap_table_size
;
set
@@
global
.
max_tmp_total_space_usage
=@
save_max_tmp_total_space_usage
;
--
echo
#
--
echo
# MDEV-34016 Assertion `info->key_del_used == 0' failed in maria_close
--
echo
# with limited tmp space
--
echo
#
set
@
save_max_tmp_total_space_usage
=@@
global
.
max_tmp_total_space_usage
;
connect
(
c1
,
localhost
,
root
,,);
CREATE
TABLE
t1
(
a
varchar
(
1024
))
engine
=
aria
;
INSERT
INTO
t1
VALUES
(
'this'
),(
'is'
),(
'just'
),(
'a'
),(
'filling'
),(
'for'
),(
REPEAT
(
'a'
,
500
));
set
@@
global
.
max_tmp_total_space_usage
=
2
*
1024
*
1024
;
SET
max_tmp_session_space_usage
=
1024
*
1024
,
max_heap_table_size
=
4
*
1024
*
1024
;
--
error
ER_NOT_KEYFILE
SELECT
DISTINCT
a
,
seq
FROM
t1
JOIN
seq_1_to_600
;
DROP
TABLE
t1
;
connection
default
;
disconnect
c1
;
set
@@
global
.
max_tmp_total_space_usage
=@
save_max_tmp_total_space_usage
;
--
echo
# End of 11.5 tests
storage/maria/ma_page.c
View file @
178ab560
...
...
@@ -393,7 +393,7 @@ int _ma_dispose(register MARIA_HA *info, my_off_t pos, my_bool page_not_read)
single _ma_log_new()) call).
@return
HA_OFFSET_ERROR File is full or page read error
HA_OFFSET_ERROR File is full or page read error
or tmp space full
# Page address to use
*/
...
...
@@ -414,6 +414,7 @@ my_off_t _ma_new(register MARIA_HA *info, int level,
{
my_errno
=
HA_ERR_INDEX_FILE_FULL
;
mysql_mutex_unlock
(
&
share
->
intern_lock
);
_ma_unlock_key_del
(
info
);
DBUG_RETURN
(
HA_OFFSET_ERROR
);
}
share
->
state
.
state
.
key_file_length
+=
block_size
;
...
...
@@ -422,6 +423,7 @@ my_off_t _ma_new(register MARIA_HA *info, int level,
share
->
state
.
state
.
key_file_length
))
{
mysql_mutex_unlock
(
&
share
->
intern_lock
);
_ma_unlock_key_del
(
info
);
DBUG_RETURN
(
HA_OFFSET_ERROR
);
}
/* Following is for not transactional tables */
...
...
storage/maria/ma_sort.c
View file @
178ab560
...
...
@@ -281,7 +281,12 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
printf
(
" - Last merge and dumping keys
\n
"
);
/* purecov: tested */
if
(
merge_index
(
info
,
keys
,
sort_keys
,
dynamic_element
(
&
buffpek
,
0
,
BUFFPEK
*
),
maxbuffer
,
&
tempfile
))
{
const
char
*
format
=
"Got error %M when merging index"
;
_ma_check_print_error
(
info
->
sort_info
->
param
,
format
,
(
int
)
my_errno
);
goto
err
;
/* purecov: inspected */
}
}
if
(
flush_maria_ft_buf
(
info
)
||
_ma_flush_pending_blocks
(
info
))
...
...
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