Fixing 'SQL exception: Incorrect string value' on TeamCity with MySQL database

Friday, October 21, 2011
I found myself getting this error from TeamCity when trying to run some tests that contained non latin characters on the test name (actually a feature step) :

SQL query: INSERT INTO test_names (ID, TEST_NAME) VALUES (?, ?) SQL exception: Incorrect string value: '\xCE\xA4\xCE\xB1 \xCE...' for column 'test_name' at row 1

The problem was that the MySQL database that TeamCity was using had been set up with 'latin1' character set. I run this script on the database to alter all the tables and convert them to utf8 and everything worked like a charm afterwards :


2 comments:

  • Panayotis Matsinopoulos

    Nice post. Thanks a lot.
    One question. What is the purpose of '...WHERE 1...' ? Do you really need this?

  • Nikos Dimitrakopoulos

    Have no idea :)
    I guess the original author knows something more...

  • Post a Comment