Skip to content
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

db_oracle: Fix issues#3505 "invalid parameter value" when do sql_query("update ...") #3504

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

GangZhuo
Copy link
Contributor

@GangZhuo GangZhuo commented Nov 6, 2024

Summary
fix issues#3505 "invalid parameter value" when do sql_query("update ...")

Details
The sql_query function currently passes a db_res pointer to the url->dbf.raw_query interface to receive query results.
However, the db_oracle_raw_query function expects a NULL value for the parameter used to receive query results when performing insert, delete, or update operations. This mismatch causes the query to fail.

Solution
Allow non-NULL parameters to be passed in, and then set the query result to NULL in the db_oracle_store_result function.
Additionally, the db_oracle_free_result function should also check if the result is not NULL.

Compatibility
Backwards compatible

Closing issues
closes #3505

@GangZhuo GangZhuo changed the title usrloc: fix build error when ORACLE_USRLOC flag is present db_oracle: Fix issues#3505 "invalid parameter value" when do sql_query("update ...") Nov 15, 2024
@liviuchircu liviuchircu self-requested a review November 15, 2024 16:04
Copy link
Member

@liviuchircu liviuchircu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @GangZhuo! Both the build fix and the NULL result handling changes look good to me. Merging & backporting here. Cheers!

@liviuchircu liviuchircu self-assigned this Nov 15, 2024
@liviuchircu liviuchircu added this to the 3.4.10 milestone Nov 15, 2024
@liviuchircu liviuchircu merged commit d94c7a8 into OpenSIPS:master Nov 15, 2024
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] "invalid parameter value" when do sql_query("update ...")
2 participants