[sqlite] making a meal of text substitution

2013-08-01 Thread dean gwilliam
Can someone please help me to understand why my substitution of the single line that creates the table 'std' isn't working. Any help much appreciated! #== proc msg {vlu} {tk_messageBox -message "$vlu"} ::oo::class create cDbase { variable db tmp

[sqlite] making a meal of text substitution

2013-08-01 Thread dean gwilliam
It's ok I cracked it... I just needed to enclose the script in nothing more than double quotes to get the variables to substitute correctly i.e. set script "CREATE TABLE $nm ( id integer primary key, $flds )" db eval $script and ignoring the example syntax's '{}'i.e. gDb eval

Re: [sqlite] Bitwise Not Operator Precedence

2013-08-01 Thread Richard Hipp
On Thu, Aug 1, 2013 at 1:06 PM, Filipe Oliveira wrote: > Hi, > > Here http://www.sqlite.org/lang_expr.html says that "The COLLATE operator > is a unary postfix operator that assigns a collating > sequence to > an

[sqlite] Bug report: Sqlite seg fault, probably after database gets corrupt

2013-08-01 Thread Brian Vincent
Let me first say that we sometimes see databases that go corrupt. I haven't pinpointed the cause yet, but what I think I can describe, is a possibly way that a corrupt database is causing sqlite to segfault. I use a java wrapper for sqlite. I've seen this exact segfault happen on an older

Re: [sqlite] Bug report: Sqlite seg fault, probably after database gets corrupt

2013-08-01 Thread Warren Young
On 8/1/2013 12:20, Brian Vincent wrote: Let me first say that we sometimes see databases that go corrupt. I haven't pinpointed the cause yet, This may be enlightening: "How to Corrupt an SQLite Database File" https://www.sqlite.org/howtocorrupt.html

Re: [sqlite] Bug report: Sqlite seg fault, probably after database gets corrupt

2013-08-01 Thread Stephan Beal
On Thu, Aug 1, 2013 at 8:20 PM, Brian Vincent wrote: > next line assigns it to d1, which is a signed integer, so d1 gets a > negative value. To be strictly pedantic, overflow/underflow are undefined for _signed_ types in C. Here are some details:

Re: [sqlite] Bug report: Sqlite seg fault, probably after database gets corrupt

2013-08-01 Thread Richard Hipp
On Thu, Aug 1, 2013 at 2:20 PM, Brian Vincent wrote: > I think I can describe, is a > possibly way that a corrupt database is causing sqlite to segfault. > Thanks. Fixed in http://www.sqlite.org/src/info/c3baca99f4 including a test case. -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] Bug report: Sqlite seg fault, probably after database gets corrupt

2013-08-01 Thread Brian Vincent
if( d1>=(u32)nKey1 && sqlite3VdbeSerialTypeLen(serial_type1)>0 ) break; The next line will likely segfault if d1>=nKey1, right? What if d1>=nKey1, but it's not true that sqlite3VdbeSerialTypeLen(serial_type1)>0 ? Wouldn't this still cause a segfault? Is that a valid concern? -Brian

Re: [sqlite] Bug report: Sqlite seg fault, probably after database gets corrupt

2013-08-01 Thread Richard Hipp
On Thu, Aug 1, 2013 at 3:30 PM, Brian Vincent wrote: > if( d1>=(u32)nKey1 && sqlite3VdbeSerialTypeLen(serial_type1)>0 ) break; > > The next line will likely segfault if d1>=nKey1, right? What if d1>=nKey1, > but it's not true that sqlite3VdbeSerialTypeLen(serial_type1)>0 ?

[sqlite] proper use of sqlite3_file_control()

2013-08-01 Thread Stephan Beal
Hi, all, i'm trying to use: http://www.sqlite.org/capi3ref.html#sqlite3_file_control to create a name for a temporary file, as described here: http://www.sqlite.org/capi3ref.html#sqlitefcntltempfilename And it looks like: #include #ifdef SQLITE_FCNTL_TEMPFILENAME static int

Re: [sqlite] proper use of sqlite3_file_control()

2013-08-01 Thread Richard Hipp
On Thu, Aug 1, 2013 at 6:23 PM, Stephan Beal wrote: > Hi, all, > > i'm trying to use: > > http://www.sqlite.org/capi3ref.html#sqlite3_file_control > > to create a name for a temporary file, as described here: > > http://www.sqlite.org/capi3ref.html#sqlitefcntltempfilename

Re: [sqlite] proper use of sqlite3_file_control()

2013-08-01 Thread Stephan Beal
On Fri, Aug 2, 2013 at 12:30 AM, Richard Hipp wrote: > That File Control was added for 3.7.16, just a few months ago. > Yeah, i found that out the hard way ;) and had to go update my local sqlite3, but you were half right - i was linking to the wrong one, but i'm still seeing

[sqlite] Invalid table name provided in sqlite3_update_hook callback

2013-08-01 Thread psryland
Hi All, I am working on an Android project that uses Xamarin.Android and the sqlite binary distributed with the Android OS (various versions, depending on the Android OS version). Within the application we have an object caching scheme that relies on the callback provided to the