Commit 5045509b authored by Nayuta Yanagisawa's avatar Nayuta Yanagisawa

MDEV-27184 Assertion `(old_top == initial_top (av) && old_size == 0) ||...

MDEV-27184 Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed, Assertion `str.alloced_length() >= str.length() + data_len' failed

Spider crashes on a query that inserts some rows including float.
This is because Spider allocates a string of insufficient length.
parent 681b7784
#
# MDEV-27184 Assertion `(old_top == initial_top (av) && old_size == 0) ||
# ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) &&
# ((unsigned long) old_end & (pagesize - 1)) == 0)' failed,
# Assertion `str.alloced_length() >= str.length() + data_len' failed
#
for master_1
for child2
for child3
connection master_1;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
CREATE TABLE tbl_a (a FLOAT) ENGINE=SPIDER;
INSERT INTO tbl_a VALUES
(0xF5A7),(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),
(0xF5A7),(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE);
ERROR HY000: Unable to connect to foreign data source: localhost
DROP DATABASE auto_test_remote;
for master_1
for child2
for child3
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
--echo #
--echo # MDEV-27184 Assertion `(old_top == initial_top (av) && old_size == 0) ||
--echo # ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) &&
--echo # ((unsigned long) old_end & (pagesize - 1)) == 0)' failed,
--echo # Assertion `str.alloced_length() >= str.length() + data_len' failed
--echo #
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
--connection master_1
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
CREATE TABLE tbl_a (a FLOAT) ENGINE=SPIDER;
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
INSERT INTO tbl_a VALUES
(0xF5A7),(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),
(0xF5A7),(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE);
DROP DATABASE auto_test_remote;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log
...@@ -4243,7 +4243,7 @@ int spider_db_mariadb_util::append_column_value( ...@@ -4243,7 +4243,7 @@ int spider_db_mariadb_util::append_column_value(
} else if (float_value) } else if (float_value)
{ {
if (str->reserve(SPIDER_SQL_CAST_LEN + ptr->length() + if (str->reserve(SPIDER_SQL_CAST_LEN + ptr->length() +
SPIDER_SQL_AS_FLOAT_LEN, SPIDER_SQL_CLOSE_PAREN_LEN)) SPIDER_SQL_AS_FLOAT_LEN + SPIDER_SQL_CLOSE_PAREN_LEN))
{ {
DBUG_RETURN(HA_ERR_OUT_OF_MEM); DBUG_RETURN(HA_ERR_OUT_OF_MEM);
} }
......
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