Skip to content

SHOW WARNINGS with inline comments incorrectly sets warning_count #5306

@yuji-hatakeyama

Description

@yuji-hatakeyama

When using DBIx::Sunny (a Perl database interface),

SHOW WARNINGS queries are sent with inline comments like:

SHOW /* example.pl line 10 */ WARNINGS

This causes ProxySQL to incorrectly return warning_count in the EOF packet, because the current logic
doesn't strip comments before checking the query.

MyRS->add_eof(query.length == 13 && strncasecmp(query.ptr, "SHOW WARNINGS", 13) == 0);

Proposed fix: Use digest_text (which has comments stripped) instead of raw query, similar to the existing pattern at:

(dig_len != 13 || strncasecmp(dig_text, "SHOW WARNINGS", 13) != 0)) {

I have already prepared a fix for this issue and plan to submit a pull request soon.
I'm relatively new to this codebase, so please let me know if I've misunderstood anything.

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