Skip to content

turnloop-mysql: types::decode cannot express the mysql2 wire policy (DATETIME truncation, TIME/BIT/GEOMETRY collapse) #68

Description

@proggeramlug

Problem

types::decode cannot express the wire-level decoding policy the mysql2 npm package actually implements. Two concrete gaps: there is no option to truncate a DATETIME column's sub-second part the way mysql2 does, and because MySQL reports character_set == 63 (binary) for every non-string column type, TIME, BIT and GEOMETRY all collapse into the same generic Buffer arm with no way to tell them apart by type.

Why it matters

This gap is wide enough that Perry's P7 lane's own report says plainly: "This binding ended up not using decode at all" — the crate's decoding path was not usable for turnloop-mysql's actual consumer (mysql2 parity), so the binding bypassed it and implemented its own decoding instead.

What would fix it

Either a MySQL-column-type-aware decode path that keeps TIME/BIT/GEOMETRY distinguishable instead of collapsing them via character_set, plus an option controlling DATETIME sub-second truncation — or, at minimum, exposing enough raw column-type metadata alongside the decoded value that a host can implement mysql2's specific policy without reimplementing decoding wholesale.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions