-
Notifications
You must be signed in to change notification settings - Fork 182
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
Upgrade to Postgres 17 #264
Conversation
These are no longer built automatically.
If the helper `spcachekey_hash` and `spcachekey_equal` static functions are not included in the source, this fails to build. We instead just avoid generating the hashtable function implementations entirely.
The parser now adds a single entry in the `keys` array, with the string `value`.
dea5f0f
to
6ca22b7
Compare
6ca22b7
to
08226fb
Compare
With PostgreSQL 17, we need to need to support `JsonTablePlan`, an abstract node type that itself has no fields. In the fingerprint and protobuf function generators, we now add support to cast these nodes to plain `(Node*)`, fixing compiler warnings where pointer types mismatch.
ce9e2ee
to
97ce3a3
Compare
Hi, I'm quite slowly trying to upgrade my One of the first failing tests is a worrisome segmentation fault: the test simply exercises the protobuf parse/deparse entry points (ie, it just calls So I morphed your // Welcome to the easiest way to parse an SQL query :-)
// Compile the file like this:
//
// cc -I../ -L../ deparse.c -lpg_query
#include <pg_query.h>
#include <stdio.h>
#include <stdlib.h>
size_t testCount = 6;
const char* tests[] = {
"SELECT 1",
"SELECT * FROM x WHERE z = 2",
"SELECT 5.41414",
"SELECT $1",
"SELECT 999999999999999999999::numeric/1000000000000000000000",
"SELECT 4790999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"
};
int main() {
PgQueryProtobufParseResult result;
size_t i;
for (i = 0; i < testCount; i++) {
result = pg_query_parse_protobuf(tests[i]);
if (result.error) {
printf("error: %s at %d of query %s\n",
result.error->message,
result.error->cursorpos,
tests[i]);
} else {
PgQueryDeparseResult deparse_result = pg_query_deparse_protobuf(result.parse_tree);
if (deparse_result.error) {
printf("\nERROR for \"%s\"\n %s\n",
tests[i],
deparse_result.error->message);
pg_query_free_deparse_result(deparse_result);
} else {
printf("\n%s --> %s\n",
tests[i],
deparse_result.query);
pg_query_free_deparse_result(deparse_result);
}
}
pg_query_free_protobuf_parse_result(result);
}
pg_query_exit();
return 0;
} And it fails in the same way:
What am I missing here? Thanks&bye. |
Hi @lelit, thanks for the test! I can't seem to reproduce this here. I've tried the example on macOS (M1 ARM chip) with both Can you try running |
That fixed it indeed, thank you: didn't come to mind given that I was operating in a (evidently not enterely) fresh clone of pglast, of which libpg_query is a submodule! |
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.
👍
Outstanding TODO:
- Add PL/pgSQL test for array types
- Update Makefile to copy PL/pgSQL regression tests automatically
Noteworthy commits that change the build/test system:
JsonTablePlan*
, an abstract sub-type ofNode*
disableOnMsvc
option to fingerprint test generatorname_location
, a type that needs to be cleared in deparse tests just likelocation
.