Guest
1
Consider mssql database, table XXX with column AAA of type nvarchar(255). Lets take following changeSet fragment:
-
-
-
Liquibase will translate this to something like:
- update XXX set AAA = ‘zaźółć gęślą jaźń’;
And you could expect that this exact string will be stored in the database, right?
Wrong.
Mssql will assume non-unicode string and you will end up with ‘zazólc gesla jazn’ in DB.
The correct SQL is:
- update XXX set AAA = N’zaźółć gęślą jaźń’;
with capital N before string. The problem is… I can’t see any support in Liquibase for that. Any idea?
nessumo
2
(It’s version 2.0.3 BTW)
I can see that real string quoting is done manually in several places via something like:
- if (newValue instanceof String && database.shouldQuoteValue(((String) newValue))) {
- sqlString = “’” + newValue + “’”;
- }
I think we could fix this by extracting it to AbstractDatabase function and MssqDatabasel would add extra “N”. What do you think about this, Nathan?