-
Notifications
You must be signed in to change notification settings - Fork 22
LPD-62912 Add support for Microsoft SQL Server 2022 #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple comments. Assuming there are no concerns arising from the, I think we're good to go with this one.
String schema -> | ||
|
||
executeSQLQuery("update ObjectValidationRule set active_ = false where objectDefinitionId in (select objectDefinitionId from ObjectDefinition where externalReferenceCode = 'L_USER')", schema) | ||
executeSQLQuery("update ObjectValidationRule set active_ = 'false' where objectDefinitionId in (select objectDefinitionId from ObjectDefinition where externalReferenceCode = 'L_USER')", schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this issue observed? Is this backwards compatible with other database types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initially, it gives a unhelpful exception:
java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
this comes from the attempt to parse the results of the executed sql query. printing out the actual bare result that comes back from the query, the following response is given:
[Msg 207, Level 16, State 1, Server 804fb429fda5, Line 1, Invalid column name 'false'.]
for SQL Server, false
is a reserved keyword. in order to be used as a string, it needs to be quoted.
i had not tested it for other databases. i did just now, and other databases don't accept the single-quotes around false
, so added a check for the database to determine which sql statement to use.
i'll send a follow-up PR to address the other DBs.
https://liferay.atlassian.net/browse/LPD-62912