Skip to content

feat(display-format): decode MessagePack and Protobuf, and swapped-time UUIDs - #3761

Merged
datlechin merged 4 commits into
mainfrom
feat/3607-binary-value-decoders
Oct 21, 2026
Merged

datlechin merged 4 commits into
mainfrom
feat/3607-binary-value-decoders

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Display As gains three formats for binary columns: UUID (Swapped Time), MessagePack and Protobuf.
  • UUID (Swapped Time) reads MySQL UUID_TO_BIN(uuid, 1) bytes as the UUID passed in. Generate UUID, Fill Column and new-row keys write that byte order back.
  • MessagePack decodes into the JSON tree with bin, ext and time badges. Protobuf, with no schema, decodes into field numbers badged by wire type, and a Confluent Schema Registry frame shows its schema ID.
  • The grid shows the decoded value on one line. Double-click opens a read-only viewer (Tree, Text, Hex), also in the row inspector and as a window. A value that does not decode stays hex and the viewer says where it broke. A NULL keeps the hex editor.
  • Single-cell copy and Find read the decoded text. SQL filters and highlight rules still read the stored bytes.
  • Single-cell copy skips a format the column no longer takes, as the cell already did.
  • PHP serialized viewer reads PHP 8.1 enum cases (E:), which failed the whole value before, and refuses a length near Int.max instead of trapping.
  • Tests pinned on purpose: ValueDisplayFormatTests blob and MongoDB format lists.

Not in this PR

  • igbinary. Three review rounds each found a new defect in it: a string-table reference repeated many times expands a small value into gigabytes, and an unwrapped ref8 to an array is a by-value copy, not R:. The decoder and its fixture tests are in commit 939136b for the follow-up.
  • Protobuf with a .proto file or descriptor set, Avro with a writer schema, and fetching either from a Schema Registry URL. Each needs a schema attached to a column: storage, file access, a connection field and an HTTP client.
  • Typing a UUID into a BINARY(16) cell. Neither UUID format has a typed path; binary cells edit as hex.
  • Kafka types a page's value column as TEXT when every payload is valid UTF-8, control bytes included (KafkaMessageFlattener.allDecodeAsText), so small Protobuf payloads land in a text column where Display As offers no Protobuf. Registry plugin.
  • CellValueContentDetector takes C:\path and d:\path text for PHP serialized, so the inspector opens a Windows path in the read-only PHP viewer.

Test plan

  • Decoders checked against fixtures from msgpack-python 1.1.0, protoc --encode 36.2 and MySQL 8.4 UUID_TO_BIN: MessagePackDecoderTests, ProtobufWireDecoderTests (output equals protoc --decode_raw), BinaryDisplayFormatTests.
  • CellInteractionResolverBinaryTests, FieldEditorResolverTests, InspectorEditPolicyTests, UUIDCellFormTests, RowCopyFormatTests, PhpSerializeParserSpecialTests.

Part of #3607

@datlechin
datlechin enabled auto-merge (squash) October 21, 2026 14:53
@datlechin
datlechin merged commit 616e3a0 into main Oct 21, 2026
8 checks passed
@datlechin
datlechin deleted the feat/3607-binary-value-decoders branch October 22, 2026 07:05
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