Skip to content

[Bug] Last line in multiple SQL statements is not identified correctly #3171

Open

Description

@timurdavids

Details for the issue

What did you do?

if you run only the last 13th query in the SQL window, it will not work, and
the following lines created line by line will not work either

What did you expect to see?

start with the show of result

What did you see instead?

don't run, just write 'Execution finished without errors.', but without the show of result

Useful extra information

DB4S v3.12.99 (Sep 15 2022) [built for x86_64-little_endian-lp64] on elementary OS 6.1 Jólnir (linux/5.15.0-46-generic) [x86_64]
using SQLCipher Version 4.4.3 community (based on SQLite 3.34.1)
and Qt 5.12.8

Activity

  1. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    Did you click the 'execute' button or the 'execute line' button?
    Was a line highlighted?

    Lets take both options.

    image

    So the 'execute current line' is the icon indicated - the one that looks like >|
    You're on Linux, so DB4S might be getting confused with line endings. It's a relatively old issue, so I'm guessing not.

    Alternatively, you can highlight the line and press [F5]

    image

    This runs the 'normal' execute, which is the icon marked as >

  2. timurdavids commented on Sep 17, 2022

    @timurdavids
    Author
  3. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    Note also each SQL statement ends with a colon.

    image

    If you don't do this, DB4S can get confused as to where a statement ends and the next starts.

  4. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    Try del 14 and next
    Then start 13th

    If you can provide a screenshot, this can assist.

    I don't understand by 'del 14' or 'start 13th'.
    You want me to delete the 14th line and re-run the 13th line? Unsure what that indicates.

    image

  5. timurdavids commented on Sep 17, 2022

    @timurdavids
    Author

    Снимок экрана от 2022-09-17 14-50-13
    Снимок экрана от 2022-09-17 14-50-05
    Снимок экрана от 2022-09-17 14-49-57

    when last line after 13th line,
    don't run, but request is not wrong

  6. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    Thanks for the screenshot.

    It's still hard to tell where the cursor is. Is it in the line, or right at the end?

    image

    Do you press button (1) or button (2) ?

  7. timurdavids commented on Sep 17, 2022

    @timurdavids
    Author

    2

  8. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    If you highlight the whole line and press [F5] does it run then?

  9. timurdavids commented on Sep 17, 2022

    @timurdavids
    Author

    F5 == Shift + F5 in my version program*
    it doesn't run again, unfortunately


    • DB Browser for SQLite Version 3.12.99 (Sep 15 2022)
      Built for x86_64-little_endian-lp64, running on x86_64
      Qt Version 5.12.8
      SQLCipher Version 4.4.3 community (based on SQLite 3.34.1)
  10. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    Well, F5 and Shift+F5 are different - one runs the selection while one runs the current line.
    So its the last line? What happens if you add a fake 'select 1' statement - does the line you want (not the last line now) work?
    A horrible workaround, but sounds like it'll fix it?

  11. timurdavids commented on Sep 17, 2022

    @timurdavids
    Author

    if I have 1...13, 14, 15 lines:
    and run them every the only line
    1st... 13th and 14th work well, but last line (it's 15th) doesn't work

    same situation:
    if I have 1...13, 14, 15, 16, 17, 18 lines:
    and run them for every the only line ( button 2 ' >l ' )
    1st... 16th and 17th work well, but last line (it's 118th) doesn't work

    sorry, Chris, I speak English a little, mb you can't understand me, but it's no problem
    if before me nobody writes of this problem, mb all right

    and in my system Elementary OS (Ubuntu) F5 == Shift+F5, F5 doesn't do anything expect update page in browser :)

  12. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    I speak English a little, mb you can't understand me, but it's no problem

    You speak English very well - much better than I can speak your language! haha!

    I assume then DB4S doesn't know where the last line is - so if you tried this:

    ....
    11 | select lastname....
    12 | select min(round(.....
    13 | select name,min(...
    14 | select country...
    15 | select lastname...
    16 | select 1;
    17 | select 1;

    Does running line 15 then work?

  13. timurdavids commented on Sep 17, 2022

    @timurdavids
    Author

    Yes, for this example 15th works

    but 17th won't work, if I try

  14. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    So this is a bug selecting the last line. This has been reported before, but on Windows system, where detecting line feeds was wrong.

    At least a workaround to the problem is adding a fake or unnecessary select statement ... if you need to ensure you can run statement 16, ensure statement 17 is not needed.

    Thanks for reporting the issue. Hopefully it can be investigated.

    Sorry it took many messages to get to the root cause, but thank you for your patience. :)

  15. timurdavids commented on Sep 17, 2022

    @timurdavids
    Author

    have a good day!!! I'm exited to help your big team and thank you[Chris] for your patience too :).
    Our efforts will be awarded, the main is believe in it

  16. changed the title [-]SELECT[/-] [+][Bug] Last line in multiple SQL statements is not identified correctly[/+] on Sep 17, 2022
  17. chrisjlocke commented on Sep 17, 2022

    @chrisjlocke
    Member

    One last confirmation. You might have to turn on the log panel

    image

    Click 'View' (1) then 'SQL Log' (2) (obviously dependant on your language ... but the menu position should be the same)

    If you then take a screenshot of the SQL log panel

    image

    select the last statement (which won't work correctly) and run it to get the 'Execution finished' message.

    Then take another screenshot of the SQL log panel.

    image

    This should show (hopefully?) the SQL log line it identified (1), (2) and (3)

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