MySQL Forums
Forum List  »  General

“Invalid utf8mb4 character string” warnings on POINT fields when importing from a mysqldump
Posted by: Ben Holness
Date: February 07, 2017 02:13PM

I recently dumped a database as part of migrating it from an old server to a new server. Some of the tables have the utf8mb4 character set as the default collation and as the character set for some of the fields.

One of the tables also has a field of type POINT. When I run mysqldump --default-character-set=utf8mb4 ... > dump.sql and then try to import dump.sql I get the "Invalid utf8mb4 character string" warning for any rows that have a location set in the POINT field.

Do I need to worry about this? It looks to me like the data gets migrated correctly, but I do so dislike seeing warnings!

Here is an example dump and steps to reproduce:

/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40101 SET character_set_client = utf8mb4 */;

CREATE TABLE `User` (
`UserID` int(11) NOT NULL AUTO_INCREMENT,
`Username` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`DefaultLatLong` point NOT NULL,
`LastLatLong` point NOT NULL,
PRIMARY KEY (`UserID`),
SPATIAL KEY `LastLatLong` (`LastLatLong`),
SPATIAL KEY `DefaultLatLong` (`DefaultLatLong`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

INSERT INTO `User` VALUES (1,'user1','\0\0\0\0\0\0\0?4??=@\??O@?V?',' \0\0\0\0\0\0\0?Y\??C@0?\?H\n');

If you source file.sql on the file containing this SQL you get the following warnings on the insert:

Query OK, 1 row affected, 2 warnings (0.00 sec)
Warning (Code 1300): Invalid utf8mb4 character string: 'BE141E'
Warning (Code 1300): Invalid utf8mb4 character string: '8959D4'

Further information:

> file -i file.sql
file.sql: application/octet-stream; charset=binary

> mysql --version
mysql Ver 14.14 Distrib 5.7.17, for Linux (i686) using EditLine wrapper

Running Ubuntu 16.04 LTS

Options: ReplyQuote


Subject
Written By
Posted
“Invalid utf8mb4 character string” warnings on POINT fields when importing from a mysqldump
February 07, 2017 02:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.