@Test
    void testEscapingTab() throws SQLException {
        final String vTab = new String(new byte[]{11});
        final String tabCharValue = "a" + vTab + "b" + vTab;
        final String tabCharRegex = "a[" + vTab + "]b(" + vTab + "|$)";
        final String insertBit = "INSERT INTO CHAR_SET_TEST VALUES (";

        try (final Connection connection = getConnection()) {
            // prepared statement escape chars for us
            try (final PreparedStatement preparedStatement = connection.prepareStatement(insertBit + "?)")) {
                preparedStatement.setString(1, tabCharValue);
                preparedStatement.execute();
            }

            try (final PreparedStatement preparedStatement = connection.prepareStatement(
                    "SELECT * FROM CHAR_SET_TEST WHERE TXT REGEXP ?")) {
                preparedStatement.setString(1, tabCharRegex);

                int i = 0;
                String result = "";
                try (final ResultSet resultSet = preparedStatement.executeQuery()) {
                    while (resultSet.next()) {
                        result = resultSet.getString(1);
                        i++;
                    }
                }

                assertThat(i).isEqualTo(1);
                assertThat(result).isEqualTo(tabCharValue);
            }
        }
    }
Test class to explore issues with character sets between Java and MySql.
Currently ignored as most of the tests require human oversight. Left in, in
case it proves useful.
stroom-statistics/stroom-statistics-impl-sql/src/test/java/stroom/statistics/impl/sql/TestMySQLCharacterSets.java