We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let say we have MySQL >= 5.0 and a column val emoji = varchar(16).
val emoji = varchar(16)
Starting from MySQL 5.0 a varchar column requires to define its size in symbols. If we consider 'π¨πΏβπ©πΏβπ§πΏβπ¦πΏ' emoji, we found that it has 11 symbols: man emoji, skin modifier, ZWJ (zero-width joiner), woman emoji, skin modifier, ZWJ, girl emoji, skin modifier, ZWJ, boy emoji, skin modifier.
Thus, this emoji can be inserted to val emoji = varchar(16).
However, if we try to insert 'π¨πΏβπ©πΏβπ§πΏβπ¦πΏ' there via exposed, we'll get java.lang.IllegalStateException: Value 'π¨πΏβπ©πΏβπ§πΏβπ¦πΏ' can't be stored to database column because exceeds length circlet.stickers.server.DBStickers$Sticker.symbol.columnType.colLength
java.lang.IllegalStateException: Value 'π¨πΏβπ©πΏβπ§πΏβπ¦πΏ' can't be stored to database column because exceeds length circlet.stickers.server.DBStickers$Sticker.symbol.columnType.colLength
Exposed/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/UpdateBuilder.kt
Line 21 in 21659ea
The reason for this behavior is that in Java "π¨πΏβπ©πΏβπ§πΏβπ¦πΏ".lenght == 19, because every emoji and skin modifier is considered as a pair of symbols (https://docs.oracle.com/javase/tutorial/i18n/text/unicode.html)
"π¨πΏβπ©πΏβπ§πΏβπ¦πΏ".lenght == 19
The text was updated successfully, but these errors were encountered:
Change string length check to use codePointCount (#745, #743)
53ff362
Test enabled
f50fcae
SQLServer excluded from test
Successfully merging a pull request may close this issue.
Let say we have MySQL >= 5.0 and a column
val emoji = varchar(16)
.Starting from MySQL 5.0 a varchar column requires to define its size in symbols. If we consider 'π¨πΏβπ©πΏβπ§πΏβπ¦πΏ' emoji, we found that it has 11 symbols: man emoji, skin modifier, ZWJ (zero-width joiner), woman emoji, skin modifier, ZWJ, girl emoji, skin modifier, ZWJ, boy emoji, skin modifier.
Thus, this emoji can be inserted to
val emoji = varchar(16)
.However, if we try to insert 'π¨πΏβπ©πΏβπ§πΏβπ¦πΏ' there via exposed, we'll get
java.lang.IllegalStateException: Value 'π¨πΏβπ©πΏβπ§πΏβπ¦πΏ' can't be stored to database column because exceeds length circlet.stickers.server.DBStickers$Sticker.symbol.columnType.colLength
Exposed/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/UpdateBuilder.kt
Line 21 in 21659ea
The reason for this behavior is that in Java
"π¨πΏβπ©πΏβπ§πΏβπ¦πΏ".lenght == 19
, because every emoji and skin modifier is considered as a pair of symbols (https://docs.oracle.com/javase/tutorial/i18n/text/unicode.html)The text was updated successfully, but these errors were encountered: