@Throws(Exception::class) fun testBug73663() { this.rs = this.stmt.executeQuery("show variables like 'collation_server'") this.rs.next() val collation: String = this.rs.getString(2) if (collation != null && collation.startsWith("utf8mb4") && "utf8mb4" == (this.conn as MySQLConnection).getServerVariable( "character_set_server" ) ) { val p = Properties() p.setProperty("characterEncoding", "UTF-8") p.setProperty( "statementInterceptors", Bug73663StatementInterceptor::class.java.getName() ) getConnectionWithProps(p) } else { println("testBug73663 was skipped: This test is only run when character_set_server=utf8mb4 and collation-server set to one of utf8mb4 collations.") } }
Tests fix for Bug # 73663 ( 19479242 ) , utf8mb4 does not work for connector/j > =5.1.13 This test is only run when character_set_server=utf8mb4 and collation-server set to one of utf8mb4 collations ( it 's better to test two configurations : with default utf8mb4_general_ci and one of non-default , say utf8mb4_bin )