Question

Ok, had a problem when I was trying to insert an string that was believed came in UTF-8 format when truly was latin-1. Problem was, behaviour between different servers varied like:

  • Windows will give an error when confronted when a non-UTF8 char: "Incorrect string value: '\xD1OL S....' for column [...]"

  • Linux will quietly insert whatever I give it until it finds the first char it doesn't like, and then truncate the rest of the string.

For once, I find that the windows behaviour is the one I'd rather have. I've been looking and haven't found some kind of option to make the mysql linux server more strict.

Do you now of one?.

Thanks!.

Was it helpful?

Solution

Well, that was quick. Problem was, we had a 5.6 Linux server that was not in strict mode, though our DBA assured me that it was, making us think that it was a Linux problem.

So, just activate STRICT_ALL_TABLES. MySQL modes and how to activate them are here:

http://dev.mysql.com/doc/refman/5.6/en/sql-mode.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top