Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Bug: Mis-formatted error diagnostics for incorrect function use #665

@creachadair

Description

@creachadair

Repro:

$ srcd sql
mysql> select split("a,b", ",", 1);

Observed:

ERROR 1105 (HY000): unknown error: %!s(int=2): expecting 3 arguments for calling this function, %!d(MISSING) received

Expected:

  • Since it turns out that split only accepts two arguments, I would expect the diagnostic to report that 2 arguments are expected, not 3 (I assume the latter is because the implementation has a receiver or something hidden from the query API).

  • The error should not be classified as "unknown": It's either a syntax error or invalid parameters, but it is fully under the control of the CLI.

  • I expect the format strings to match their type, so that it says something like

    ERROR: split: expected 2 arguments, received 3.

    instead of having the auto-generated fallbacks from the fmt package like %!d(MISSING).

  • I expect the error string to mention the name of the function I got wrong. In this case it is obvious, but in a bigger query it would not be.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationThis is a documentation issue or pull request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy