Skip to content

Conversation

anthony-chu
Copy link
Member

@anthony-chu anthony-chu commented Oct 8, 2025

@anthony-chu anthony-chu marked this pull request as ready for review October 8, 2025 23:18
@anthony-chu anthony-chu changed the title WIP LPD-62912 LPD-62912 Add support for Microsoft SQL Server 2022 Oct 8, 2025
Copy link
Member

@drewbrokke drewbrokke left a 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)
Copy link
Member

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?

Copy link
Member Author

@anthony-chu anthony-chu Oct 13, 2025

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.

@drewbrokke drewbrokke merged commit 1da8cd0 into liferay:master Oct 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants