[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] sqlite3_total_changes() doesn't include schema changes?
From:       David Barrett <dbarrett () quinthar ! com>
Date:       2008-10-30 8:40:44
Message-ID: 4909730C.1040609 () quinthar ! com
[Download RAW message or body]

Ah, thanks.  I think I'll wait for the next stable release and go to 
that; in the meantime I'll use the WHERE 1 trick.  Thanks!

-david

Dan wrote:
> On Oct 30, 2008, at 3:10 PM, David Barrett wrote:
> 
>> Ok, getting close: now I test for changes in sqlite3_total_changes()  
>> and
>> PRAGMA schema_version and that works, except for one case:
>>
>> 	DELETE FROM table;
>>
>> I see in the docs for sqlite_total_changes() that I can solve this  
>> by doing:
>>
>> 	DELETE FROM table WHERE 1;
>>
>> Is there any other way to detect the change without losing that
>> optimization?  Thanks!
> 
> This has been changed in cvs. In version 3.6.5 sqlite3_change()
> and total_changes() will correctly report the number of rows deleted
> by "DELETE FROM table".
> 
> So upgrading to cvs head would work.
> 
> Dan.
> 
> 
> 
>> -david
>>
>> Igor Tandetnik wrote:
>>> David Barrett <dbarrett@quinthar.com> wrote:
>>>> If so, is there any general way to determine -- given an arbitrary
>>>> query -- whether or not it changed the database?
>>> Run PRAGMA schema_version before and after.
>>>
>>> Igor Tandetnik
>>>
>>>
>>>
>>> _______________________________________________
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic