mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.49k stars 301 forks source link

Incorrect data in output table #1388

Closed vdevelg closed 2 hours ago

vdevelg commented 3 hours ago

Describe the bug

When executing a certain query, incorrect values are displayed in the output table, and when scrolling, the number of columns in the table is multiplied several times.

To Reproduce

  1. Connect to the database
  2. Create an SQL script with the code
    select
    now(),
    now()::date,
    extract (year from now()),
    extract (month from now()),
    extract (day from now()),
    extract (hour from now()),
    extract (minutes from now()),
    extract (second from now());
  3. Execute the code
  4. In the output table, make sure that the values are incorrect
  5. Try scrolling through the results table and make sure that the number of columns is increasing!

Expected behavior

See the date and time parts divided into columns, just like in DBeaver.

Screenshots

Desktop

Additional context

I think that's enough. Thank you.

gjsjohnmurray commented 2 hours ago

Is the output correct if you use AS to assign a unique name to each EXTRACT column?

vdevelg commented 2 hours ago

Yes! If you use AS, then it is correct. Everything seems to break down when there are two or more columns with the same name in the table.

gjsjohnmurray commented 2 hours ago

Duplicate of #1276