Skip to content
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
10 changes: 0 additions & 10 deletions .github/workflows/clojure-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,6 @@ jobs:
make_target: mysql-v3
needs_f1db: true

# ── MySQL 5.7 (amd64 only via Rosetta emulation) ───────────────────
- suite: mysql57
pgloader: v4
make_target: mysql57
needs_f1db: true
- suite: mysql57
pgloader: v3
make_target: mysql57-v3
needs_f1db: true

# ── MariaDB ────────────────────────────────────────────────────────
- suite: mariadb
pgloader: v4
Expand Down
11 changes: 7 additions & 4 deletions clojure/tests/mariadb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ mysql-unit-full:
java -jar $(JAR) mysql-unit-full/mysql-unit-full.load
java -jar $(JAR) regress $(REGRESS_FLAGS) --variant mariadb mysql-unit-full

# all-v3 explicitly excludes mysql-unit-full: it tests v4-specific behaviour
# and has no meaningful v3 equivalent. The @: recipe prevents the %-v3
# catch-all from appending its own recipe (make all PGLOADER_CMD=pgloader).
all-v3: my-v3 sakila-v3 f1db-v3
# mysql-unit-full-v3: same suite against the v3 binary on MariaDB, compared
# against .v3.mariadb variant expected files.
mysql-unit-full-v3:
pgloader --client-min-messages notice mysql-unit-full/mysql-unit-full.load
java -jar $(JAR) regress --variant v3.mariadb mysql-unit-full

all-v3: my-v3 sakila-v3 f1db-v3 mysql-unit-full-v3
@:

%-v3:
Expand Down
10 changes: 10 additions & 0 deletions clojure/tests/mysql-unit-full/expected/01-tables.v3.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table_name
----------------
bit_defaults
hex_binary
on_update_ts
salary_check
set_column
type_precision
(6 rows)

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
column_name | data_type | datetime_precision | column_default
-------------+--------------------------+--------------------+--------------------------------------------
id | bigint | | nextval('type_precision_id_seq'::regclass)
ts6 | timestamp with time zone | 6 | CURRENT_TIMESTAMP
ts3 | timestamp with time zone | 3 | NULL::timestamp with time zone
t3 | time without time zone | 3 | NULL::time without time zone
plain_ts | timestamp with time zone | 6 | CURRENT_TIMESTAMP
(5 rows)

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
column_name | data_type | datetime_precision | column_default
-------------+--------------------------+--------------------+--------------------------------------------
id | integer | | nextval('type_precision_id_seq'::regclass)
ts6 | timestamp with time zone | 6 | CURRENT_TIMESTAMP
ts3 | timestamp with time zone | 3 |
t3 | time without time zone | 3 |
plain_ts | timestamp with time zone | 6 | CURRENT_TIMESTAMP
(5 rows)

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
column_name | data_type | column_default
-------------+--------------------------+------------------------------------------
id | bigint | nextval('bit_defaults_id_seq'::regclass)
flags | bit | '0'::"bit"
single_bit | boolean |
created_at | timestamp with time zone | CURRENT_TIMESTAMP
(4 rows)

8 changes: 8 additions & 0 deletions clojure/tests/mysql-unit-full/expected/03-bit-defaults.v3.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
column_name | data_type | column_default
-------------+--------------------------+------------------------------------------
id | integer | nextval('bit_defaults_id_seq'::regclass)
flags | bit | '0'::"bit"
single_bit | boolean |
created_at | timestamp with time zone | CURRENT_TIMESTAMP
(4 rows)

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
constraint_name | check_clause
---------------------+---------------------------------------
chk_age_range | CHECK (((age >= 18) AND (age <= 99)))
chk_salary_positive | CHECK ((salary > (0)::numeric))
(2 rows)

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
trigger_name | event_manipulation | action_timing
-----------------------------+--------------------+---------------
on_update_current_timestamp | UPDATE | BEFORE
(1 row)

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
trigger_name | event_manipulation | action_timing
-----------------------------+--------------------+---------------
on_update_current_timestamp | UPDATE | BEFORE
(1 row)

