[sqlite] SQLDIFF problem

2015-12-01 Thread Richard Hipp
On 12/1/15, jungle Boogie  wrote:
> On 30 November 2015 at 06:27, Richard Hipp  wrote:
>>> Just curious. Why does SQLite allow those? Legacy (i.e.
>>> backward-compatibility)? Valid in ANSI SQL? --DD
>>
>> I don't know if it is valid ANSI SQL or not.  But SQLite has always
>> allowed it, so we have to support it now for legacy.
>
>
> How does one invoke the sqldiff tool? I see the c file in
> tool/sqldiff.c. I don't see a download for any OS at
> https://www.sqlite.org/download.html
>

Download the source three, then from unix do "./configure; make
sqldiff" or on Windows to "nmake /f makefile.msc sqldiff.exe"

-- 
D. Richard Hipp
drh at sqlite.org


[sqlite] SQLDIFF problem

2015-12-01 Thread jungle Boogie
On 30 November 2015 at 06:27, Richard Hipp  wrote:
>> Just curious. Why does SQLite allow those? Legacy (i.e.
>> backward-compatibility)? Valid in ANSI SQL? --DD
>
> I don't know if it is valid ANSI SQL or not.  But SQLite has always
> allowed it, so we have to support it now for legacy.


How does one invoke the sqldiff tool? I see the c file in
tool/sqldiff.c. I don't see a download for any OS at
https://www.sqlite.org/download.html

Thanks!

-- 
---
inum: 883510009027723
sip: jungleboogie at sip2sip.info
xmpp: jungle-boogie at jit.si


[sqlite] sqldiff ---primarykey bug

2015-12-01 Thread Stuffer Oskar
On 11/30/2015 06:54 PM, Richard Hipp wrote:
> On 11/30/15, Stuffer Oskar  wrote:
>> Hallo,
>>
>> I'm using the sqldiff tool with the --primarykey option to generate a diff
>> between two databases
>> with the "WITHOUT ROWID" optimization.
>> sqldiff from sqlite 3.9.1 and 3.9.2 produces SQL statements with an
>> incorrect WHERE clause.
>>
>>
>> In the attachment you will find my fix to the
>> sqlite-src-3090100/tool/sqldiff.c file that solves this problem.
>>
> 
> This mailing list strips attachments.  But I wonder your suggested
> patch has not already been implemented at
> https://www.sqlite.org/src/info/e0ed4c3e376248df - can you check and
> see please.

I checked this changeset and my suggested patch was already implemented.

Best regards,
Oskar


[sqlite] sqldiff ---primarykey bug

2015-12-01 Thread Stuffer Oskar
> This mailing list strips attachments.  But I wonder your suggested
> patch has not already been implemented at
> https://www.sqlite.org/src/info/e0ed4c3e376248df - can you check and
> see please.

You are right, the patch I suggested is already implemented at
https://www.sqlite.org/src/info/e0ed4c3e376248df 


-- 
Oskar Stuffer
Servizi s.t. srl, Corso Italia 13/N, I-39100 Bolzano
capitale sociale versato 10.400,00 EUR
CCIAA 1342368 Tribunale di Milano 302137 CF: 01156500181 PI: IT09955600151




[sqlite] [Sqlite3] segfault in sqlite3_step()

2015-12-01 Thread 김수민
hi.

My program received signal SIGSEGV during performed to sqlite_step().

It was occurs only one time still.. but I should know cause. so I need help
you. please.



*Code:*

*// Already prepared statement using sqlite3_prepare_v2(db, QUERY, -1,
, NULL).*

*{*

*sqlite3  *db;*

*sqlite3_stmt *stmt;*

*...*

*RETRY:*

*   sqlite3_reset(stmt);*

*   sqlite3_bind_int(stmt, 1, dir);*

*   while((ret = sqlite3_step(stmt)) == SQLITE_ROW)*

*   {*

* id = sqlite3_column_int(stmt, 0);*

* name = (char*)sqlite3_column_text(stmt, 1);*

* ...*

*   }*


*   if(ret == SQLITE_BUSY)*

*   {*

* msleep(50);*

* goto RETRY;*

*   }*

*   else if( ret != SQLITE_DONE)*

*   {*

* sqlite3_errcode(db);*

* goto ERROR;*

*   }*


*   sqlite3_reset(stmt);*

*   return SUCCESS;*

*ERROR:*

*   sqlite3_reset(stmt);*

*   return FAILURE;*

*}*



It was debugging result..

line "while((ret = sqlite3_step(stmt)) == SQLITE_ROW)"



and sqlite3 library debugging result..

$ addr2line -e libsqlite3.so.0 0x5b81a

./sqlite3.c:64118

line " while( (rc = sqlite3Step(v))==SQLITE_SCHEMA

 && cnt++ < SQLITE_MAX_SCHEMA_RETRY

 && (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK )"



