Skip to content

fix(schema): fix format mismatch in getObjectMetadata and getServerStats scalar queries - #68

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/57-fix-format-mismatch-scalar-queries
Sep 28, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/57-fix-format-mismatch-scalar-queries

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • handle_get_server_stats (SELECT version(), SELECT uptime()) and handle_get_object_metadata (SHOW CREATE TABLE) requested FORMAT JSONCompactEachRow, but were parsed with parse_compact_output, which requires FORMAT JSONCompactEachRowWithNamesAndTypes (names line + types line + data). Against a real server this always failed to parse, silently falling back to "ClickHouse" version, 0 uptime, and empty DDL.
  • Switched all three queries to FORMAT JSONCompactEachRowWithNamesAndTypes and updated the version/uptime network-error fallback strings to match the same 3-line shape.
  • Added a regression test (test_parse_compact_output_scalar_row) covering single-scalar-row parsing.

Closes #57

…ats scalar queries

handle_get_server_stats and handle_get_object_metadata requested
SELECT version(), SELECT uptime() and SHOW CREATE TABLE with FORMAT
JSONCompactEachRow (a single data line, no headers), then parsed the
response with parse_compact_output, which unconditionally expects
FORMAT JSONCompactEachRowWithNamesAndTypes (names line + types line +
data lines). Against a real ClickHouse server this always failed to
parse, silently falling back to "ClickHouse"/0/"" defaults.

Switch all three queries to FORMAT JSONCompactEachRowWithNamesAndTypes
so parse_compact_output can read them, and update the version/uptime
network-error fallbacks to the same shape. Closes #57
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 4b3a32a into dev Sep 28, 2026
2 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.

1 participant