Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
CASE-SENSITIVITY: Error importing data from SQL file: cannot start a transaction within a transaction #1764
Details for the issue
What did you do?
begin transaction; create table names( id integer primary key, name text unique ); commit;
What did you expect to see?
My SQL file imported into the in-memory database
What did you see instead?
Using this file instead produces no error:
BEGIN TRANSACTION; CREATE TABLE names( id integer PRIMARY KEY, name text UNIQUE ); COMMIT;
Useful extra information
Did you also
From rough memory, we use a regex to detect & remove existing transaction statements inside .sql files (so we can do the start/end of transaction in-application). It's probably just a matter of making the regex case insensitive.
This might have been easy if this issue had been opened before #1045
By the way, some more problems are:
BEGIN TRANSACTION ; -- Multiple spaces here. Not detected. END TRANSACTION; -- We're not even looking for this. BEGIN DEFERRED TRANSACTION; -- We're not expecting any qualifiers between the two words. INSERT INTO sql_log VALUES('BEGIN TRANSACTION;'); -- Statement gets modified
rm -r /Applications/DB\ Browser\ for\ SQLite.app rm ~/Library/Preferences/net.sourceforge.sqlitebrowser.plist rm -r ~/Library/Saved\ Application\ State/net.sourceforge.sqlitebrowser.savedState
shasum -a 256 DB.Browser.for.SQLite.dmg 16ed0353ed67d233a5614b86ab1474fbd0fd73de00b77eb3b82e5e4b4fe7e460 DB.Browser.for.SQLite.dmg
cat example-upper.sql BEGIN TRANSACTION; CREATE TABLE names( id integer PRIMARY KEY, name text UNIQUE ); COMMIT;
cat example-lower.sql begin transaction; create table names( id integer primary key, name text unique ); commit;
@MKleusberg Same results as before when following the same testing procedure with the nightly.
However, I found it interesting that even after deleting my preferences
Preferences are split over two files (legacy thing). Running this should show them both:
Looking at their names, it's fairly ironic neither of those are
If we change them now, then everyones saved preferences will stop working. Thus leaving them alone.
rm -r /Applications/DB\ Browser\ for\ SQLite.app rm ~/Library/Preferences/com.sqlitebrowser.sqlitebrowser.plist rm ~/Library/Preferences/net.sourceforge.sqlitebrowser.plist # rm: ~/Library/Preferences/net.sourceforge.sqlitebrowser.plist: No such file or directory rm -r ~/Library/Saved\ Application\ State/net.sourceforge.sqlitebrowser.savedState shasum -a 256 DB.Browser.for.SQLite.dmg # ae5fbfcfc7d4a10201ed23d90b62ba236386c46d5c6924215b4d55f4a6f0d541 DB.Browser.for.SQLite.dmg
@MKleusberg Repeated last test. Success.