mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-11005: Incorrect error message when using ONLINE alter table with GIS
Corrected error message when ONLINE alter table with GIS indexes is used on InnoDB.
This commit is contained in:
39
mysql-test/suite/innodb/r/innodb-online-alter-gis.result
Normal file
39
mysql-test/suite/innodb/r/innodb-online-alter-gis.result
Normal file
@@ -0,0 +1,39 @@
|
||||
create table t1(a int not null primary key, b geometry not null) engine=innodb;
|
||||
ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b);
|
||||
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1846 LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
|
||||
show errors;
|
||||
Level Code Message
|
||||
Error 1846 LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
|
||||
ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), LOCK=SHARED;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
show errors;
|
||||
Level Code Message
|
||||
drop table t1;
|
||||
create table t1(a int not null, b geometry not null, d int,spatial key c(b), key d(d)) engine=innodb;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` geometry NOT NULL,
|
||||
`d` int(11) DEFAULT NULL,
|
||||
SPATIAL KEY `c` (`b`),
|
||||
KEY `d` (`d`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d;
|
||||
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1846 LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
|
||||
show errors;
|
||||
Level Code Message
|
||||
Error 1846 LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
|
||||
ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, LOCK=SHARED;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
show errors;
|
||||
Level Code Message
|
||||
drop table t1;
|
21
mysql-test/suite/innodb/t/innodb-online-alter-gis.test
Normal file
21
mysql-test/suite/innodb/t/innodb-online-alter-gis.test
Normal file
@@ -0,0 +1,21 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
create table t1(a int not null primary key, b geometry not null) engine=innodb;
|
||||
--error 1846
|
||||
ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b);
|
||||
show warnings;
|
||||
show errors;
|
||||
ALTER ONLINE TABLE t1 ADD SPATIAL INDEX new(b), LOCK=SHARED;
|
||||
show warnings;
|
||||
show errors;
|
||||
drop table t1;
|
||||
create table t1(a int not null, b geometry not null, d int,spatial key c(b), key d(d)) engine=innodb;
|
||||
show create table t1;
|
||||
--error 1846
|
||||
ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d;
|
||||
show warnings;
|
||||
show errors;
|
||||
ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, LOCK=SHARED;
|
||||
show warnings;
|
||||
show errors;
|
||||
drop table t1;
|
@@ -7151,12 +7151,187 @@ skip-to-error-number 2000
|
||||
# MySQL 5.7 error numbers starts here
|
||||
skip-to-error-number 3000
|
||||
|
||||
ER_MYSQL_57_TEST
|
||||
eng "5.7 test"
|
||||
ER_WRONG_TABLESPACE_NAME 42000
|
||||
eng "Incorrect tablespace name %`-.192s"
|
||||
ER_ERROR_ON_MASTER
|
||||
eng "Query partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'"
|
||||
|
||||
ER_INCONSISTENT_ERROR
|
||||
eng "Query caused different errors on master and slave. Error on master: message (format)='%s' error code=%d; Error on slave:actual message='%s', error code=%d. Default database:'%s'. Query:'%s'"
|
||||
|
||||
ER_STORAGE_ENGINE_NOT_LOADED
|
||||
eng "Storage engine for table '%s'.'%s' is not loaded."
|
||||
|
||||
ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER 0Z002
|
||||
eng "GET STACKED DIAGNOSTICS when handler not active"
|
||||
|
||||
ER_WARN_LEGACY_SYNTAX_CONVERTED
|
||||
eng "%s is no longer supported. The statement was converted to %s."
|
||||
|
||||
ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN
|
||||
eng "Statement is unsafe because it uses a fulltext parser plugin which may not return the same value on the slave."
|
||||
|
||||
ER_CANNOT_DISCARD_TEMPORARY_TABLE
|
||||
eng "Cannot DISCARD/IMPORT tablespace associated with temporary table"
|
||||
eng "Cannot DISCARD/IMPORT tablespace associated with temporary table"
|
||||
|
||||
ER_FK_DEPTH_EXCEEDED
|
||||
eng "Foreign key cascade delete/update exceeds max depth of %d."
|
||||
|
||||
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2
|
||||
eng "Column count of %s.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error."
|
||||
ger "Spaltenanzahl von %s.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie mysql_upgrade, um den Fehler zu beheben"
|
||||
|
||||
ER_WARN_TRIGGER_DOESNT_HAVE_CREATED
|
||||
eng "Trigger %s.%s.%s does not have CREATED attribute."
|
||||
|
||||
ER_REFERENCED_TRG_DOES_NOT_EXIST_MYSQL
|
||||
eng "Referenced trigger '%s' for the given action time and event type does not exist."
|
||||
|
||||
ER_EXPLAIN_NOT_SUPPORTED
|
||||
eng "EXPLAIN FOR CONNECTION command is supported only for SELECT/UPDATE/INSERT/DELETE/REPLACE"
|
||||
ER_INVALID_FIELD_SIZE
|
||||
eng "Invalid size for column '%-.192s'."
|
||||
|
||||
ER_MISSING_HA_CREATE_OPTION
|
||||
eng "Table storage engine '%-.64s' found required create option missing"
|
||||
|
||||
ER_ENGINE_OUT_OF_MEMORY
|
||||
eng "Out of memory in storage engine '%-.64s'."
|
||||
|
||||
ER_PASSWORD_EXPIRE_ANONYMOUS_USER
|
||||
eng "The password for anonymous user cannot be expired."
|
||||
|
||||
ER_SLAVE_SQL_THREAD_MUST_STOP
|
||||
eng "This operation cannot be performed with a running slave sql thread; run STOP SLAVE SQL_THREAD first"
|
||||
|
||||
ER_NO_FT_MATERIALIZED_SUBQUERY
|
||||
eng "Cannot create FULLTEXT index on materialized subquery"
|
||||
|
||||
ER_INNODB_UNDO_LOG_FULL
|
||||
eng "Undo Log error: %s"
|
||||
|
||||
ER_INVALID_ARGUMENT_FOR_LOGARITHM 2201E
|
||||
eng "Invalid argument for logarithm"
|
||||
|
||||
ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP
|
||||
eng "This operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '%s' first."
|
||||
|
||||
ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO
|
||||
eng "This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0."
|
||||
|
||||
ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS
|
||||
eng "CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file."
|
||||
|
||||
ER_QUERY_TIMEOUT
|
||||
eng "Query execution was interrupted, maximum statement execution time exceeded"
|
||||
|
||||
ER_NON_RO_SELECT_DISABLE_TIMER
|
||||
eng "Select is not a read only statement, disabling timer"
|
||||
|
||||
ER_DUP_LIST_ENTRY
|
||||
eng "Duplicate entry '%-.192s'."
|
||||
|
||||
ER_SQL_MODE_NO_EFFECT
|
||||
eng "'%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead."
|
||||
|
||||
ER_AGGREGATE_ORDER_FOR_UNION
|
||||
eng "Expression #%u of ORDER BY contains aggregate function and applies to a UNION"
|
||||
|
||||
ER_AGGREGATE_ORDER_NON_AGG_QUERY
|
||||
eng "Expression #%u of ORDER BY contains aggregate function and applies to the result of a non-aggregated query"
|
||||
|
||||
ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR
|
||||
eng "Slave worker has stopped after at least one previous worker encountered an error when slave-preserve-commit-order was enabled. To preserve commit order, the last transaction executed by this thread has not been committed. When restarting the slave after fixing any failed threads, you should fix this worker as well."
|
||||
|
||||
ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER
|
||||
eng "slave_preserve_commit_order is not supported %s."
|
||||
|
||||
ER_SERVER_OFFLINE_MODE
|
||||
eng "The server is currently in offline mode"
|
||||
|
||||
ER_GIS_DIFFERENT_SRIDS
|
||||
eng "Binary geometry function %s given two geometries of different srids: %u and %u, which should have been identical."
|
||||
|
||||
ER_GIS_UNSUPPORTED_ARGUMENT
|
||||
eng "Calling geometry function %s with unsupported types of arguments."
|
||||
|
||||
ER_GIS_UNKNOWN_ERROR
|
||||
eng "Unknown GIS error occured in function %s."
|
||||
|
||||
ER_GIS_UNKNOWN_EXCEPTION
|
||||
eng "Unknown exception caught in GIS function %s."
|
||||
|
||||
ER_GIS_INVALID_DATA 22023
|
||||
eng "Invalid GIS data provided to function %s."
|
||||
|
||||
ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION
|
||||
eng "The geometry has no data in function %s."
|
||||
|
||||
ER_BOOST_GEOMETRY_CENTROID_EXCEPTION
|
||||
eng "Unable to calculate centroid because geometry is empty in function %s."
|
||||
|
||||
ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION
|
||||
eng "Geometry overlay calculation error: geometry data is invalid in function %s."
|
||||
|
||||
ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION
|
||||
eng "Geometry turn info calculation error: geometry data is invalid in function %s."
|
||||
|
||||
ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION
|
||||
eng "Analysis procedures of intersection points interrupted unexpectedly in function %s."
|
||||
|
||||
ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION
|
||||
eng "Unknown exception thrown in function %s."
|
||||
|
||||
ER_STD_BAD_ALLOC_ERROR
|
||||
eng "Memory allocation error: %-.256s in function %s."
|
||||
|
||||
ER_STD_DOMAIN_ERROR
|
||||
eng "Domain error: %-.256s in function %s."
|
||||
|
||||
ER_STD_LENGTH_ERROR
|
||||
eng "Length error: %-.256s in function %s."
|
||||
|
||||
ER_STD_INVALID_ARGUMENT
|
||||
eng "Invalid argument error: %-.256s in function %s."
|
||||
|
||||
ER_STD_OUT_OF_RANGE_ERROR
|
||||
eng "Out of range error: %-.256s in function %s."
|
||||
|
||||
ER_STD_OVERFLOW_ERROR
|
||||
eng "Overflow error error: %-.256s in function %s."
|
||||
|
||||
ER_STD_RANGE_ERROR
|
||||
eng "Range error: %-.256s in function %s."
|
||||
|
||||
ER_STD_UNDERFLOW_ERROR
|
||||
eng "Underflow error: %-.256s in function %s."
|
||||
|
||||
ER_STD_LOGIC_ERROR
|
||||
eng "Logic error: %-.256s in function %s."
|
||||
|
||||
ER_STD_RUNTIME_ERROR
|
||||
eng "Runtime error: %-.256s in function %s."
|
||||
|
||||
ER_STD_UNKNOWN_EXCEPTION
|
||||
eng "Unknown exception: %-.384s in function %s."
|
||||
|
||||
ER_GIS_DATA_WRONG_ENDIANESS
|
||||
eng "Geometry byte string must be little endian."
|
||||
|
||||
ER_CHANGE_MASTER_PASSWORD_LENGTH
|
||||
eng "The password provided for the replication user exceeds the maximum length of 32 characters"
|
||||
|
||||
ER_USER_LOCK_WRONG_NAME 42000
|
||||
eng "Incorrect user-level lock name '%-.192s'."
|
||||
|
||||
# Should be different from ER_LOCK_DEADLOCK since it doesn't cause implicit
|
||||
# rollback. Should not be mapped to SQLSTATE 40001 for the same reason.
|
||||
ER_USER_LOCK_DEADLOCK
|
||||
eng "Deadlock found when trying to get user-level lock; try rolling back transaction/releasing locks and restarting lock acquisition."
|
||||
|
||||
ER_REPLACE_INACCESSIBLE_ROWS
|
||||
eng "REPLACE cannot be executed as it requires deleting rows that are not in the view"
|
||||
|
||||
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS
|
||||
eng "Do not support online operation on table with GIS index"
|
||||
|
||||
# MariaDB extra error numbers starts from 4000
|
||||
skip-to-error-number 4000
|
||||
|
@@ -975,7 +975,7 @@ ha_innobase::check_if_supported_inplace_alter(
|
||||
ha_alter_info->index_add_buffer[i]];
|
||||
if (key->flags & HA_SPATIAL) {
|
||||
ha_alter_info->unsupported_reason = innobase_get_err_msg(
|
||||
ER_INNODB_FT_LIMIT);
|
||||
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS);
|
||||
|
||||
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
|
||||
}
|
||||
@@ -1049,13 +1049,10 @@ ha_innobase::check_if_supported_inplace_alter(
|
||||
}
|
||||
|
||||
if (innobase_spatial_exist(altered_table)) {
|
||||
#ifdef MYSQL_SPATIAL_INDEX
|
||||
ha_alter_info->unsupported_reason =
|
||||
innobase_get_err_msg(
|
||||
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS);
|
||||
#endif
|
||||
ha_alter_info->unsupported_reason = innobase_get_err_msg(
|
||||
ER_INNODB_FT_LIMIT);
|
||||
|
||||
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
|
||||
} else {
|
||||
ha_alter_info->unsupported_reason =
|
||||
|
Reference in New Issue
Block a user