Skip to content

Commit bece22c

Browse files
committed
test(postgres): update cloudsync_init callsites to integer flags
Commit 65ef99b changed the 3-arg cloudsync_init signature from (text, text, boolean) to (text, text, integer), but the test suite was never updated and every call still passed true/false, which PostgreSQL refused to implicitly cast. Replace , true) with , 1) and , false) with , 0) across all test/postgresql/*.sql files (168 callsites in 43 files).
1 parent 8c2e03f commit bece22c

43 files changed

Lines changed: 168 additions & 168 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

test/postgresql/01_unittest.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ SELECT (:fail::int + 1) AS fail \gset
7272
\endif
7373
DROP TABLE IF EXISTS smoke_tbl;
7474
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
75-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id \gset
75+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id \gset
7676
SELECT (to_regclass('public.smoke_tbl_cloudsync') IS NOT NULL) AS init_create_ok \gset
7777
\if :init_create_ok
7878
\echo [PASS] (:testid) Test init create
@@ -303,8 +303,8 @@ SELECT (:fail::int + 1) AS fail \gset
303303
\endif
304304

305305
-- 'Test double init no-op'
306-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id2 \gset
307-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id3 \gset
306+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id2 \gset
307+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id3 \gset
308308
\echo [PASS] (:testid) Test double init no-op
309309

310310
-- 'Test payload encode signature'

test/postgresql/02_roundtrip.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CREATE DATABASE cloudsync_test_2;
1616
CREATE EXTENSION IF NOT EXISTS cloudsync;
1717
DROP TABLE IF EXISTS smoke_tbl;
1818
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
19-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
19+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
2020
SELECT cloudsync_payload_apply(decode(:'payload_hex', 'hex')) AS _apply_ok \gset
2121
SELECT md5(COALESCE(string_agg(id || ':' || COALESCE(val, ''), ',' ORDER BY id), '')) AS smoke_hash_b
2222
FROM smoke_tbl \gset

test/postgresql/03_multiple_roundtrip.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ CREATE DATABASE cloudsync_test_03_c;
1717
CREATE EXTENSION IF NOT EXISTS cloudsync;
1818
DROP TABLE IF EXISTS smoke_tbl;
1919
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
20-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
20+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2121

2222
\connect cloudsync_test_03_b
2323
\ir helper_psql_conn_setup.sql
2424
CREATE EXTENSION IF NOT EXISTS cloudsync;
2525
DROP TABLE IF EXISTS smoke_tbl;
2626
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
27-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
27+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
2828

2929
\connect cloudsync_test_03_c
3030
\ir helper_psql_conn_setup.sql
3131
CREATE EXTENSION IF NOT EXISTS cloudsync;
3232
DROP TABLE IF EXISTS smoke_tbl;
3333
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
34-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
34+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
3535

3636
-- Round 1: independent inserts on each database
3737
\connect cloudsync_test_03_a

test/postgresql/04_colversion_skew.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ CREATE DATABASE cloudsync_test_04_c;
1919
CREATE EXTENSION IF NOT EXISTS cloudsync;
2020
DROP TABLE IF EXISTS smoke_tbl;
2121
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
22-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
22+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2323

2424
\connect cloudsync_test_04_b
2525
\ir helper_psql_conn_setup.sql
2626
CREATE EXTENSION IF NOT EXISTS cloudsync;
2727
DROP TABLE IF EXISTS smoke_tbl;
2828
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
29-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
29+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
3030

3131
\connect cloudsync_test_04_c
3232
\ir helper_psql_conn_setup.sql
3333
CREATE EXTENSION IF NOT EXISTS cloudsync;
3434
DROP TABLE IF EXISTS smoke_tbl;
3535
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
36-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
36+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
3737

3838
-- Round 1: seed id1 on a single database, then sync
3939
\connect cloudsync_test_04_a

test/postgresql/05_delete_recreate_cycle.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ CREATE DATABASE cloudsync_test_05_c;
2424
CREATE EXTENSION IF NOT EXISTS cloudsync;
2525
DROP TABLE IF EXISTS smoke_tbl;
2626
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
27-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
27+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2828

2929
\connect cloudsync_test_05_b
3030
\ir helper_psql_conn_setup.sql
3131
CREATE EXTENSION IF NOT EXISTS cloudsync;
3232
DROP TABLE IF EXISTS smoke_tbl;
3333
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
34-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
34+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
3535

3636
\connect cloudsync_test_05_c
3737
\ir helper_psql_conn_setup.sql
3838
CREATE EXTENSION IF NOT EXISTS cloudsync;
3939
DROP TABLE IF EXISTS smoke_tbl;
4040
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
41-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
41+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
4242

4343
-- Round 1: seed row on A, sync to B/C
4444
\connect cloudsync_test_05_a

test/postgresql/06_out_of_order_delivery.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ CREATE DATABASE cloudsync_test_06_c;
2121
CREATE EXTENSION IF NOT EXISTS cloudsync;
2222
DROP TABLE IF EXISTS smoke_tbl;
2323
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
24-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
24+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2525

2626
\connect cloudsync_test_06_b
2727
\ir helper_psql_conn_setup.sql
2828
CREATE EXTENSION IF NOT EXISTS cloudsync;
2929
DROP TABLE IF EXISTS smoke_tbl;
3030
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
31-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
31+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
3232

3333
\connect cloudsync_test_06_c
3434
\ir helper_psql_conn_setup.sql
3535
CREATE EXTENSION IF NOT EXISTS cloudsync;
3636
DROP TABLE IF EXISTS smoke_tbl;
3737
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
38-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
38+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
3939

4040
-- Round 1: seed row on A, sync to B/C
4141
\connect cloudsync_test_06_a

test/postgresql/07_delete_vs_update.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ CREATE DATABASE cloudsync_test_07_c;
2121
CREATE EXTENSION IF NOT EXISTS cloudsync;
2222
DROP TABLE IF EXISTS smoke_tbl;
2323
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
24-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
24+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2525

2626
\connect cloudsync_test_07_b
2727
\ir helper_psql_conn_setup.sql
2828
CREATE EXTENSION IF NOT EXISTS cloudsync;
2929
DROP TABLE IF EXISTS smoke_tbl;
3030
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
31-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
31+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
3232

3333
\connect cloudsync_test_07_c
3434
\ir helper_psql_conn_setup.sql
3535
CREATE EXTENSION IF NOT EXISTS cloudsync;
3636
DROP TABLE IF EXISTS smoke_tbl;
3737
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
38-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
38+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
3939

4040
-- Round 1: seed id1 on A, sync to B/C
4141
\connect cloudsync_test_07_a

test/postgresql/08_resurrect_delayed_delete.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ CREATE DATABASE cloudsync_test_08_c;
2323
CREATE EXTENSION IF NOT EXISTS cloudsync;
2424
DROP TABLE IF EXISTS smoke_tbl;
2525
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
26-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
26+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2727

2828
\connect cloudsync_test_08_b
2929
\ir helper_psql_conn_setup.sql
3030
CREATE EXTENSION IF NOT EXISTS cloudsync;
3131
DROP TABLE IF EXISTS smoke_tbl;
3232
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
33-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
33+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
3434

3535
\connect cloudsync_test_08_c
3636
\ir helper_psql_conn_setup.sql
3737
CREATE EXTENSION IF NOT EXISTS cloudsync;
3838
DROP TABLE IF EXISTS smoke_tbl;
3939
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
40-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
40+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
4141

4242
-- Round 1: seed id1 on A, sync to B/C
4343
\connect cloudsync_test_08_a

test/postgresql/09_multicol_concurrent_edits.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ CREATE DATABASE cloudsync_test_09_c;
2121
CREATE EXTENSION IF NOT EXISTS cloudsync;
2222
DROP TABLE IF EXISTS smoke_tbl;
2323
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, col_a TEXT, col_b TEXT);
24-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
24+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2525

2626
\connect cloudsync_test_09_b
2727
\ir helper_psql_conn_setup.sql
2828
CREATE EXTENSION IF NOT EXISTS cloudsync;
2929
DROP TABLE IF EXISTS smoke_tbl;
3030
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, col_a TEXT, col_b TEXT);
31-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
31+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
3232

3333
\connect cloudsync_test_09_c
3434
\ir helper_psql_conn_setup.sql
3535
CREATE EXTENSION IF NOT EXISTS cloudsync;
3636
DROP TABLE IF EXISTS smoke_tbl;
3737
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, col_a TEXT, col_b TEXT);
38-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
38+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
3939

4040
-- Round 1: seed row on A, sync to B/C
4141
\connect cloudsync_test_09_a

test/postgresql/10_empty_payload_noop.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ CREATE DATABASE cloudsync_test_10_c;
2121
CREATE EXTENSION IF NOT EXISTS cloudsync;
2222
DROP TABLE IF EXISTS smoke_tbl;
2323
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
24-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_a \gset
24+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_a \gset
2525

2626
\connect cloudsync_test_10_b
2727
\ir helper_psql_conn_setup.sql
2828
CREATE EXTENSION IF NOT EXISTS cloudsync;
2929
DROP TABLE IF EXISTS smoke_tbl;
3030
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
31-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_b \gset
31+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_b \gset
3232

3333
\connect cloudsync_test_10_c
3434
\ir helper_psql_conn_setup.sql
3535
CREATE EXTENSION IF NOT EXISTS cloudsync;
3636
DROP TABLE IF EXISTS smoke_tbl;
3737
CREATE TABLE smoke_tbl (id TEXT PRIMARY KEY, val TEXT);
38-
SELECT cloudsync_init('smoke_tbl', 'CLS', true) AS _init_site_id_c \gset
38+
SELECT cloudsync_init('smoke_tbl', 'CLS', 1) AS _init_site_id_c \gset
3939

4040
-- Seed a stable row so hashes are meaningful
4141
\connect cloudsync_test_10_a

0 commit comments

Comments
 (0)