7 changes: 7 additions & 0 deletions clojure/tests/mysql-unit-full/expected/06-hex-to-bytea.v3.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
label | raw_hex
----------+------------
plain | \xdeadbeef
prefixed | \xcafebabe
empty | \x
(3 rows)

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
column_name | data_type | udt_name
-------------+-----------+-------------------
id | bigint | int8
perms | ARRAY | _set_column_perms
(2 rows)

id | perms
----+----------------------
1 | {read}
2 | {read,write}
3 | {read,write,execute}
(3 rows)

26 changes: 9 additions & 17 deletions clojure/tests/mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@ RUN unzip /tmp/sakila-db.zip -d /tmp/ \
# Download with: test/mysql/download-f1db.sh
COPY test/data/f1db.sql /docker-entrypoint-initdb.d/f1db.sql

# === pgloader test schemas (from test/mysql/) ===
COPY test/mysql/my.sql /docker-entrypoint-initdb.d/my.sql
COPY test/mysql/history.sql /docker-entrypoint-initdb.d/history.sql

# === db789 materialized views schema (from test/mysql/) ===
COPY test/mysql/db789.sql /docker-entrypoint-initdb.d/db789.sql

# === pgloader integration test seed (source + source2 databases) ===
COPY clojure/tests/mysql/data/seed.sql /docker-entrypoint-initdb.d/seed.sql
COPY test/mysql/db789.sql /docker-entrypoint-initdb.d/db789.sql

# === mysql-unit-full test schema (pgloader_mysql_unit_full database) ===
COPY clojure/tests/mysql-unit-full/mysql-unit-full.sql /docker-entrypoint-initdb.d/mysql-unit-full.sql
# === Unified pgloader_mytest test schema ===
# Combines: legacy "my" + "history" tables, former source/source2 tables,
# and the mysql-unit-full feature tests. See mytest/mytest.sql for details.
COPY clojure/tests/mysql/mytest/mytest.sql /docker-entrypoint-initdb.d/mytest.sql

# === Init script ===
# .sql files renamed to .tmpl to prevent MySQL auto-running them.
Expand All @@ -35,10 +30,7 @@ COPY clojure/tests/mysql/data/load-datasets.sh /docker-entrypoint-initdb.d/load-

RUN chmod +x /docker-entrypoint-initdb.d/load-datasets.sh \
&& mv /docker-entrypoint-initdb.d/sakila-schema.sql /docker-entrypoint-initdb.d/sakila-schema.tmpl \
&& mv /docker-entrypoint-initdb.d/sakila-data.sql /docker-entrypoint-initdb.d/sakila-data.tmpl \
&& mv /docker-entrypoint-initdb.d/f1db.sql /docker-entrypoint-initdb.d/f1db.tmpl \
&& mv /docker-entrypoint-initdb.d/my.sql /docker-entrypoint-initdb.d/my.tmpl \
&& mv /docker-entrypoint-initdb.d/history.sql /docker-entrypoint-initdb.d/history.tmpl \
&& mv /docker-entrypoint-initdb.d/db789.sql /docker-entrypoint-initdb.d/db789.tmpl \
&& mv /docker-entrypoint-initdb.d/seed.sql /docker-entrypoint-initdb.d/seed.tmpl \
&& mv /docker-entrypoint-initdb.d/mysql-unit-full.sql /docker-entrypoint-initdb.d/mysql-unit-full.tmpl
&& mv /docker-entrypoint-initdb.d/sakila-data.sql /docker-entrypoint-initdb.d/sakila-data.tmpl \
&& mv /docker-entrypoint-initdb.d/f1db.sql /docker-entrypoint-initdb.d/f1db.tmpl \
&& mv /docker-entrypoint-initdb.d/db789.sql /docker-entrypoint-initdb.d/db789.tmpl \
&& mv /docker-entrypoint-initdb.d/mytest.sql /docker-entrypoint-initdb.d/mytest.tmpl
30 changes: 12 additions & 18 deletions clojure/tests/mysql/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ JAR ?= /pgloader.jar
PGLOADER_CMD ?= java -jar $(JAR)
REGRESS_FLAGS ?=

.PHONY: all my sakila f1db source mysql-unit-full
.PHONY: all mytest sakila f1db source mytest-v3

all: my sakila f1db source mysql-unit-full
all: mytest sakila f1db

