Skip to content

Unexpected Handling of Duplicate Column Names in Cell Results  #44

@AJTonyKane

Description

@AJTonyKane

This is an edge case hardly worth mentioning, but I accidentally created a select query with duplicate column label in the results. Interestingly, the SQL Notebook cell results only showed one column, the one with the right-most value. But it was still better than the results displayed by the SQLTools VS Add-In I used until I discovered your gem. For comparison, the attached has a simple example with display output of both compared to MySQL Workbench. Mostly thought you would be interested in knowing, irrespective of whether you think it's worth your time or energy. Regardless, thanks for creating this great tool and best wishes, T

SQL Edge-Case handling by VS Code Add-Ins

Activity

cmoog

cmoog commented on Jun 6, 2022

@cmoog
Owner

Thanks for this report and providing the detailed comparison. This is interesting indeed. I think we should be able to solve this by using the rowsAsArray: true option in the mysql driver to prevent key collisions for duplicate column names.

https://github.com/sidorares/node-mysql2/blob/ab3feb75bb4af1f6d288c0494a99aa2483ac24d5/index.d.ts#L173

added
bugSomething isn't working
on Jun 6, 2022
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

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cmoog@AJTonyKane

        Issue actions

          Unexpected Handling of Duplicate Column Names in Cell Results · Issue #44 · cmoog/vscode-sql-notebook