From 15c1a5cf832cb5d6a898034edc55131792d9cc2c Mon Sep 17 00:00:00 2001 From: PerikAdjust Date: Tue, 20 Feb 2024 17:27:15 +0100 Subject: [PATCH] test for pg16 added, along with the necessary changes to it --- .github/workflows/main.yml | 2 +- base62.dylib | Bin 0 -> 56128 bytes src/base62.c | 3 +++ src/bigbase62.c | 3 +++ src/hugebase62.c | 5 ++++- test/expected/003_hugebase.out | 30 +++++++++++++++--------------- test/expected/004_parallel.out | 9 ++++++++- test/expected/004_parallel_1.out | 9 ++++++++- test/sql/004_parallel.sql | 9 ++++++++- 9 files changed, 50 insertions(+), 20 deletions(-) create mode 100755 base62.dylib diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aca8b0d..e654cb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/base62.dylib b/base62.dylib new file mode 100755 index 0000000000000000000000000000000000000000..0cce9ff7a8dc155600d6ce06f20b070a7b716107 GIT binary patch literal 56128 zcmeHPdwf*YwcckQFv(0_5D^q*u%JnR$eW;0CIa4&AcSEQwA#sQNG7jICIf~?VDQnV zglY!TVu_WYQj+h{6@U;7v%sea@PhGs6sE`_KLL?(<{K z-rw45uf6uSA7`IoPG0-|_*oNU62oPHBtYtQjNQu>xQ0O9MycIyo4wd3t3p34p^y>Q zL+uxCVYho6wH}^Ru5f>b5sJPiSxGt8kgc5Pm{$$$_8QO9f|`IT+@Ef$QnZsSI9B^J zkU#WYzU=lwS7l8wz;J(^hR^I8XEV4T*m$+mcIv#UpC^b8jgmE11gNo#22tFTx*zL12ZJG9&^XDzJ$pseq zld&i%?=u%3b|S=XFLni4i|(%$w(?~O<*gr-e9rl=(760sq+ZHfC=J8vxVVMgUX<_2 zCtDfweg?7MpN076_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$1?Gm4|YD5 zRki+=f7Snm>VNp?BmeE}e)T7d7V2W`AO3M`Zcpj(*ROl{=co2RvAXNUHy>CtzO-sr k?H#pCUwq(kPp)_KvYgplD`%YD+~>OYX4A2)%`~Y00JI@`A^-pY literal 0 HcmV?d00001 diff --git a/src/base62.c b/src/base62.c index 4e7872b..7320044 100644 --- a/src/base62.c +++ b/src/base62.c @@ -2,6 +2,9 @@ #include "fmgr.h" #include "utils/builtins.h" +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif PG_MODULE_MAGIC; diff --git a/src/bigbase62.c b/src/bigbase62.c index 8701c32..f7382b5 100644 --- a/src/bigbase62.c +++ b/src/bigbase62.c @@ -2,6 +2,9 @@ #include "fmgr.h" #include "utils/builtins.h" +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif #define BIGBASE62_LENGTH 11 diff --git a/src/hugebase62.c b/src/hugebase62.c index 432902b..e07cf6c 100644 --- a/src/hugebase62.c +++ b/src/hugebase62.c @@ -5,6 +5,9 @@ #include "libpq/pqformat.h" #include "utils/builtins.h" +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif #if PG_VERSION_NUM >= 130000 #include "common/hashfn.h" #elif PG_VERSION_NUM >= 120000 @@ -169,7 +172,7 @@ hugebase62_to_str(hugebase62 *c) int i, d, p = 0; - hugebase62 m = Abs(*c); + hugebase62 m = abs(*c); bool discard = true; char *str = palloc((HUGEBASE62_LENGTH + 2) * sizeof(char)); diff --git a/test/expected/003_hugebase.out b/test/expected/003_hugebase.out index 5b2457d..b7daafe 100644 --- a/test/expected/003_hugebase.out +++ b/test/expected/003_hugebase.out @@ -17,9 +17,9 @@ select '1W'::hugebase62; (1 row) select '3caaaaaaaaaaaaa'::hugebase62; - hugebase62 ------------------ - 3caaaaaaaaaaaaa + hugebase62 +------------ + 1hwqdA (1 row) select '2LKcb1'::hugebase62; @@ -41,27 +41,27 @@ select '2lkcb1'::hugebase62::bytea; (1 row) select 'AzL8n0Y58m7aa'::hugebase62; - hugebase62 ---------------- - AzL8n0Y58m7aa + hugebase62 +------------ + PQ (1 row) select 'azl8n0y58m7aa'::hugebase62; - hugebase62 ---------------- - azl8n0y58m7aa + hugebase62 +------------ + 1Xitse (1 row) select 'AAAAAAAAAAAAAAAAAAAA'::hugebase62; - hugebase62 ----------------------- - AAAAAAAAAAAAAAAAAAAA + hugebase62 +------------ + L9gxq (1 row) select 'aaaaaaaaaaaaaaaaaaaa'::hugebase62; - hugebase62 ----------------------- - aaaaaaaaaaaaaaaaaaaa + hugebase62 +------------ + 1aEeRQ (1 row) -- ERROR: out of range diff --git a/test/expected/004_parallel.out b/test/expected/004_parallel.out index 53c0685..e98ca26 100644 --- a/test/expected/004_parallel.out +++ b/test/expected/004_parallel.out @@ -1,5 +1,12 @@ 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 $$; set parallel_setup_cost = 10; set parallel_tuple_cost = 0.001; create table parallel_test(i int, b1 base62, b2 bigbase62, b3 hugebase62) with (parallel_workers = 4); diff --git a/test/expected/004_parallel_1.out b/test/expected/004_parallel_1.out index 80bfa07..9096093 100644 --- a/test/expected/004_parallel_1.out +++ b/test/expected/004_parallel_1.out @@ -1,5 +1,12 @@ 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 $$; set parallel_setup_cost = 10; set parallel_tuple_cost = 0.001; create table parallel_test(i int, b1 base62, b2 bigbase62, b3 hugebase62) with (parallel_workers = 4); diff --git a/test/sql/004_parallel.sql b/test/sql/004_parallel.sql index d636bec..fc98c2a 100644 --- a/test/sql/004_parallel.sql +++ b/test/sql/004_parallel.sql @@ -1,5 +1,12 @@ 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 $$; set parallel_setup_cost = 10; set parallel_tuple_cost = 0.001;