Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use QUERY_SQL in the dqlite shell #260

Merged
merged 2 commits into from
Jul 17, 2023

Commits on Jul 17, 2023

  1. Always use QUERY_SQL request in the dqlite shell

    In recent versions of dqlite, the QUERY_SQL request supports SQL
    queries that modify the database and do not return rows. Update
    internal/shell/shell.go to always send this request for SQL strings
    entered by the user, instead of switching between QUERY_SQL and EXEC_SQL
    based on whether the string start with `SELECT`.
    
    Also fix the Rows iterator so that it can deal with empty row sets that
    have zero columns. Previously it would enter an infinite loop in this
    situation.
    
    Signed-off-by: Cole Miller <cole.miller@canonical.com>
    cole-miller committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    945a3da View commit details
    Browse the repository at this point in the history
  2. Add a regression test for the zero-column Query case

    Signed-off-by: Cole Miller <cole.miller@canonical.com>
    cole-miller committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    f7320ed View commit details
    Browse the repository at this point in the history