Skip to content

Mysql test#496

Merged
invaliduser merged 20 commits intomainfrom
mysql-test
Nov 4, 2025
Merged

Mysql test#496
invaliduser merged 20 commits intomainfrom
mysql-test

Conversation

@invaliduser
Copy link
Copy Markdown
Contributor

@invaliduser invaliduser commented Oct 28, 2025

  • expands test matrix to MySQL 8.0.44, 8.4, 9.5.0
  • updates Makefile for MySQL (exe, appropriate test commands)
  • adds bin/run_mysql.sh (do we want this?)
  • adds dev-resources/mysql/docker-compose.yml
  • updates docs
  • adds test-mysql profile in config.edn
  • unified json_extract implementation that works in both MySQL and MariaDB
  • moved reaction triggering outside of transaction (see here)
  • reduces precision requirement in certain tests b/c MySQL's JSON implementation can't handle past 15 digits (see here)
  • adds MySQL testing infra (container creation, fixture, etc)

@invaliduser invaliduser marked this pull request as ready for review October 28, 2025 16:15
- test-mysql-8.0.44
- test-mysql-8.4
- test-mysql-9.5.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See https://hub.docker.com/_/mysql/ for available versions

volumes:
- db_data:/var/lib/postgresql/data
- db_data:/var/lib/postgresql
environment:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PG threw an error when I tried to run it as such; apparently versions of PG 18+ want to store their data in /var/lib/postgresql/$MAJOR_VERSION

(snip-json-extract-numeric params)
(#{:string :json} datatype)
(snip-json-extract-string params))))
(-snip-val [_ params]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

bool is actually int under the hood in sql, which is why it's "numeric"


-- :snip snip-json-extract-string
JSON_UNQUOTE(JSON_EXTRACT(:i:col, :sql:path-str))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the +0 is to force a numeric cast

(doseq [stmt-id @triggers-to-offer]
(react-init/offer-trigger! reaction-channel stmt-id))
result))
(-get-statements
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

rather than triggering reactions immediately after insertion, stores statement ids and sends them to reaction channel if and only if transaction completes. If transaction does not complete, rolls back all statements in transaction, and sends no ids to reaction channel. Atom is local to the fn and is garbage collected once fn returns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(updated to use return value rather than atom)

(let [before (count (str (int (Math/floor v)) ))]
(trunc v (- 15 before)))
v)))))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

truncates test data to 15 significant digits. This is necessary b/c MySQL can't handle more than that in JSON.

Copy link
Copy Markdown
Member

@cliffcaseyyet cliffcaseyyet left a comment

Choose a reason for hiding this comment

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

Some small comments. Also obviously the bigger thing from standup.

Copy link
Copy Markdown
Member

@milt milt left a comment

Choose a reason for hiding this comment

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

Pending some documentation stuff (see comments) this is looking good

Copy link
Copy Markdown
Member

@cliffcaseyyet cliffcaseyyet left a comment

Choose a reason for hiding this comment

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

good by me. wait for @milt to approve before you merge.

@invaliduser invaliduser merged commit a121cba into main Nov 4, 2025
22 checks passed
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.

3 participants