Skip to content

test(regression): suite for session bugs (MariaDB type names, RowDisplayCache, PluginCellValue.asText)#1218

Merged
datlechin merged 1 commit into
mainfrom
test/regression-suite-session-bugs
May 11, 2026
Merged

test(regression): suite for session bugs (MariaDB type names, RowDisplayCache, PluginCellValue.asText)#1218
datlechin merged 1 commit into
mainfrom
test/regression-suite-session-bugs

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Regression tests covering the testable units fixed during the recent debugging session. Every test corresponds to a bug surfaced and fixed in a prior PR; the goal is to catch the same regression if anyone refactors these paths again.

Coverage map

Bug / PR Test suite What it pins
#1209 numeric rendered as hex (0x31 for 1) MariaDBFieldClassifierTests (existing) + new MariaDBTypeNameTests.numericTypes / decimalAndFloat / temporalTypes / miscTypes type code → name mapping for INT family, DECIMAL, FLOAT, DOUBLE, all temporals
#1209 numeric routing — field.charsetnr == 63 flagging non-binary types MariaDBFieldClassifierTests (existing) classifier returns false for numerics/temporals even with binary charset
#1217 BINARY/VARBINARY classified as text → data wipe on click MariaDBTypeNameTests.binaryWith* + varbinaryWith* + charWithout* case 253 → VARBINARY only when binary-flag set and charset is 63; case 254 → BINARY likewise; non-binary stays VARCHAR/CHAR
#1216 mariadb_field_attr JSON over-read (covered by MariaDBTypeNameTests.miscTypes checking type 245 → JSON; the over-read fix is in code paths that consult the function from mysqlTypeToString, which is integration-level) type 245 returns JSON (the JSON detection from extended metadata requires real MariaDB connector and is integration-tested only)
#1212 P0 #2 — drop NSCache + RowIDKey for Dictionary RowDisplayCacheTests (new) basic set/get, FIFO count eviction, cost-cap eviction, replace-same-key doesn't double-consume queue slot, removeAll resets state, mixed RowID.existing / RowID.inserted round-trip
#1217 .bytes.asText returning empty would have caused click-to-wipe PluginCellValueSortKeyTests.asText / bytesAsTextIsNil / nullAsText / asBytes (extended) enum-case → text/bytes mapping is pinned so the editor can rely on it

Refactor for testability

mysqlTypeToString(_:) previously took UnsafePointer<MYSQL_FIELD>, which can't be constructed without a live MariaDB result handle. Extracted the pure switch into a new mariaDBTypeName(typeRaw:flags:charsetnr:length:) -> String (internal). The MYSQL_FIELD-facing function now does the JSON mariadb_field_attr check and the ENUM/SET flag check at the C-struct level, then delegates the type-code switch to mariaDBTypeName. Tests call mariaDBTypeName directly with primitives.

What is NOT covered by these tests (and why)

Test plan

  • xcodebuild test -only-testing:TableProTests/MariaDBTypeNameTests — all pass.
  • xcodebuild test -only-testing:TableProTests/RowDisplayCacheTests — all pass.
  • xcodebuild test -only-testing:TableProTests/PluginCellValueSortKeyTests — all pass (including new asText / asBytes cases).
  • Full test suite still green: xcodebuild -project TablePro.xcodeproj -scheme TablePro test -skipPackagePluginValidation.
  • Verified locally: ** TEST SUCCEEDED ** on the four target suites.

… eviction, and PluginCellValue.asText contract
@datlechin datlechin merged commit 62b1474 into main May 11, 2026
2 checks passed
@datlechin datlechin deleted the test/regression-suite-session-bugs branch May 11, 2026 09:42
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