Skip to content

Go panic on SQL query #615

@campoy

Description

@campoy

This seems like a fun one, when you compare a list to a string you get this cool panic:

Query Failed - unknown error: unable to cast []interface {}{"DirectoryOfThisScript", "MakeRelativePathsInFlagsAbsolute", "FlagsForFile"} of type []interface {} to string

The query generating this is indeed incorrect, but the error message should be better.

  SELECT UAST_EXTRACT(UAST(f.blob_content, LANGUAGE(f.file_path, f.blob_content), '//Identifier'), 'Name') as names
  FROM   files AS f
  WHERE  names != ''

Replacing the condition with WHERE names IS NOT NULL will fix the error, but the message should be more clear.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

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