You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash when removing an indexed field from a table #1115
Whenever I try to remove an INTEGER indexed field from a table, DB4S locks up and I get a "DB Browser for SQLite has stopped working" message. This did not happen in DB4S 3.9.1.
The condition still seems a little fuzzy to me, but it only appears to happen when I try to delete an INTEGER field. TEXT and REAL fields delete just fine (although, curiously, if I change a field type from INTEGER to something else it still crashes).
EDIT: The issue happens when I try to delete an indexed, non-primary key field from the table.
Here's some info from the debugging dialog:
Fault Module Name: Qt5Core.dll
Fault Module Version: 5.7.1.0
Exception Code: c0000005
Exception Offset: 00000000000a637d
Hmm, that's weird. The data type shouldn't make any difference. Can you maybe remove all data from your database, so that it only contains the empty table that you're trying to edit and send me that? That should make it much easier to reproduce the issue 😄
Thanks for the update, @hal7df! That really helped a lot 😄 I think I have fixed the bug. It was caused by some new code that tries to be clever about the indices when an indexed column is updated (updating the column name in the table also updates the column name in the indices) but didn't take into account that you can also remove columns 😦 Can you download tomorrow's nightly build (or any later one) and check if it's working for you? 😄
Activity
MKleusberg commentedon Sep 1, 2017
Hmm, that's weird. The data type shouldn't make any difference. Can you maybe remove all data from your database, so that it only contains the empty table that you're trying to edit and send me that? That should make it much easier to reproduce the issue 😄
chrisjlocke commentedon Sep 1, 2017
Does it happen in just one database, or others too? If you create a new 'dummy' database, save it, delete a field, does it do it in that too?
hal7df commentedon Sep 1, 2017
I don't have access to that database anymore (right now at least)...I'm trying to see if I can create a dummy that reproduces the issue.
FWIW, I had this issue on copies of the same database (same schema, although the data may have been different)
chrisjlocke commentedon Sep 1, 2017
I can't reproduce this on my Win 7 VM, so its ggood (?!) its not a Win 7 issue... (my first thought...)
Related to this, DB4s lets you delete the last field in a table, but it fails in doing so.
Maybe the [Delete] button could have a check of, "if number of fields in list =1 then display message, "the last field cannot be removed, bozo." "
hal7df commentedon Sep 1, 2017
I've been unable to reproduce it yet as well (on a Win7 VM and a Win10 VM).
The field I was trying to delete had a NOT NULL flag set on it, although that hasn't made any difference in my attempts to reproduce it.
I suppose it could also be a problem with the DB file(s) I was using and not DB4S, although why that would be escapes me at the moment...
hal7df commentedon Sep 1, 2017
Figured it out -- if you try to delete an indexed, non-primary key field, you get this behavior.
If you try to delete "Field2" from this test database, it should crash:
test.db.zip
[-]Crash when removing an INTEGER field from a table[/-][+]Crash when removing an indexed field from a table[/+]chrisjlocke commentedon Sep 1, 2017
Yup, dies on my Win 10 PC, so not a Win 7 issue... shame! ;)
Thanks for the extra database - useful.
Fix index updating when removing an indexed column from a table
MKleusberg commentedon Sep 2, 2017
Thanks for the update, @hal7df! That really helped a lot 😄 I think I have fixed the bug. It was caused by some new code that tries to be clever about the indices when an indexed column is updated (updating the column name in the table also updates the column name in the indices) but didn't take into account that you can also remove columns 😦 Can you download tomorrow's nightly build (or any later one) and check if it's working for you? 😄
hal7df commentedon Sep 5, 2017
Sorry for the late response - deleting indexed columns works as expected on the 2017-09-04 nightly.
justinclift commentedon Sep 5, 2017
Awesome. Thanks for testing and verifying @hal7df. 😄
Fix index updating when removing an indexed column from a table