my:
$(PGLOADER_CMD) my/my.load
java -jar $(JAR) regress $(REGRESS_FLAGS) my
mytest:
$(PGLOADER_CMD) mytest/mytest.load
java -jar $(JAR) regress $(REGRESS_FLAGS) mytest

sakila:
$(PGLOADER_CMD) sakila/sakila.load
Expand All @@ -18,20 +18,14 @@ f1db:
$(PGLOADER_CMD) f1db/f1db.load
java -jar $(JAR) regress $(REGRESS_FLAGS) f1db

source:
$(PGLOADER_CMD) source/source.load
java -jar $(JAR) regress $(REGRESS_FLAGS) source
# mytest-v3: same suite against the v3 binary, compared against
# .v3 variant expected files that capture deliberate v3 vs v4 differences
# (serial vs identity, bit vs bit varying, trigger naming).
mytest-v3:
pgloader --client-min-messages notice mytest/mytest.load
java -jar $(JAR) regress --variant v3 mytest

# mysql-unit-full: full v4 regression suite, always run with the v4 JAR.
# Never uses $(PGLOADER_CMD) so it runs with v4 even in mixed environments.
mysql-unit-full:
java -jar $(JAR) mysql-unit-full/mysql-unit-full.load
java -jar $(JAR) regress $(REGRESS_FLAGS) mysql-unit-full

# all-v3 explicitly excludes mysql-unit-full: it tests v4-specific behaviour
# and has no meaningful v3 equivalent. The @: recipe prevents the %-v3
# catch-all from appending its own recipe (make all PGLOADER_CMD=pgloader).
all-v3: my-v3 sakila-v3 f1db-v3 source-v3
all-v3: mytest-v3 sakila-v3 f1db-v3
@:

%-v3:
Expand Down
26 changes: 13 additions & 13 deletions clojure/tests/mysql/data/load-datasets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ echo "=== Loading F1DB dataset (14 tables) ==="
mysql -u root -p"$MYSQL_ROOT_PASSWORD" < /docker-entrypoint-initdb.d/f1db.tmpl
echo "F1DB loaded successfully"

echo "=== Loading pgloader test schemas (my, history) ==="
mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "CREATE DATABASE IF NOT EXISTS pgloader"
mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "SET GLOBAL sql_mode=''" pgloader
mysql -u root -p"$MYSQL_ROOT_PASSWORD" pgloader < /docker-entrypoint-initdb.d/my.tmpl
mysql -u root -p"$MYSQL_ROOT_PASSWORD" pgloader < /docker-entrypoint-initdb.d/history.tmpl
echo "pgloader test schemas loaded successfully"

echo "=== Loading db789 materialized views schema ==="
mysql -u root -p"$MYSQL_ROOT_PASSWORD" < /docker-entrypoint-initdb.d/db789.tmpl
echo "db789 loaded successfully"

echo "=== Loading pgloader integration seed (source, source2) ==="
mysql -u root -p"$MYSQL_ROOT_PASSWORD" < /docker-entrypoint-initdb.d/seed.tmpl
echo "Seed loaded successfully"
echo "=== Loading pgloader_mytest unified test schema ==="
# Disable strict mode for the session so legacy zero-date values are accepted.
mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "SET GLOBAL sql_mode=''"
mysql -u root -p"$MYSQL_ROOT_PASSWORD" < /docker-entrypoint-initdb.d/mytest.tmpl
echo "pgloader_mytest loaded successfully"

echo "=== Loading mysql-unit-full test schema (pgloader_mysql_unit_full) ==="
mysql -u root -p"$MYSQL_ROOT_PASSWORD" < /docker-entrypoint-initdb.d/mysql-unit-full.tmpl
echo "mysql-unit-full test schema loaded successfully"
# NOTE — qmynd authentication (pgloader v3 / Common Lisp):
# MySQL 8 defaults to caching_sha2_password, which qmynd does not support.
# This container starts with --default-authentication-plugin=mysql_native_password
# (see docker-compose.yml) so the pgloader user is already compatible.
# If you're running against a plain MySQL 8 without that flag, run:
#
# ALTER USER 'pgloader'@'%' IDENTIFIED WITH mysql_native_password BY 'pgloader';
# FLUSH PRIVILEGES;
111 changes: 0 additions & 111 deletions clojure/tests/mysql/data/seed.sql

This file was deleted.

Loading
Loading