You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here getDataType() returns the a varchar (100) and compares it with a varchar without a length. This results in a Cast Object. Under MSSQL the default length of a varchar cast is 30 so all values will be shortened and the "=" compare fails for strings which are longer than 30 characters.
The generated code is:
lower
(
cast([TABLE].[FIELD_NAME] as varchar)
)
= lower('MY-REEAAAAAALYYYYY-LONNNNNNNNG-STRING')
The text was updated successfully, but these errors were encountered:
The quick fix is to have jOOQ's SQL Server integration cast VARCHAR types of unknown length to VARCHAR(MAX). A more thorough fix avoiding the cast entirely will be implemented with #2597.
The fix is committed and will be pushed in a bigger push, soon.
Thank you for the fix.
No, I don't have evaluated which other datatypes have similar problems, only our test cases are broken for the string comparison.
We migrate our implementation from 2.6.0 to 3.1.0 and figured out that the equalIgnoreCase method is broken for longer string comparisions.
The method internally calls the cast method which calls org.jooq.impl.AbstractField.cast(DataType)
Here getDataType() returns the a varchar (100) and compares it with a varchar without a length. This results in a Cast Object. Under MSSQL the default length of a varchar cast is 30 so all values will be shortened and the "=" compare fails for strings which are longer than 30 characters.
The generated code is:
The text was updated successfully, but these errors were encountered: