Table was deleted on macOS

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Table was deleted on macOS

tf@qvgps.com
Hi Group,

here is a very strange and rare fault which one of our users experienced on macOS .

He was working in our app for a while creating a lot of new data.
So over several hours many INSERT INTO mytable ....
Without any errors.

Then he did a query SELECT COUNT(*) FROM mytable WHERE  (deleted=0 OR deleted IS NULL) AND IdCat=2
and an exception occurs:
"no such table: mytable"

The client sent us the database and the table "mytable" was really gone.
The database also seems to be fine, no errors.
How can this happen?
In our app is no DROP TABLE command, what else can cause a table to be deleted?

We have a few hundred copies of our app out, and this is the first time this error happens.
Its on macOS and the sqlite-version is 3024000


Thanks
Tom



/****************************************
**   Flemming Software Development CC
**   Thomas Flemming
**   PO Box 81244
**   Windhoek, Namibia
**   http://www.quovadis-gps.com
**   mail  [hidden email]<mailto:[hidden email]>
**   +264 (0)81 3329923    Nam mobile
**   +49  (0)175 7313081   D mobile
**   +49  (0)6182 8492599  D office
***************************************/

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table was deleted on macOS

Simon Slavin-3
On 15 Oct 2019, at 10:11pm, [hidden email] wrote:

> "no such table: mytable"
>
> The client sent us the database and the table "mytable" was really gone.  The database also seems to be fine, no errors.

Do you mean by that that you ran integrity_check() ?

Is everything else there, or did another table, or rows from another table, disappear ?

Did the client's computer crashed or otherwise failed at any point ?

Is there a chance that the client tried to mess with the table using a database editor tool ?

Does the client have backups ?  Can you look at them and isolate the daterange during which the problem occurred ?

> In our app is no DROP TABLE command, what else can cause a table to be deleted?

ALTER TABLE RENAME
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table was deleted on macOS

tf@qvgps.com
------ Originalnachricht ------
Von: "Simon Slavin" <[hidden email]<mailto:[hidden email]>>
An: "SQLite mailing list" <[hidden email]<mailto:[hidden email]>>
Gesendet: 15.10.2019 23:24:17
Betreff: Re: [sqlite] Table was deleted on macOS

On 15 Oct 2019, at 10:11pm, [hidden email]<mailto:[hidden email]> wrote:

"no such table: mytable"

The client sent us the database and the table "mytable" was really gone. The database also seems to be fine, no errors.

Do you mean by that that you ran integrity_check() ?
is ok



Is everything else there, or did another table, or rows from another table, disappear ?

everything else is there, just this one table is gone.


Did the client's computer crashed or otherwise failed at any point ?
He didn't report that, I believe its quiet unlikely with a 2015 MacBookPro.



Is there a chance that the client tried to mess with the table using a database editor tool ?
no



Does the client have backups ? Can you look at them and isolate the daterange during which the problem occurred ?
no



In our app is no DROP TABLE command, what else can cause a table to be deleted?

ALTER TABLE RENAME
There is no code in the app, which is altering or dropping any table.

Tom


_______________________________________________
sqlite-users mailing list
[hidden email]<mailto:[hidden email]>
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table was deleted on macOS

Simon Slavin-3
Sorry, I have no other ideas.  There is no reason for a table to disappear.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table was deleted on macOS

Peter da Silva-2
Check the local time machine backups? Even if you don't have a TM backup
drive Mojave maintains on-drive backups.

On Tue, 15 Oct 2019, 16:54 Simon Slavin, <[hidden email]> wrote:

> Sorry, I have no other ideas.  There is no reason for a table to disappear.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table was deleted on macOS

Jens Alfke-2
In reply to this post by tf@qvgps.com
Was the database in a folder managed by Dropbox or Google Drive or iCloud Drive, i.e. where some background agent could replace it with a 'newer' copy from another computer?

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table was deleted on macOS

Olaf Schmidt-2
In reply to this post by Simon Slavin-3
Am 15.10.2019 um 23:53 schrieb Simon Slavin:
> ... There is no reason for a table to disappear.

But sometimes intent... ;-)

Maybe one of the App-Users is an xkcd-fan...
https://xkcd.com/327/

@the OP
Don't tell us now, that the table in question
was indeed named "Students"... <g>

Olaf

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table was deleted on macOS

Eduardo Morras-2
In reply to this post by tf@qvgps.com
On Tue, 15 Oct 2019 21:11:05 +0000
"[hidden email]" <[hidden email]> wrote:

> Hi Group,
>
> here is a very strange and rare fault which one of our users
> experienced on macOS .
>
> He was working in our app for a while creating a lot of new data.
> So over several hours many INSERT INTO mytable ....
> Without any errors.
>
> Then he did a query SELECT COUNT(*) FROM mytable WHERE  (deleted=0 OR
> deleted IS NULL) AND IdCat=2 and an exception occurs:
> "no such table: mytable"
>
> The client sent us the database and the table "mytable" was really
> gone. The database also seems to be fine, no errors.
> How can this happen?
> In our app is no DROP TABLE command, what else can cause a table to
> be deleted?
>
> We have a few hundred copies of our app out, and this is the first
> time this error happens. Its on macOS and the sqlite-version is
> 3024000

Did he closed the transaction?? If he did

BEGIN
CREATE TABLE .....
INSERT .....

INSERT....

SELECT COUNT(*)....

the table didn't exist and on close, whole transaction in backrolled. I
say he, but it could be the application used to manage the db too that
forgot the COMMIT after the INSERTS

>
>
> Thanks
> Tom
>
>
>
> /****************************************
> **   Flemming Software Development CC
> **   Thomas Flemming
> **   PO Box 81244
> **   Windhoek, Namibia
> **   http://www.quovadis-gps.com
> **   mail  [hidden email]<mailto:[hidden email]>
> **   +264 (0)81 3329923    Nam mobile
> **   +49  (0)175 7313081   D mobile
> **   +49  (0)6182 8492599  D office
> ***************************************/
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


---   ---
Eduardo Morras <[hidden email]>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users