Commit 174c5bd
committed
test: expand zstd_compression_level test with MySQL 8.4 C API and timing benchmark
The existing test only verified admin variable behavior (default, range,
independence). It did not prove that ZSTD compression was actually
active on the wire. Two new test variants address this:
MariaDB connector path (mysql-zstd_compression_level-t):
- Tests 1-9: unchanged (variable defaults, range validation, independence)
- Tests 10-11: use mysql CLI via execvp with --compression-algorithms=zstd
and --zstd-compression-level={3,19}. Each call spawns a new process
(= new connection). Verifies CONNECTION_ID() retrieval and large
resultset transfer. Skipped if mysql CLI lacks zstd support.
MySQL 8.4 connector path (mysql-zstd_compression_level_libmysql-t):
- Tests 1-9: same as MariaDB path
- Test 10: establishes a ZSTD connection using mysql_options(
MYSQL_OPT_COMPRESSION_ALGORITHMS, "zstd") and prints mysql_thread_id()
without running any query.
- Test 11: timing benchmark proving compression is active. Creates a
query rule (rule_id=1, cache_ttl=60000) to cache all SELECTs, then
runs a 576-row resultset query 1000 times on a plain connection and
1000 times on a ZSTD level 22 connection. ZSTD level 22 is extremely
CPU-intensive: observed 40122ms vs 858ms (46.7x ratio). A ratio >= 3x
proves compression is really running on the client<->ProxySQL link.
Other changes:
- MySQL_Protocol.cpp: simplify redundant clamping to a simple cast
(the variable is already validated at SET time)
- Makefile: add build rule for _libmysql variant linking against
MySQL 8.4 connector
- groups.json: register _libmysql variant for mysql84/90/95-g1
- CLAUDE.md: update testing section with CI script usage and DO NOT list1 parent f9f6f74 commit 174c5bd
5 files changed
Lines changed: 310 additions & 32 deletions
File tree
- lib
- test/tap
- groups
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
72 | 87 | | |
73 | 88 | | |
| 89 | + | |
| 90 | + | |
74 | 91 | | |
75 | 92 | | |
76 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2300 | 2300 | | |
2301 | 2301 | | |
2302 | 2302 | | |
2303 | | - | |
| 2303 | + | |
2304 | 2304 | | |
2305 | 2305 | | |
2306 | 2306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
| |||
0 commit comments