-
Notifications
You must be signed in to change notification settings - Fork 170
feat(c/driver/postgresql): add validation suite and override tests #3821
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
feat(c/driver/postgresql): add validation suite and override tests #3821
Conversation
| # PostgreSQL returns -1 for CREATE TABLE | ||
| assert rows_affected == -1 |
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.
If multiple vendors do this, we should probably add a flag to the test itself instead of requiring overriding this test every time
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.
Created an issue for it in the validation repo (adbc-drivers/validation#140). I will leave a TODO in the code for now and come back and fix it after I implement a separate flag in the validation repo.
… of overriding the test
lidavidm
left a comment
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.
Thanks!
|
@Mandukhai-Alimaa can you file issues to fix any skipped tests? |
This PR contains:
There was a small change made in the c/driver/postgresql/result_helper.cc due to the segfault when the number of query parameters doesn't match the number of result columns. The test that triggered the bug was calling get_parameter_schema() on
SELECT 1 + $1 + $2.This query has 2 parameters but returns only 1 result column (the computed sum). The code was incorrectly using PQfname(result_, i) to retrieve parameter names, but PQfname() actually retrieves result column names from the result set. When iterating through parameters, the first iteration (i=0) would work fine accessing column 0, but the second iteration (i=1) would access an out-of-range column. PQfname() returns NULL for out-of-range column numbers, and passing this NULL pointer to AppendChild() as a C string causes the segfault.