sqlite3 version is 3.7.13.



I think perhaps..

By some reason was error code returns in sqlite3_step()

and then sqlite3_reset() is returning an invalid pointer.

But I don't know why received signal SIGSEGV.



In any case I want to know what occurs segfault in sqlite3_step().

help me, please.



thank you.


[sqlite] SQLite3 API

2015-12-01 Thread Cousin Stanley

>> Any plans for distribution of your cobol/sqlite interface ?
> 
> The SQLite3 Interface for GnuCOBOL [sql3i4gc] 
> will soon be available from the Contribution area 
> of the GnuCOBOL Project 
>
>     
>   
> It is being released under the GNU GPLv3
>  

  Robert  

Thanks for your effort and generosity  

I will check the open-cobol sourceforge site
for  sql3i4gc  availability 


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona



[sqlite] SQLite - Support for VSS writer

2015-12-01 Thread Murdare, Vijaykumar S (GE Oil & Gas)
Hi,

We are planning to use windows VSS ((Volume Shadow Copy) feature for backup & 
restore SQLite databases.
I would like to know, does SQLite support VSS (Volume Shadow Copy Service) 
writer supported by the Windows Operating system to create point in time 
consistent shadow copies (snapshots) for SQLite database?

Thanks and Regards,
Vijay



[sqlite] SQLite - Support for VSS writer

2015-12-01 Thread Keith Medcalf

It will support the same power-fail consistency as any other non-VSS aware 
application.  

That is, VSS will function as designed -- it will "look" like you "turned off 
the power" and then did an "offline" backup -- the resulting backup will be 
crash consistent.  

Like any product that uses such techniques to backup a running system while it 
is, well, running, such as BESR, Acronis, NT Backup, the built-in backup stuff 
in windows, and on and on, you will experience the same result.  The backup may 
be working or it may be useless.  Just like when you arbitrarily crash a 
computer by turning off the power, it may or may not ever work again.

So the answer is yes, it will work just like anything else that is not VSS 
aware.  SQLite is a library, not an application.  

It would be to the application designer who is using the SQLite librarys' job 
to intercept the notifications from VSS so and action them in such a way as to 
ensure that the application is in an application-consistent state when VSS is 
making its crash-consistent backup.

This is much the same way as an "application" (Exchange, SQL Server, etc) can 
have application hooks into VSS.  It is the application programmer who looks 
after such things, not the library writer.  The library has no way of knowing 
how to make the application consistent.  Only the application designer knows 
that.


> -Original Message-
> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-
> bounces at mailinglists.sqlite.org] On Behalf Of Murdare, Vijaykumar S (GE
> Oil & Gas)
> Sent: Tuesday, 1 December, 2015 01:28
> To: sqlite-users at mailinglists.sqlite.org
> Cc: Manneri, Niranjan (GE Oil & Gas)
> Subject: [sqlite] SQLite - Support for VSS writer
> 
> Hi,
> 
> We are planning to use windows VSS ((Volume Shadow Copy) feature for
> backup & restore SQLite databases.
> I would like to know, does SQLite support VSS (Volume Shadow Copy Service)
> writer supported by the Windows Operating system to create point in time
> consistent shadow copies (snapshots) for SQLite database?
> 
> Thanks and Regards,
> Vijay
> 
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users





[sqlite] How hard is it to add the constraint name to the 'FOREIGN KEY constraint failed' message?

2015-12-01 Thread Simon Slavin

On 1 Dec 2015, at 12:55am, Yuri  wrote:

> On 11/23/2015 07:55, James K. Lowden wrote:
>> As a matter of fact, violation of UNIQUE & PK constraints is enforced
>> rather too strictly in SQLite.  Any UPDATE statement that modifie more
>> than one row of a UNIQUE column can fail because two rows may
>> *transiently*  have the same value.  SQLite will fail the statement
>> even though the completed transactation leaves the constraint
>> unviolated.
> 
> It seems like it performs the checking on the level of individual field 
> write, not SQL statements. I suggested earlier to have "CONSTRAINT LEVEL 
> [WRITE|STATEMENT|TRANSACTION];"
> It seems they currently work on the level of field writes and transactions, 
> and not on SQL statement level.

These (largely overlapping) pages




seem to describe UNIQUE, NOT NULL, and CHECK constraints being checked at the 
statement level.  Which is the behaviour you're seeing.

However this is not the behaviour I've seen described for SQLite in the past.  
I'm sure I've read somewhere that consistency checks are checked at COMMIT 
time.  Maybe that's just for the default FOREIGN KEY checks mentioned upthread:



So SQLite is not consistent.  It checks some things at the statement level and 
others at the transaction level.  Which is probably not good.

Simon.