The problem is not reproducible with PostgreSQL either, only with MySQL, default settings. This must be a misconfiguration / bug in MySQL or the JDBC driver.