MDEV-19485: Crash on purge after ADD SPATIAL INDEX
row_build_spatial_index_key(): Return early if the column is missing in the table row tuple. This is a regression that was introduced by commit 0e5a4ac2532c64a545796c787354dc41d61d0e62.
This commit is contained in:
parent
d448cfc92a
commit
9aa80fcf46
13
mysql-test/suite/innodb_gis/r/rtree_add_index.result
Normal file
13
mysql-test/suite/innodb_gis/r/rtree_add_index.result
Normal file
@ -0,0 +1,13 @@
|
||||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
CREATE TABLE t1 (g MULTIPOINT NOT NULL) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES ('');
|
||||
connect purge_control,localhost,root;
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
connection default;
|
||||
DELETE FROM t1;
|
||||
ALTER TABLE t1 ADD SPATIAL INDEX (g);
|
||||
disconnect purge_control;
|
||||
InnoDB 0 transactions not purged
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
20
mysql-test/suite/innodb_gis/t/rtree_add_index.test
Normal file
20
mysql-test/suite/innodb_gis/t/rtree_add_index.test
Normal file
@ -0,0 +1,20 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
|
||||
CREATE TABLE t1 (g MULTIPOINT NOT NULL) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES ('');
|
||||
|
||||
connect purge_control,localhost,root;
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
connection default;
|
||||
|
||||
DELETE FROM t1;
|
||||
|
||||
ALTER TABLE t1 ADD SPATIAL INDEX (g);
|
||||
|
||||
disconnect purge_control;
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
@ -62,6 +62,10 @@ static bool row_build_spatial_index_key(
|
||||
ulint flag,
|
||||
mem_heap_t* heap)
|
||||
{
|
||||
if (dfield2->type.mtype == DATA_MISSING) {
|
||||
return false;
|
||||
}
|
||||
|
||||
double* mbr;
|
||||
|
||||
dfield_copy(dfield, dfield2);
|
||||
@ -92,6 +96,7 @@ static bool row_build_spatial_index_key(
|
||||
if (!dfield_is_ext(dfield2)) {
|
||||
dptr = static_cast<const byte*>(dfield_get_data(dfield2));
|
||||
dlen = dfield_get_len(dfield2);
|
||||
ut_ad(dptr != &data_error);
|
||||
goto write_mbr;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user