mirror of
https://github.com/MariaDB/server.git
synced 2026-04-19 06:45:32 +02:00
MDEV-35116 InnoDB fails to set error index for HA_ERR_NULL_IN_SPATIAL
- InnoDB fails to set the index information or index number for the spatial index error HA_ERR_NULL_IN_SPATIAL. row_build_spatial_index_key(): Initialize the tmp_mbr array completely. check_if_supported_inplace_alter(): Fix the spelling mistake of alter
This commit is contained in:
parent
b138f428ea
commit
5777d9f282
8 changed files with 62 additions and 32 deletions
|
|
@ -552,18 +552,18 @@ ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
|||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
|
||||
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_drop_reorder;
|
||||
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 0, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 0;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
|
|
@ -1486,18 +1486,18 @@ ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
|||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
|
||||
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_drop_reorder;
|
||||
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 0, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 0;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
|
|
@ -2420,18 +2420,18 @@ ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
|||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
|
||||
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_drop_reorder;
|
||||
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
|
||||
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 0, ALGORITHM=INSTANT;
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
|
||||
ALTER TABLE t1 MODIFY a INT DEFAULT 0;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
|
|
|
|||
|
|
@ -866,3 +866,17 @@ INSERT INTO `address` VALUES (1,'47 MySakila Drive',NULL,'Alberta',300,'','',0x0
|
|||
(605,'1325 Fukuyama Street','','Heilongjiang',537,'27107','288241215394',0x00000000010100000017540A70700160401E1C47077F7D4740,'2014-09-25 22:30:44');
|
||||
COMMIT;
|
||||
DROP TABLE address;
|
||||
#
|
||||
# MDEV-35116 InnoDB fails to set error index
|
||||
# for HA_ERR_NULL_IN_SPATIAL
|
||||
#
|
||||
BINLOG ' SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=';
|
||||
CREATE TABLE t1 (i INT, g GEOMETRY NOT NULL,
|
||||
SPATIAL INDEX (g)) ENGINE=InnoDB;
|
||||
CREATE TEMPORARY TABLE t2 (PRIMARY KEY(a)) ENGINE=InnoDB
|
||||
WITH RECURSIVE t(a) AS (VALUES(1),(1)) SELECT * FROM t;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
call mtr.add_suppression("BINLOG_BASE64_EVENT: Could not execute Write_rows_v1 event on table .*");
|
||||
BINLOG ' SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf /+ AgAAAA==';
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
DROP TABLE t1;
|
||||
|
|
|
|||
|
|
@ -851,3 +851,19 @@ INSERT INTO `address` VALUES (1,'47 MySakila Drive',NULL,'Alberta',300,'','',0x0
|
|||
COMMIT;
|
||||
|
||||
DROP TABLE address;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35116 InnoDB fails to set error index
|
||||
--echo # for HA_ERR_NULL_IN_SPATIAL
|
||||
--echo #
|
||||
BINLOG ' SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=';
|
||||
CREATE TABLE t1 (i INT, g GEOMETRY NOT NULL,
|
||||
SPATIAL INDEX (g)) ENGINE=InnoDB;
|
||||
--error ER_DUP_ENTRY
|
||||
CREATE TEMPORARY TABLE t2 (PRIMARY KEY(a)) ENGINE=InnoDB
|
||||
WITH RECURSIVE t(a) AS (VALUES(1),(1)) SELECT * FROM t;
|
||||
|
||||
call mtr.add_suppression("BINLOG_BASE64_EVENT: Could not execute Write_rows_v1 event on table .*");
|
||||
--error ER_CANT_CREATE_GEOMETRY_OBJECT
|
||||
BINLOG ' SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf /+ AgAAAA==';
|
||||
DROP TABLE t1;
|
||||
|
|
|
|||
|
|
@ -8140,6 +8140,7 @@ calc_row_difference(
|
|||
to block it. */
|
||||
if (DATA_GEOMETRY_MTYPE(col_type)
|
||||
&& o_len != 0 && n_len == 0) {
|
||||
trx->error_info = clust_index;
|
||||
return(DB_CANT_CREATE_GEOMETRY_OBJECT);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2108,7 +2108,7 @@ innodb_instant_alter_column_allowed_reason:
|
|||
if ((ha_alter_info->handler_flags
|
||||
& (ALTER_STORED_COLUMN_ORDER | ALTER_DROP_STORED_COLUMN))
|
||||
|| m_prebuilt->table->instant) {
|
||||
reason_rebuild = "innodb_instant_atler_column_allowed="
|
||||
reason_rebuild = "innodb_instant_alter_column_allowed="
|
||||
"add_last";
|
||||
goto innodb_instant_alter_column_allowed_reason;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3434,24 +3434,22 @@ row_ins_spatial_index_entry_set_mbr_field(
|
|||
|
||||
/** Sets the values of the dtuple fields in entry from the values of appropriate
|
||||
columns in row.
|
||||
@param[in] index index handler
|
||||
@param[out] entry index entry to make
|
||||
@param[in] row row
|
||||
@return DB_SUCCESS if the set is successful */
|
||||
@param[in] node row insert node
|
||||
@param[in] thr query thread
|
||||
@retval DB_SUCCESS if the set is successful
|
||||
@retval DB_CANT_CREATE_GEOMETRY_OBJECT when spatial index fails to
|
||||
create geometry object */
|
||||
static
|
||||
dberr_t
|
||||
row_ins_index_entry_set_vals(
|
||||
const dict_index_t* index,
|
||||
dtuple_t* entry,
|
||||
const dtuple_t* row)
|
||||
row_ins_index_entry_set_vals(const ins_node_t* node, que_thr_t* thr)
|
||||
{
|
||||
ulint n_fields;
|
||||
ulint i;
|
||||
const dict_index_t* index = node->index;
|
||||
dtuple_t* entry = *node->entry;
|
||||
const dtuple_t* row = node->row;
|
||||
ulint num_v = dtuple_get_n_v_fields(entry);
|
||||
ulint n_fields = dtuple_get_n_fields(entry);
|
||||
|
||||
n_fields = dtuple_get_n_fields(entry);
|
||||
|
||||
for (i = 0; i < n_fields + num_v; i++) {
|
||||
for (ulint i = 0; i < n_fields + num_v; i++) {
|
||||
dict_field_t* ind_field = NULL;
|
||||
dfield_t* field;
|
||||
const dfield_t* row_field;
|
||||
|
|
@ -3521,6 +3519,7 @@ row_ins_index_entry_set_vals(
|
|||
if ((i == 0) && dict_index_is_spatial(index)) {
|
||||
if (!row_field->data
|
||||
|| row_field->len < GEO_DATA_HEADER_SIZE) {
|
||||
thr_get_trx(thr)->error_info = index;
|
||||
return(DB_CANT_CREATE_GEOMETRY_OBJECT);
|
||||
}
|
||||
row_ins_spatial_index_entry_set_mbr_field(
|
||||
|
|
@ -3555,8 +3554,7 @@ row_ins_index_entry_step(
|
|||
|
||||
ut_ad(dtuple_check_typed(node->row));
|
||||
|
||||
err = row_ins_index_entry_set_vals(node->index, *node->entry,
|
||||
node->row);
|
||||
err = row_ins_index_entry_set_vals(node, thr);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
DBUG_RETURN(err);
|
||||
|
|
|
|||
|
|
@ -2292,6 +2292,7 @@ write_buffers:
|
|||
error. */
|
||||
if (!row_geo_field_is_valid(row, buf->index)) {
|
||||
err = DB_CANT_CREATE_GEOMETRY_OBJECT;
|
||||
trx->error_key_num = i;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ static bool row_build_spatial_index_key(
|
|||
|
||||
write_mbr:
|
||||
if (dlen <= GEO_DATA_HEADER_SIZE) {
|
||||
for (uint i = 0; i < SPDIMS; i += 2) {
|
||||
for (uint i = 0; i < 2 * SPDIMS; i += 2) {
|
||||
tmp_mbr[i] = DBL_MAX;
|
||||
tmp_mbr[i + 1] = -DBL_MAX;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue