Skip to content

Execute Current Line button in 'Execute SQL' tab runs multiple lines (Linux) #2440

Open

Description

@chris3392

Details for the issue

doing an inner join executing current statement only through appropriatemenu button, will not stop execution at the comma and show results; instead will continue and execute next statement and hence show result of said immediately following statement.

What did you do?

Select Account.name, account.personemail from Account inner join ListNBRDoublon on ListNBRDoublon.personemail = account.personemail ; ;

select 3*5 ;

What did you expect to see?

result of inner join statement ie a table with Account.name, account.personemail

(that table appeared briefly until replaced by result of immiately following statement as was executed)

What did you see instead?

result of 3*5, ie, 15

Useful extra information

DB4S v3.12.0 [built for x86_64-little_endian-lp64] on Ubuntu 18.04.5 LTS (linux/5.4.0-48-generic) [x86_64]
using SQLCipher Version 3.4.1 (based on SQLite 3.30.1)
and Qt 5.9.5

Activity

  1. chrisjlocke commented on Oct 13, 2020

    @chrisjlocke
    Member

    Technically this is a duplicate of #2429.
    If you only highlight the instructions you want to run, this helps matters, so highlight a line, run it, then highlight the next line.
    Not a perfect solution, but its how I use SQL Server Management Studio...

  2. chrisjlocke commented on Oct 13, 2020

    @chrisjlocke
    Member

    Closing as this is a duplictate, but fee;l free to comment if needed. 😃

  3. chris3392 commented on Oct 13, 2020

    @chris3392
    Author

    Not sure if this is a duplicate or not. I have seen that behavior only with the inner join instruction. Evertything else is fine

    As for issue #2, which I am hinting i will post - but have not-- I found in the meantime it was irrelevant as an Sqlite limitation.

    Tx

  4. chrisjlocke commented on Oct 14, 2020

    @chrisjlocke
    Member

    Its a duplicate, as you're doing two queries, but the results window only shows the last query. While a bug, its easily worked around by only executing one instruction at a time, via selective highlighting. Its not ideal, but works fairly well once you get used to it. I tend to use one SQL tab with multiple queries so I can just select the one I want and run it.

  5. chris3392 commented on Oct 14, 2020

    @chris3392
    Author

    Unfortunately I cannot reproduce it anymore as i changed my database too heavily.

    If it helps, i was not using selective highlighting but was requesting a one instruction only execution by using the relevant button from db browser.

    EDIT:
    Giving it a second thoght: What you describe is wrong.
    The bug is NOT that is shows the result of Second query only while I am doing 2 queries.
    The bug is that I was requesting for execution of query 1 ONLY and it executed query one AND query 2; which was unexpected.
    If you check my query above you will see that I tried to add additionna coma at the end of the query because it looked like it had missed somehow when parsing that it had already reached end of requested query, (and executed query 2 instead of halting).

    I think it worth to mention, since I have the occasion, i am using that tool very often and really like it. Could hardly live without it.
    Congratulation for the work.

  6. chrisjlocke commented on Oct 14, 2020

    @chrisjlocke
    Member

    i was not using selective highlighting

    Oh no, that's the issue - that's the bug (acknowledged in the other issue). If you were, it would have worked out OK. 😃
    Hopefully someone will work out how to fix it, as its a common problem - especially if you use MS SQL Management Studio.

  7. chris3392 commented on Oct 14, 2020

    @chris3392
    Author

    ok,
    Not intending to start trolling here.

    hard for me to understand how to view these as same error. DBBrowser is executing 2 queries where only the last one output is displayed, while I explicitely hit the button to execute ONE query, not two (and two were executed instead)

    Furthermore, said bug is mentioning only ONE query, which output does not show the rows properly but the columns are shown properly.

    While in my case, the output (both rows and column names) is correct for execution of query #2; the problem being, why on earth does it execute query #2 after #1, while being requested to execute query #1 only.

    Sounds very different (though I can understand it could result from same technical bug, but outputs and execution are just at odds)

  8. chrisjlocke commented on Oct 14, 2020

    @chrisjlocke
    Member

    while I explicitely hit the button to execute ONE query

    Apologies - so you pressed the 'Execute current line' button?

    image

    We've had many 'quirks' with this, as the parser can get confused with different lines depending on the OS (Linux vs Windows ... carriage returns vs carriage returns with line-feeds)
    This works on Windows, but if you are pressing the 'execute current line', then yes, that's an error. Apologies - while you did mention 'the appropriate menu', I didn't appreciate that's the button you were referring to.

  9. chris3392 commented on Oct 14, 2020

    @chris3392
    Author

    No worry.
    Correct. I was pressing that execute current line button.
    Ubuntu 18.04 here, if it helps.

  10. chrisjlocke commented on Oct 14, 2020

    @chrisjlocke
    Member

    OK, if you put the text carat on line 1 and press that button, do you get the result of line 2?
    Just making sure 100% the error is the error I'm reading.... :)

  11. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    on Oct 14, 2020
  12. changed the title [-]2 issues with inner join -- issue 1[/-] [+]Execute Current Line button in 'Execute SQL' tab runs multiple lines (Linux)[/+] on Oct 14, 2020
  13. chris3392 commented on Oct 15, 2020

    @chris3392
    Author

    Yes, this is what I meant.
    I put the text carat on line 1 and press that button,
    then I can see the columns appearing for a very brief period of time (that query retruns a few thousands rows) and i have no time to see the rows appearing once they are returned
    then, the columns and the rows of the next query appear. And it stops there.

    So, query 1 was executed(expected) then immediately query 2 is executed as well (unexpected).
    the result of query 2 is on screen, which is expected when it executes; the unexpected is query 2 to execute at all in that scenario.

  14. chrisjlocke commented on Oct 15, 2020

    @chrisjlocke
    Member

    Excellent, thanks for clarifying. :)

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

    Execute SQLbugConfirmed bugs or reports that are very likely to be bugs.linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions