Skip to content

Run Savor and Wayline on PostgreSQL and MySQL, and fix what they found - #6066

Merged
shai-almog merged 6 commits into
masterfrom
savor-postgres-schema
Oct 21, 2026
Merged

shai-almog merged 6 commits into
masterfrom
savor-postgres-schema

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Savor and Wayline did not start on PostgreSQL or MySQL. Every CI run stayed green, because the samples' server tests only ran on in-memory SQLite.

What was wrong

  • Mappings disagreed with migrations (PostgreSQL and MySQL). Since ORM: adopt existing schemas (native dates, schema report, private callbacks) #6036, the ORM's startup validateSchema refuses an undeclared String field on a VARCHAR(n) column and an int on a SMALLINT. A longer value would be rejected by PostgreSQL or strict MySQL, and silently truncated by permissive MySQL. Savor had 154 such fields and Wayline 101. SQLite ignores declared types, so the tests never saw it.
  • Text keys had the wrong collation (MySQL and MariaDB). Tables created by the migrations used MySQL's default utf8mb4_0900_ai_ci, and the ORM refuses a text key under a collation that folds case or pads.
  • MySQL refused the fix (framework bug). MySql sent every statement as a prepared statement, and MySQL will not prepare ALTER DATABASE (error 1295). Flyway, whose scripts these are, runs such statements as text.
  • A test bug PostgreSQL exposed. Each sample's PushTest had two tests putting a courier or driver at the same Reykjavik coordinates. Distances tied, and SQLite's insertion-order rows hid which one got the offer.
  • CI never ran the samples for the ORM change. Neither savor.yml nor wayline.yml listed CodenameOne/src/com/codename1/impl/orm/** in its paths filter, so ORM: adopt existing schemas (native dates, schema report, private callbacks) #6036 did not trigger them.

Changes

  • Entities: each affected field gets @Column(type = ...) matching its migration. The ORM's check is unchanged.
  • Migrations: a V0__collation.sql per sample. The MySQL version sets the database collation, /*!80000 utf8mb4_0900_bin */ /*M!100400 utf8mb4_nopad_bin */, and one file serves both server families. The SQLite and PostgreSQL versions are SELECT 1;, because every version needs a script for each engine.
  • MySql.runPrepared: a statement the server refuses to prepare (1295) that binds no parameters and returns no rows is sent through COM_QUERY instead. Nothing ran at that point, and with no parameters nothing can be spliced into the text.
  • DbCheck: checks that such a statement runs. It passes 35/35 on MySQL 8 and MariaDB 10.11.
  • PushTest: the second test moved to a city of its own (Edinburgh).
  • scripts/ci/sample-server-tests-on-database.sh: runs a sample's server tests against a postgres:// or mysql:// database, emptying the schema before each test class. The tests assume the fresh database an in-memory SQLite gives every class.
  • Workflows: a backend-database matrix job (postgresql, mysql) in savor.yml and wayline.yml. MySQL is the runner's own 8.0 with a mysql_native_password user: a service container cannot take server options, and 8.4 turns that plugin off. The ORM, annotations, SQL-client and script paths are added to both filters.
  • Developer guide: Backend-Data.asciidoc explains the MySQL collation script.
  • Initializr templates: re-synced.

Verified locally

SQLite PostgreSQL 16 MySQL 8 MariaDB 10.11
Savor 126/126 20/20 classes 20/20 classes 20/20 classes
Wayline 108/108 19/19 classes 19/19 classes not run

🤖 Generated with Claude Code

The samples' server tests only ran on in-memory SQLite, which accepts any
declared column type and has no collations, so neither sample started on a
real database while CI stayed green.

- Entities declare the column type their migration uses (VARCHAR(n),
  SMALLINT), which the ORM's schema validation requires since #6036.
- A V0 migration gives MySQL/MariaDB a case-sensitive NO PAD collation
  before any table exists; the other engines get a no-op script.
- MySql sends a parameterless statement the server refuses to prepare
  (error 1295, e.g. ALTER DATABASE) as text, as Flyway would.
- PushTest no longer puts two couriers/drivers at the same point.
- New backend-database CI job (postgresql, mysql) for both samples, and
  the ORM paths added to their workflow filters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T08:52:59.533641Z f46d63c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b620137d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/savor/backend/src/main/resources/db/migration/mysql/V0__collation.sql Outdated
Comment thread scripts/ci/sample-server-tests-on-database.sh Outdated
A V0 script would never reach a deployment that already applied the later
versions (out-of-order migrations are refused), and changing the database
default alone leaves existing tables on the old collation. Savor's V10 and
Wayline's V8 now set the default and convert every table. The database test
helper also defaults the MySQL port to 3306 when the URL omits it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a27b0cbd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ci/sample-server-tests-on-database.sh Outdated
Comment thread vm/backend/src/com/codename1/backend/sql/MySql.java Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Windows port, REAL shipping pipeline: the hellocodenameone screenshot suite rendered by a binary CROSS-COMPILED on Linux (clang-cl + xwin, WebView2 linked) and RUN on a Windows x64 runner. Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 58ms / native 5ms = 11.6x speedup
SIMD float-mul (64K x300) java 60ms / native 4ms = 15.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 72.000 ms
Base64 CN1 decode 100.000 ms
Base64 SIMD encode 135.000 ms
Base64 encode ratio (SIMD/CN1) 1.875x (87.5% slower)
Base64 SIMD decode 126.000 ms
Base64 decode ratio (SIMD/CN1) 1.260x (26.0% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 5.000 ms
Image createMask ratio (SIMD on/off) 0.625x (37.5% faster)
Image applyMask (SIMD off) 36.000 ms
Image applyMask (SIMD on) 32.000 ms
Image applyMask ratio (SIMD on/off) 0.889x (11.1% faster)
Image modifyAlpha (SIMD off) 31.000 ms
Image modifyAlpha (SIMD on) 23.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.742x (25.8% faster)
Image modifyAlpha removeColor (SIMD off) 65.000 ms
Image modifyAlpha removeColor (SIMD on) 24.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.369x (63.1% faster)

@shai-almog

shai-almog commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 matched.
✅ JavaScript-port screenshot tests passed.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ✅ ByteCodeTranslator: 0 findings (no issues)
    • ✅ android: 0 findings (no issues)
    • ✅ android-compat: 0 findings (no issues)
    • ✅ android-res-compiler: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ backend-test: 0 findings (no issues)
    • ✅ build-engine: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-gradle-plugin: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ project-model: 0 findings (no issues)
  • ✅ PMD: 0 findings (no issues) [Report archive]
  • ✅ Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog

shai-almog commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Windows port (x64 / Intel-AMD): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, SSE2 SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 52ms / native 4ms = 13.0x speedup
SIMD float-mul (64K x300) java 54ms / native 4ms = 13.5x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 68.000 ms
Base64 CN1 decode 83.000 ms
Base64 SIMD encode 96.000 ms
Base64 encode ratio (SIMD/CN1) 1.412x (41.2% slower)
Base64 SIMD decode 91.000 ms
Base64 decode ratio (SIMD/CN1) 1.096x (9.6% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 16.000 ms
Image createMask (SIMD on) 8.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 46.000 ms
Image applyMask (SIMD on) 37.000 ms
Image applyMask ratio (SIMD on/off) 0.804x (19.6% faster)
Image modifyAlpha (SIMD off) 123.000 ms
Image modifyAlpha (SIMD on) 25.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.203x (79.7% faster)
Image modifyAlpha removeColor (SIMD off) 47.000 ms
Image modifyAlpha removeColor (SIMD on) 27.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.574x (42.6% faster)

ParparVM vs HotSpot (JDK 25): Windows x64

Runner CPU: Intel64 Family 6 Model 207 Stepping 2, GenuineIntel (baseline windows-x64@intel64-family-6-model-207-genuineintel)

1 performance regression:

  • translator (self) on all 4 CPUs: time 0.75x against a 0.59x baseline (+26.3%, tolerance 20%)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.17x (base 1.07x, +9.8%) 0.70x (base 0.86x, -18.3%) ok
translator (self) 4 0.75x (base 0.59x, +26.3%) 0.50x (base 0.53x, -4.7%) REGRESSION (time +26.3%)
intArithmetic 4 1.03x (base 1.02x, +0.1%) 0.06x (base 0.06x, -1.1%) ok
longArithmetic 4 0.96x (base 0.97x, -0.7%) 0.05x (base 0.05x, +0.3%) ok
mathTranscendental 4 0.89x (base 0.89x, +0.1%) 0.06x (base 0.06x, -0.3%) ok
arraySequential 4 1.93x (base 1.98x, -2.7%) 0.38x (base 0.38x, +0.2%) ok
arrayRandom 4 1.01x (base 1.01x, -0.1%) 0.23x (base 0.23x, +0.0%) ok
objectAllocation 4 1.26x (base 1.22x, +3.2%) 0.33x (base 0.37x, -11.5%) ok
valueEscape 4 0.13x (base 0.13x, +1.9%) 0.04x (base 0.04x, -0.2%) ok
hashMapChurn 4 1.16x (base 1.14x, +1.8%) 0.09x (base 0.10x, -3.9%) ok
stringBuilding 4 1.49x (base 1.42x, +5.3%) 0.27x (base 0.22x, +20.2%) ok
recursion 4 1.20x (base 1.20x, -0.0%) 0.06x (base 0.06x, +0.1%) ok
quicksort 4 1.06x (base 1.07x, -0.5%) 0.12x (base 0.12x, +0.1%) ok

A change that moves performance ON PURPOSE records the new baseline in vm/selfhost/perf-baseline/pr/6066.json, with the reason, from this job's perf-results.json. The rebaseline is then part of this pull request's diff:

python3 vm/selfhost/calibrate-perf-baseline.py --pr 6066 --reason "<why these benchmarks moved>" perf-results.json

Result: performance regression

@shai-almog

shai-almog commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Linux port (x64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub x64 runner. Baseline: scripts/linux/screenshots.

ParparVM vs HotSpot (JDK 25): Linux x64

Runner CPU: AMD EPYC 9V74 80-Core Processor (baseline linux-x64@amd-epyc-9v74-80-core-processor)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 0.92x (base 0.90x, +3.0%) 0.79x (base 0.96x, -17.2%) ok
translator (self) 4 0.58x (base 0.63x, -8.2%) 0.48x (base 0.46x, +2.8%) ok
intArithmetic 4 1.10x (base 1.10x, -0.0%) 0.07x (base 0.06x, +31.0%) ok
longArithmetic 4 1.08x (base 1.08x, +0.0%) 0.05x (base 0.06x, -1.8%) ok
mathTranscendental 4 1.09x (base 1.09x, -0.2%) 0.08x (base 0.07x, +15.4%) ok
arraySequential 4 2.67x (base 2.81x, -4.9%) 0.36x (base 0.35x, +0.4%) ok
arrayRandom 4 1.06x (base 1.02x, +3.1%) 0.21x (base 0.21x, -1.4%) ok
objectAllocation 4 1.21x (base 1.21x, +0.6%) 0.30x (base 0.39x, -21.9%) ok
valueEscape 4 0.10x (base 0.10x, +0.0%) 0.04x (base 0.06x, -23.2%) ok
hashMapChurn 4 1.06x (base 1.10x, -3.0%) 0.11x (base 0.10x, +5.4%) ok
stringBuilding 4 1.51x (base 1.49x, +1.5%) 0.26x (base 0.26x, +0.2%) ok
recursion 4 1.14x (base 1.24x, -8.6%) 0.08x (base 0.06x, +35.9%) ok
quicksort 4 1.09x (base 1.07x, +1.9%) 0.11x (base 0.11x, -0.4%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Linux port (arm64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub arm64 runner. Baseline: scripts/linux/screenshots-arm.

ParparVM vs HotSpot (JDK 25): Linux arm64

Runner CPU: Neoverse-N2 (baseline linux-arm64@neoverse-n2)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 0.97x (base 1.02x, -5.4%) 0.75x (base 0.93x, -19.2%) ok
translator (self) 4 0.73x (base 0.70x, +3.9%) 0.46x (base 0.51x, -10.0%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.03x (base 0.03x, -3.8%) ok
longArithmetic 4 0.79x (base 0.79x, -0.3%) 0.03x (base 0.03x, -3.0%) ok
mathTranscendental 4 1.10x (base 1.10x, -0.0%) 0.03x (base 0.03x, -0.4%) ok
arraySequential 4 0.37x (base 0.36x, +2.4%) 0.37x (base 0.37x, +0.1%) ok
arrayRandom 4 0.94x (base 0.94x, -0.0%) 0.20x (base 0.20x, -0.7%) ok
objectAllocation 4 1.90x (base 1.77x, +7.4%) 0.36x (base 0.38x, -4.7%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, +0.1%) ok
hashMapChurn 4 0.86x (base 0.84x, +2.0%) 0.11x (base 0.12x, -6.9%) ok
stringBuilding 4 1.39x (base 1.57x, -11.1%) 0.26x (base 0.26x, -0.4%) ok
recursion 4 1.42x (base 1.43x, -1.2%) 0.03x (base 0.04x, -2.7%) ok
quicksort 4 1.00x (base 0.99x, +0.6%) 0.09x (base 0.09x, +0.7%) ok

Result: no regression

…s, parse reset URLs fully

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc9c97128c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ci/sample-server-tests-on-database.sh Outdated
Comment thread scripts/ci/sample-server-tests-on-database.sh Outdated
Comment thread vm/backend/src/com/codename1/backend/sql/MySql.java Outdated
… reset, hyphenate case-sensitive

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49d2dc0622

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ci/sample-server-tests-on-database.sh Outdated
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f46d63c8f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

fi
case "$URL" in
postgres://*|postgresql://*)
psql "$URL" -q -v ON_ERROR_STOP=1 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve PostgreSQL's verified TLS semantics

When a remote PostgreSQL test URL uses the backend's default prefer or sslmode=require, passing it unchanged to psql weakens the connection policy before executing DROP SCHEMA: this backend verifies the certificate and hostname and refuses verification failures, whereas libpq documents that prefer can fall back to plaintext and that only verify-full verifies both the CA and hostname (PostgreSQL connection documentation). Translate the backend modes to equivalent libpq settings so the reset cannot expose credentials or run destructive SQL against an endpoint the server would reject.

Useful? React with 👍 / 👎.

fi
case "$URL" in
postgres://*|postgresql://*)
psql "$URL" -q -v ON_ERROR_STOP=1 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize backend-only options before invoking psql

When CN1_TEST_DATABASE_URL contains options accepted by Database.Url, such as connectTimeout, socketTimeout, or the sslca alias, this direct psql invocation rejects the otherwise valid backend URL before any tests run. Libpq requires every URI parameter to match one of its own keywords and, for example, spells its timeout connect_timeout in seconds (PostgreSQL URI documentation); parse and translate or remove backend-only parameters before passing the URL to psql.

Useful? React with 👍 / 👎.

parts="$(python3 -c '
import sys, urllib.parse as u
p = u.urlsplit(sys.argv[1])
q = dict(u.parse_qsl(p.query))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Decode MySQL query overrides like the backend

The current override fix uses parse_qsl, whose form semantics turn a literal + into a space and drop blank values by default, while Database.Url.applyQuery performs percent-decoding only and accepts empty overrides. Thus a valid URL such as ...?password=a+b or ...?password= makes the reset authenticate differently from the server, potentially failing the test run or issuing the destructive reset under the authority credentials; parse these values with the backend's percent-only semantics instead.

Useful? React with 👍 / 👎.

@shai-almog
shai-almog merged commit 1317202 into master Oct 21, 2026
77 of 82 checks passed
@shai-almog
shai-almog deleted the savor-postgres-schema branch October 21, 2026 10:12
@github-actions

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 833 total, 0 failed, 57 skipped

Benchmark Results

  • Execution Time: 9621 ms

  • Hotspots (Top 20 sampled methods):

    • 8.59% com.codename1.tools.translator.IteratorEscape.ctorOnlyStoresParamsIntoThis (124 samples)
    • 8.45% com.codename1.tools.translator.BytecodeMethod.equals (122 samples)
    • 5.68% java.lang.System.identityHashCode (82 samples)
    • 5.47% java.lang.Object.hashCode (79 samples)
    • 3.67% com.codename1.tools.translator.classfile.analysis.Frame.execute (53 samples)
    • 2.77% java.io.FileOutputStream.writeBytes (40 samples)
    • 2.43% java.util.ArrayList.indexOf (35 samples)
    • 2.36% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (34 samples)
    • 2.01% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (29 samples)
    • 1.87% java.lang.StringBuilder.append (27 samples)
    • 1.73% com.codename1.tools.translator.IteratorEscape.mangle (25 samples)
    • 1.59% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (23 samples)
    • 1.59% com.codename1.tools.translator.Parser.cullMethods (23 samples)
    • 1.59% java.lang.String.equals (23 samples)
    • 1.59% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (23 samples)
    • 1.59% java.util.HashMap.hash (23 samples)
    • 1.52% com.codename1.tools.translator.ReachabilityCull.run (22 samples)
    • 1.46% com.codename1.tools.translator.NativeSymbolIndex.<init> (21 samples)
    • 1.46% java.util.AbstractCollection.containsAll (21 samples)
    • 1.18% java.io.FileInputStream.open0 (17 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant