Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.7
-
None
-
None
-
MySQL 5.6.17
MariaDB JDBC Driver 1.1.7
Mac OS X 10.9.2 Mavericks
Description
I get this error
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO mytable (id, field1, field2, field3) VALUES (?, ?, ?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x98\x84"}' for column 'field3' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x84"}' for column 'field3' at row 1
|
(...)
|
Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x84"}' for column 'payload' at row 1
|
at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:149)
|
at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
|
at org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:264)
|
at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:288)
|
at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:317)
|
at org.mariadb.jdbc.MySQLPreparedStatement.executeUpdate(MySQLPreparedStatement.java:156)
|
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:916)
|
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:909)
|
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
|
... 78 more
|
Caused by: org.mariadb.jdbc.internal.common.QueryException: Incorrect string value: '\xF0\x9F\x98\x84"}' for column 'payload' at row 1
|
at org.mariadb.jdbc.internal.mysql.MySQLProtocol.getResult(MySQLProtocol.java:942)
|
at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:991)
|
at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:281)
|
... 83 more
|
The connection string is:
jdbc:mysql://127.0.0.1:3306/mydatabase?useUnicode=yes&useConfigs=maxPerformance\
|
The database is properly configured:
flozano:/etc$ cat my.cnf
|
[mysqld]
|
character-set-server=utf8mb4
|
���
field3 is defined as:
`field3` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
Connector/J can perform exactly the same query against the exactly same database with the same data.
Attachments
Issue Links
- relates to
-
CONJ-118 MySQL incompatibility: utf8mb4 is not the default one when utf8 is used
- Closed