\xF0\x9F\x98\x94 不正确的字符串值 sql 异常的原因?

cause of \xF0\x9F\x98\x94 incorrect string value sql exception?

日志中有以下错误。当字符串 \xF0\x9F\x98\x94 作为参数传递时会发生错误。此值无法保存到 table,因此会抛出不正确的字符串值错误。我想知道传递这种价值的原因是什么。这是一次黑客攻击吗?当作为 post 表单参数传递时,我不知道 \xF0\x9F\x98\x94 是什么意思。感谢您的帮助!谢谢!

ERROR 2018-08-19 16:14:40,369 [ajp-bio-8109-exec-2808] util.JDBCExceptionReporter: Incorrect string value: '\xF0\x9F\x98\x94 B...' for column 'body' at row 1
ERROR 2018-08-19 16:14:40,372 [ajp-bio-8109-exec-2808] events.PatchedDefaultFlushEventListener: Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not update: [EventEmailDraft#42]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x94 B...' for column 'body' at row 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4098)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4030)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2677)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2134)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2434)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2352)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2337)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    ... 3 more
ERROR 2018-08-19 16:14:40,377 [ajp-bio-8109-exec-2808] errors.GrailsExceptionResolver: SQLException occurred when processing request: [POST] /roadrace/message/saveDraft
Incorrect string value: '\xF0\x9F\x98\x94 B...' for column 'body' at row 1. Stacktrace follows:
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not update: [EventEmailDraft#42]; uncategorized SQLException for SQL [update event_email_draft set version=?, body=?, emails=?, event_id=?, subject=? where id=? and version=?]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x98\x94 B...' for column 'body' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x94 B...' for column 'body' at row 1
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x94 B...' for column 'body' at row 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4098)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4030)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2677)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2134)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2434)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2352)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2337)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    ... 3 more

这是超过3个字节的Unicode序列

groovy:000> new String([0xF0, 0x9F, 0x98, 0x94] as byte[], 'UTF-8')
===> 

MySQL 中 UTF-8 的默认值仅包含 3 个字节。

可以在此处找到正确的解释 并且 "how do I change that" 等后续问题也可以在这里得到解答。