When the user selects multiple lines of SQL code and hits F5 to execute
them the execution stops after the first line because we use the
selectedText() method of the QTextCursor class to get the selected text
and this method returns Unicode U+2029 paragraph separator characters
instead of newline \n characters.
(see http://qt-project.org/doc/qt-4.8/qtextcursor.html#selectedText)
Fix this by replacing these by regular newline characters to.
Also update the table view widget and the status message in the Execute
Query tab of the main window when the query was valid but returned no
results.
Fixes#38.
Spaces in table, index and field names are actually allowed by SQLite,
so no need to check for them.
However, "`" characters cause problems when appearing in SQL statements
so disallow them instead.
Allow building the project using qmake as discussed on commit
88f66be89e. This lacks the support for generating a dynamic version
number from the Git log though and obviously most of the nice features
of CMake.
Issue #31 was about some problems in the SqliteTableModel which caused
an endless loop in the Execute SQL tab when executing statements with a
LIMIT part that didn't end with a semicolon. This was fixed in 0362d615fd
but the regular expression in this commit only worked for statements
like 'SELECT * FROM t LIMIT 0,10' and didn't detect a statement like
'SELECT * FROM t LIMIT 10' where there is only one number after 'limit',
so the bug still ocurred for those commands. This is fixed by this
commit.
Most non-bash(like) shells don't support command line arguments for the
echo command and print them like regular text. On these systems an
invalid gen_version.h file is generated. This can be fixed by using
printf instead of echo which works the same on all Unix systems.
Also fix the detection whether the gen_version.h file changed before
rewriting it. This prevents creating a file with exactly the same content
but a newer timestamp and therefore make deciding to recompile all files
including it.
The code for copying the selected cells to the clipboard doesn't work
when there is just one cell selected. Fix the code by including a
special handling for this case which returns the content of the single
selected cell without any quotes or the like.
Remove reference to public domain license from readme file.
Delete the old licensing file while keeping a reference to the author of
the icons we use.
Delete the Qt license file as we're not shipping any Qt code at all.
When multiple rows are selected in the Browse Data tab of the main
window and the delete record button is clicked delete all selected rows
and not just one of them.
Remove any single line comments from the SQL queries to fix all those
problems ocurring when a query ending with such a comment is inserted
into the COUNT query.
Executing the query
SELECT * FROM table -- comment
would otherwise lead to this one being executed as well
SELECT COUNT(*) FROM (SELECT * FROM table -- comment);
This is obviously invalid SQL and therefore returns no data, sometimes
even crashing the application, even though the original statement by the
user is perfectly fine.
The code used in this commit is a bit of a workaround and should be
replaced as soon as there is a more complete SQL parser supporting SQL
comments in our grammar tools.
Closes#31.
Fix the syntax of the SQL string generated by fetchData() if there is
already a LIMIT statement at the end of the query. In this case don't
add an additional one. This fixes half of issue #31.
Don't add a "LIMIT x,y" at the end of the query in fetchData() when it
is a PRAGMA or EXPLAIN statement. This way correct SQL code is produced
and it also fixes an endless loop when the statement didn't end in a
semicolon.
When executing multiple INSERT/UPDATE/... statements don't cancel after
the first one. Also don't try to load them into the SqliteTableModel
class - it won't work and just generates a warning.