Skip to content

[possible degradation] UTF-8 string is now printed in 0x hex form in some cases. #1511

@your-diary

Description

@your-diary

How to Reproduce

CREATE TABLE t (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    encrypted_email VARCHAR(2048) NOT NULL
);

SET
    @encryption_key = 'my_secret_key';

INSERT INTO
    t (encrypted_email)
VALUES
    (
        HEX(AES_ENCRYPT('foo@example.com', @encryption_key))
    );

SELECT
    AES_DECRYPT(UNHEX(encrypted_email), @encryption_key) AS email
FROM
    t;

Expected:

I'm 100% sure I used to get this result until recently:

+-----------------+
| email           |
+-----------------+
| foo@example.com |
+-----------------+

Actual:

+----------------------------------+
| email                            |
+----------------------------------+
| 0x666f6f406578616d706c652e636f6d |
+----------------------------------+

Possible Cause?

The changelog of 1.48.0 (2026/01/27) says

  • Use 0x-style hex literals for binaries in SQL output formats.

  • Render binary values more consistently as hex literals.

Are these related?

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