Skip to content

"select" request, the returned values are not displayed #1384

Closed

Description

@valbv

Details for the issue

What did you do?

  1. Create dataBase.
  2. Copy SQL-script and perform it testSqlScript.txt
  3. Make a "select" request testSelectRequest.txt

What did you expect to see?

Values of requested fields

What did you see instead?

Nothing.

But if I

  1. save dataBase
  2. restart application and open database
  3. make "select" request

all right, values of requested fields are displayed

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: 10 )

What is your DB4S version?

  • 3.10.1

Did you also

Activity

  1. karim commented on May 10, 2018

    @karim
    Member

    Sorry if I do not fully understand the problem. Are you saying that SELECT query in testSelectRequest.txt file returns nothing if the database is not saved?

    I just tested it now using the same version (3.10.1) but on Win 7 and it seems to be working.

    1384

    Can you show us a screenshot to help us understand the problem?

  2. valbv commented on May 10, 2018

    @valbv
    Author

    Sorry if i wrote my thoughts incorrect

    Steps:

    1. Create DB
    2. Execute SQL-code from testSqlScript.txt
    3. Save DB (Ctrl + S)
    4. Execute SQL-code from testSelectRequest.txt

    Result:
    1

  3. karim commented on May 10, 2018

    @karim
    Member

    I see now the problem, thank you. 😃

    Yes, I got the same result as you posted in your screenshot. It happens when you reuse the same SQL tab. If you paste the query from testSqlScript.txt in the first tab (SQL 1) then reused the same tab to run the SELECT query in testSelectRequest.txt then you get the same result.

    I don't know how this happened. I'm going to label this as a bug and hopefully someone can provide an answer.

  4. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    on May 10, 2018
  5. chrisjlocke commented on May 10, 2018

    @chrisjlocke
    Member

    That is odd - even if you use 'old' tabs, it works fine - but reuse that one tab, and yes, no results, even though it says it found 5 records. Even if you change the SQL, it still doesn't create the rows....

    image

  6. mgrojo commented on May 10, 2018

    @mgrojo
    Member

    This is what I have discovered so far. The problem is exclusively on this pragma:

     pragma foreign_keys = on;

    Execute it on any tab to break it.

    This is the responsible code. Removing it eliminates this problem:

                // SQLite returns SQLITE_DONE when a valid SELECT statement was executed but returned no results. To run into the branch that updates
                // the status message and the table view anyway manipulate the status value here. This is also done for PRAGMA statements as they (sometimes)
                // return rows just like SELECT statements, too.
                if((query_part_type == SelectStatement || query_part_type == PragmaStatement) && sql3status == SQLITE_DONE)
                    sql3status = SQLITE_ROW;

    I' ll try to follow, unless someone has it already clear.

  7. self-assigned this
    on May 11, 2018
  8. mgrojo commented on Jun 10, 2018

    @mgrojo
    Member

    @valbv I'm no longer able to reproduce this problem using the current code. This might have been a concurrency problem that it is now fixed by the changes done for PR #1394.

    Please try with a nightly build and confirm that it is also solved for you, so we can close this issue.
    https://nightlies.sqlitebrowser.org/latest/

  9. justinclift commented on Jun 11, 2018

    @justinclift
    Member

    Yeah, it's definitely possible. We've changed a lot of stuff, and done many bug fixes since the last major release.

  10. valbv commented on Jun 12, 2018

    @valbv
    Author

    Yes, thanks!

  11. justinclift commented on Jun 12, 2018

    @justinclift
    Member

    @valbv That's a little bit unclear (to me). Are you meaning the problem is fixed in our nightly builds, so we should close this issue? 😄

  12. valbv commented on Jun 26, 2018

    @valbv
    Author

    Problem fixed in nightly builds ;)

  13. justinclift commented on Jun 26, 2018

    @justinclift
    Member

    Awesome, thanks for confirming @valbv. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugs.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions