mtxr / vscode-sqltools

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

Filters being saved across separate queries causing unexpected missing results #1346

Open pkkid opened 2 weeks ago

pkkid commented 2 weeks ago

Describe the bug Filters being saved across separate queries causing unexpected missing results.

To Reproduce (Scenario 1)

  1. Create new SQL file with two simple queries similar to the following: SELECT jobname, jobid FROM jenkins_piperun; SELECT count(*) FROM jenkins_piperun;
  2. Put cursor on the first query run command "SQLTools Connection: Run Current Query"
  3. Note the results, and add a simple filter to one of the columns. I filtered a column with comma ",".
  4. Put cursor on the second query run command "SQLTools Connection: Run Current Query"
  5. *NOTE the result on the count() query is No Data.**
  6. The only way to get data back is to rerun the first query and remove the filter.

To Reproduce (Scenario 2)

  1. Create new SQL file with two simple queries similar to the following: SELECT jobname, jobid FROM jenkins_piperun; SELECT count(*) FROM jenkins_piperun;
  2. Run the command "SQLTools Connection: Run This File"
  3. Note the results, and add a simple filter to one of the columns on the first query result. I filtered a column with comma ",".
  4. When there is a filter on the first query result, the second query result will show No Data.
  5. The only way to get data back on the second query is to remove the filter on the first query.

Expected behavior

Desktop (please complete the following information):