Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CharsetMapper(charsetsToIntComplement: Map<Charset, Int> = emptyMap()) {
const val Binary = 63

val DefaultCharsetsByCharset = mapOf(
CharsetUtil.UTF_8 to 83,
CharsetUtil.UTF_8 to Integer.getInteger("jasyncMysqlUTF8Collation", 224), //previous default was 83
CharsetUtil.US_ASCII to 65,
CharsetUtil.ISO_8859_1 to 69
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@ class QuerySpec : ConnectionHelper() {

}

@Test
fun `test insert and query with unicode emoji`() {
val createTableEmoji = """CREATE TEMPORARY TABLE users (
id INT NOT NULL AUTO_INCREMENT ,
name VARCHAR(255) CHARACTER SET 'utf8mb4' NOT NULL ,
PRIMARY KEY (id) );"""
val insertEmoji = """INSERT INTO users (name) VALUES ('Boogie Man💩')"""
withConnection { connection ->
assertThat(executeQuery(connection, createTableEmoji).rowsAffected).isEqualTo(0)
assertThat(executeQuery(connection, insertEmoji).rowsAffected).isEqualTo(1)
val result: ResultSet = executeQuery(connection, this.select).rows

assertThat(result[0]("id")).isEqualTo(1)
assertThat(result(0)("name")).isEqualTo("""Boogie Man💩""")
}

}

@Test
fun `"connection" should "be able to select from a table" - validate columnNames()`() {

Expand Down