vscode-sql-notebook icon indicating copy to clipboard operation
vscode-sql-notebook copied to clipboard

Unexpected Handling of Duplicate Column Names in Cell Results

Open AJTonyKane opened this issue 3 years ago • 1 comments

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

AJTonyKane avatar May 27 '22 15:05 AJTonyKane

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

cmoog avatar Jun 06 '22 23:06 cmoog