Scaleout table and routing function errors
In a database cluster group for Aurora, a scaleout table spreads its rows over member tables in several collocations, by a routing function. Use the following table to find the cause of an error from a routing function or scaleout table statement. For what to do about each error, see Fixing scaleout table and routing function errors. For the syntax of these statements, see Scaleout table statements. For errors on routed reads and writes to a scaleout table, see Routing and data mapping errors.
Scaleout table and routing function error codes
The following table lists the errors for statements that create, change, or drop routing functions and scaleout tables, one error in each row. For the routing functions, see Routing functions.
| Aurora MySQL code (SQLSTATE) | Message | Cause |
|---|---|---|
| 1235 (42000), or the Aurora MySQL partitioning error for the same mistake, such as 1582 (42000), 1517 (HY000), or 1493 (HY000) | The routing layer refuses the routing function definition, for example HASH algorithm name must be a string literal, found '<value>' (1235), Incorrect parameter count in the call to routing function '<function>' (1582), or Duplicate TARGET COLLOCATION name <collocation> (1517) |
A CREATE SCALEOUT ROUTING FUNCTION statement has an invalid definition. For every error and its code, see CREATE SCALEOUT ROUTING FUNCTION. |
| 1305 (42000) | FUNCTION <name> does not exist. Use MOD, PREFIX, COLUMN or HASH. |
The statement names a routing function other than MOD, PREFIX, COLUMN, or HASH. |
| 1235 (42000) | Parameter data type is incompatible with the routing function type |
The routing layer doesn't accept the data type of the routing key for this routing function. For some data types, the routing layer returns the error that Aurora MySQL returns for that type in a partitioning key instead: 1502 for a BLOB, TEXT, or JSON key, 1178 for a spatial key, 1659 for a COLUMN key of a type that Aurora MySQL doesn't allow, 1491 for a MOD key that isn't an integer, and 1063 for a PREFIX key that isn't a string. |
| 64005 (42000) | TARGET COLLOCATION '<collocation>' not found: no data mapping declares such a router_collocation_group (names are case-sensitive) (the message names every missing collocation, separated by commas), or Collocation group '<collocation>' doesn't exist |
The routing function names a target collocation that no data mapping declares. |
| 64022 (42000) | Routing function '<function>' already exists |
A routing function with that name exists. |
| 64025 (42000) | Data mapping '<name>' already exists |
The scaleout table name equals a router table name in data_mappings. |
| 64000 (42000) | Member '<member>' has no data mapping. Create a data mapping for it. |
A member is a cluster name, an unmapped name, or a database-level mapping. A member must be the router table name of a table-level data mapping. |
| 64040 (42000) | Member '<member>' already belongs to a scaleout table |
A member belongs to one scaleout table only. |
| 64066 (42000) | Scaleout table '<table>' has no member in collocation group '<collocation>', which its routing function targets |
Every collocation that the routing function targets needs exactly one member. A member list that misses a collocation, or a DROP MEMBER of the only member in a collocation, fails. |
| 64024 (42000) | Scaleout table '<table>' already has a member in collocation group '<collocation>' |
A member that the statement adds is in a collocation where the table already has a member. |
| 64065 (42000) | Members '<member>' and '<member>' are in collocation group '<collocation>'. A scaleout table can have only one member per collocation group. |
The statement names two members in the same collocation. A table has exactly one member in each target collocation. |
| 64042 (42000) | Cannot drop routing function '<function>' referenced by scaleout tables |
A scaleout table still uses the routing function. |
| 1064 (42000) | You have an error in your SQL syntax; hash algorithm '<name>' is not supported, or another You have an error in your SQL syntax; ... message |
The hash algorithm is unsupported or empty, or a POSITION is 0, is repeated, or isn't on every key column. |
| 1495 (HY000) | Multiple definition of same value <N> in TARGET COLLOCATION mappings |
The routing function maps the same value to two collocations. |
| 1480 (HY000) | All TARGET COLLOCATION entries must use the same mapping type |
The routing function mixes VALUES IN with VALUES IN RANGE. |
| 1481 (HY000) | MAXVALUE can only be used in the last TARGET COLLOCATION mapping (found in '<collocation>') |
MAXVALUE isn't in the last range. |
| 1488 (HY000) | Field in list of fields for partition function not found in table; unknown column '<column>' in routing function <TYPE> |
The PARTITION BY clause names a column that isn't a parameter of the routing function. For a MOD routing function, the routing layer returns error 1054 instead. |
| 1493 (HY000) | TARGET COLLOCATION '<collocation>' has an inverted VALUES IN RANGE; a range whose low bound exceeds its high bound matches no value, TARGET COLLOCATION '<a>' and '<b>' have overlapping VALUES IN RANGE bounds, TARGET COLLOCATION '<collocation>' has a VALUES IN RANGE whose low bound sorts above its high bound under the routing key's collation '<collation>', so it matches no value, or Routing function '<function>' cannot route this table: TARGET COLLOCATION '<a>' and '<b>' have VALUES IN RANGE bounds that overlap under the routing key's collation '<collation>' |
Two ranges overlap, or a range ends below its start. |
| 1654 (HY000) | TARGET COLLOCATION '<collocation>' has an invalid VALUES IN RANGE bound; each bound must have the type this routing function returns |
A COLUMN or PREFIX routing function has a VALUES IN RANGE bound of the wrong type. |
| 1697 (HY000) | TARGET COLLOCATION '<collocation>' has an invalid VALUES IN RANGE bound; each bound must have the type this routing function returns |
A MOD or HASH routing function has a VALUES IN RANGE bound of the wrong type, or a HASH bound above the interval. |
| 1491 (HY000) | The routing function <function> returns the wrong type for parameter '<parameter>' |
A MOD routing function uses a key that isn't an integer. The routing layer returns the engine's error for this key type instead of 1235. |
| 1113 (42000) | A scaleout table must have at least 1 member |
The scaleout table has no members. |
| 1066 (42000) | Not unique member: '<member>' |
The statement names the same member twice. |
| 1179 (25000) | <statement> is not allowed inside a transaction (opened by BEGIN/START TRANSACTION or SET autocommit=0) |
The statement ran inside a transaction or with autocommit off. |
| 1235 (42000) | Unsupported routing function type. Only MOD, PREFIX, COLUMN and HASH are supported (user-defined function body), or EXPLAIN for SCALEOUT TABLE DDL is not supported yet (EXPLAIN) |
The routing function has a user-defined function body, or the statement is an EXPLAIN of a scaleout table or routing function statement. |
| 64001 (42000) | Scaleout table '<table>' doesn't exist |
The statement names a scaleout table that doesn't exist. |
| 64003 (42000) | Routing function '<function>' doesn't exist |
The statement names a routing function that doesn't exist. |
| 64020 (42000) | Scaleout table '<table>' already exists |
A scaleout table with that name exists. |
| 3168 (HY000) | The database cluster group metadata is temporarily unavailable |
The metadata service is unreachable or failing over. Wait briefly, then retry the statement. |
| 64061 (42000) | Scaleout table '<table>' can't inherit its routing function from '<parent>'. '<parent>' must define its own routing function. |
USING ROUTING FUNCTION OF names a table that itself takes its routing function from another table. |
A CREATE OR REPLACE SCALEOUT ROUTING FUNCTION statement returns error 1235 (42000), This operation is not supported in query routing mode. Use the cluster endpoint directly or pin the session to a member cluster. The routing layer doesn't recognize CREATE OR REPLACE as scaleout DDL.
A change of routing function on a table that holds rows returns no error. ALTER ... DROP ROUTING FUNCTION and ADD ROUTING FUNCTION both succeed, and the rows stay where they are. Under the new function, reads of those keys return 0 rows, so the data appears to be missing. With no routing function bound, a query returns error 1235, Scaleout table '. If another table inherits the function, table_name' has no routing function nameDROP ROUTING FUNCTION returns error 1235, cannot clear routing on scaleout table '.table_name': other scaleout tables inherit its routing function
For a member table whose database or routing key column is missing on its member cluster, CREATE SCALEOUT TABLE succeeds without validating either. Queries and inserts then return the member cluster's error: 1049 Unknown database, 1146 Table ', or 1054 db_name.table_name' doesn't existUnknown column '.column_name' in 'where clause'