Error
Error Code: 3718

MySQL Error 3718: SRS Attribute Too Long

📦 MySQL
📋

Description

MySQL Error 3718, 'Attribute %s is too long', occurs when a string value provided for a Spatial Reference System (SRS) attribute exceeds its maximum permissible character length. This typically happens during the creation or modification of an SRS definition, where a specific attribute's value (e.g., an SRS name or authority code) is too long for the database to store.
💬

Error Message

Attribute %s is too long. The maximum length is %u characters.
🔍

Known Causes

3 known causes
⚠️
Overly Long Attribute Value in SRS Definition
An attribute within a `CREATE SPATIAL REFERENCE SYSTEM` statement, such as the `NAME` or `ORGANIZATION_NAME`, contains a string value that exceeds its defined maximum length.
⚠️
Incorrectly Formatted WKT/PROJ.4 String
The Well-Known Text (WKT) or PROJ.4 string used to define an SRS includes an attribute value (e.g., for a coordinate system or datum name) that is excessively long, violating MySQL's internal parsing limits.
⚠️
Attribute Length Exceeded During SRS Alteration
An `ALTER SPATIAL REFERENCE SYSTEM` statement attempts to modify an SRS attribute with a new string value that is longer than the allowed maximum for that specific attribute.
🛠️

Solutions

3 solutions available

1. Truncate or Shorten the Data easy

Reduce the length of the specific attribute's value to fit within the maximum allowed size.

1
Identify the specific attribute causing the error. The error message usually provides the attribute name (e.g., '%s').
2
Determine the maximum allowed length for that attribute. The error message also provides this (e.g., '%u').
3
Modify the data that is being inserted or updated so that it does not exceed the maximum length. This might involve manual editing of input data or adjusting application logic.
4
If this is a recurring issue, review the application logic that generates or processes this data to ensure it handles length constraints appropriately.

2. Increase the Column Size (if feasible) medium

Modify the table schema to allow for larger values in the offending column.

1
Identify the table and column that corresponds to the 'SRS Attribute' mentioned in the error message.
2
Determine the current data type and size of the column. You can use `DESCRIBE` or `SHOW CREATE TABLE` for this.
DESCRIBE your_table_name;
3
If the column is a `VARCHAR` or `TEXT` type, you can alter its size. Choose a new size that accommodates your expected data length, but be mindful of disk space and performance implications.
ALTER TABLE your_table_name MODIFY COLUMN your_column_name VARCHAR(new_max_length);
4
If the column is a fixed-length type (e.g., `CHAR`), you might need to change the type to a variable-length type (e.g., `VARCHAR`) and then specify a new size.
ALTER TABLE your_table_name MODIFY COLUMN your_column_name VARCHAR(new_max_length);
5
Execute the `ALTER TABLE` statement. Ensure you have backups before making schema changes.

3. Adjust MySQL Server Configuration (for specific data types) advanced

Modify MySQL server variables that control maximum lengths for certain data types.

1
Understand that this solution is generally applicable to `BLOB` and `TEXT` data types and their variations. The error code '3718' is less common for these, but it's worth investigating if the attribute is of such a type and the standard column size increase isn't sufficient.
2
Identify relevant MySQL server configuration variables. For large objects, these might include `max_allowed_packet` (for communication buffer size, which can indirectly affect large data handling) and potentially limits related to specific storage engines if applicable. However, 'SRS Attribute Too Long' is more often a schema constraint.
3
To temporarily change a variable, use `SET GLOBAL` (requires SUPER privilege). This change will be lost on server restart.
SET GLOBAL max_allowed_packet = 100 * 1024 * 1024; -- Example: set to 100MB
4
To make the change permanent, edit your MySQL configuration file (e.g., `my.cnf` or `my.ini`) and add or modify the variable under the `[mysqld]` section. Then restart the MySQL server.
[mysqld]
max_allowed_packet = 100M
5
Consult MySQL documentation for specific variables related to the data type of the attribute in question, as the 'SRS Attribute Too Long' error might be tied to a less common or engine-specific limit.
🔗

Related Errors

5 related errors