Commit ff36f028 authored by Mattias Jonsson's avatar Mattias Jonsson

Bug#49161: Out of memory; restart server and try again (needed 2 bytes)

Problem was reporting wrong error

Fixed by adding a new error which better explain the problem.
parent 69c9dbab
drop table if exists t1;
#
# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
#
CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
FLUSH TABLES;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Error Failed to read from the .par file
test.t1 check Error Incorrect information in file: './test/t1.frm'
test.t1 check error Corrupt
SELECT * FROM t1;
ERROR HY000: Failed to read from the .par file
# Note that it is currently impossible to drop a partitioned table
# without the .par file
DROP TABLE t1;
ERROR 42S02: Unknown table 't1'
#
# Bug#49477: Assertion `0' failed in ha_partition.cc:5530
# with temporary table and partitions
#
......
......@@ -8,6 +8,25 @@
drop table if exists t1;
--enable_warnings
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--echo #
--echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
--echo #
CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
FLUSH TABLES;
--remove_file $MYSQLD_DATADIR/test/t1.par
CHECK TABLE t1;
--error ER_UNKNOWN_ERROR
SELECT * FROM t1;
--echo # Note that it is currently impossible to drop a partitioned table
--echo # without the .par file
--error ER_BAD_TABLE_ERROR
DROP TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.frm
--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI
--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD
--echo #
--echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530
--echo # with temporary table and partitions
......@@ -167,7 +186,6 @@ partitions 3
partition x2 tablespace ts2,
partition x3 tablespace ts3);
let $MYSQLD_DATADIR= `select @@datadir`;
select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, invalid field in function
......
......@@ -359,7 +359,7 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root)
}
else if (get_from_handler_file(table_share->normalized_path.str, mem_root))
{
mem_alloc_error(2);
my_message(ER_UNKNOWN_ERROR, "Failed to read from the .par file", MYF(0));
DBUG_RETURN(1);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment