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.
Make it possible to drop database objects (i.e. SQL code) on the tree
view in the Database Structure tab. This is far from being perfect as of
now but enables you to drag and drop entire objects between databases.
Use a custom model for the tree view in the "Database Structure" tab in
the main window, i.e. change from a QTreeWidget to a QTreeView and do
all the item management stuff manually. This might add some code and
complexity but also offers some more flexibility for us.
Reduce the minimum width of two horizontal spacers, the one next to the
table drop down box and the one in the SQL log dock. This way the combo
boxes can take up a bit more space when the window is not that big.