Help Center> Data Replication Service> Troubleshooting> Failure Cases> Real-Time Migration and Synchronization from MySQL to MySQL> Full Phase Error: Invalid GIS data provided to function st_geometryfromtext'
Updated on 2024-06-07 GMT+08:00

Full Phase Error: Invalid GIS data provided to function st_geometryfromtext'

Scenarios

During a full migration or synchronization, an error is reported, and the log information is as follows: An error occurred in the process DATAMOVE, caused by: apply event=[type=table_data, shard_id=0, batch_index_in_shard=1, table_name=%s, record_num=1] occur error, msg=apply data of table=%s failed: Data truncation: Invalid GIS data provided to function st_geometryfromtext.

Possible Causes

During cross-version migration of MySQL geographic type data, the rules for checking the valid geographic type in the destination database are inconsistent with those in the source database. This problem usually occurs when MySQL 5.6 is migrated to MySQL 5.7 or 8.0. The geographic type data of the source database is in invalid format in the destination database. As a result, an error is reported when DRS is used to insert data into the destination database.

For example, when POLYGON is used, the number of coordinate points is verified in 5.7 or later. At least three coordinate points are required to form a valid polygon. In version 5.6, no verification is performed, and polygons represented by a single coordinate point can be inserted properly.

Solution

  • Solution 1
    1. Modify the geographic type data that does not meet the format requirements of the destination database version in the source database.
    2. In the task list, locate the target task and click Resume in the Operation column to resume the task.
  • Solution 2
    1. Create a DRS task again and deselect the table for which the error is reported during object selection.
    2. After the migration is complete, export the table data, modify the table data to the valid format of the destination database, and manually migrate the table data to the destination database.