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

add pg16 test, add modifications to adapt to pg16 #25

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
strategy:
matrix:
pg: [15, 14, 13, 12, 11, 10]
pg: [16, 15, 14, 13, 12, 11, 10]
name: 🐘 PostgreSQL ${{ matrix.pg }}
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*.o
*.so
*.dylib


sha*.sql.in
sha*.sql
sha*.c
Expand Down
9 changes: 8 additions & 1 deletion expected/parallel_test.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
BEGIN;
SET max_parallel_workers_per_gather=4;
SET force_parallel_mode=on;
DO $$
BEGIN
IF current_setting('server_version_num')::int >= 160000 THEN
EXECUTE 'SET debug_parallel_query = on';
ELSE
EXECUTE 'SET force_parallel_mode = on';
END IF;
END $$;
CREATE TABLE parallel_test(i int, md md5hash, md2 md5hash) WITH (parallel_workers = 4);
INSERT INTO parallel_test (i, md, md2)
SELECT i, md5(i::text), md5((i + 1)::text)
Expand Down
9 changes: 8 additions & 1 deletion expected/parallel_test_0.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
BEGIN;
SET max_parallel_workers_per_gather=4;
SET force_parallel_mode=on;
DO $$
BEGIN
IF current_setting('server_version_num')::int >= 160000 THEN
EXECUTE 'SET debug_parallel_query = on';
ELSE
EXECUTE 'SET force_parallel_mode = on';
END IF;
END $$;
CREATE TABLE parallel_test(i int, md md5hash, md2 md5hash) WITH (parallel_workers = 4);
INSERT INTO parallel_test (i, md, md2)
SELECT i, md5(i::text), md5((i + 1)::text)
Expand Down
9 changes: 8 additions & 1 deletion sql/parallel_test.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
BEGIN;
SET max_parallel_workers_per_gather=4;
SET force_parallel_mode=on;
DO $$
BEGIN
IF current_setting('server_version_num')::int >= 160000 THEN
EXECUTE 'SET debug_parallel_query = on';
ELSE
EXECUTE 'SET force_parallel_mode = on';
END IF;
END $$;

CREATE TABLE parallel_test(i int, md md5hash, md2 md5hash) WITH (parallel_workers = 4);
INSERT INTO parallel_test (i, md, md2)
Expand Down
3 changes: 3 additions & 0 deletions src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

#include "common.h"
#include "fmgr.h"
#if PG_VERSION_NUM >= 160000
#include "varatt.h"
#endif

PG_MODULE_MAGIC;

Expand Down
3 changes: 3 additions & 0 deletions src/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#include "fmgr.h"
#include "utils/builtins.h"
#include "libpq/pqformat.h"
#if PG_VERSION_NUM >= 160000
#include "varatt.h"
#endif

#define MD5_LENGTH 16

Expand Down
3 changes: 3 additions & 0 deletions src/sha.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#ifndef SHA_NAME
#error No algorithm name defined
#endif
#if PG_VERSION_NUM >= 160000
#include "varatt.h"
#endif

typedef struct Sha {
unsigned char bytes[SHA_LENGTH];
Expand Down
Loading