[sqlite] Another 3.7.10 question

2012-01-20 Thread Alexandr Němec

Dear all,
 
we have another question regarding the 3.7.10 version. We have a database with 
cca 10 tables. After creating a new database in 3.7.10 and filling each table 
with about 10 - 100 data rows, we noticed that the size of the database is 2x - 
4x larger compared to 3.7.9 (using exact same table structure and data rows). 
We think that it has to do with the schema format number, which is set to 4 by 
default in 3.7.10. So the general question is, does it mean that the new format 
needs more disk space for the same amount of data?
 
Thanks
 
Alex
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some pieces of the puzzle are coming together

2012-01-20 Thread John Elrick
I don't mean to blow anyone off, but there are over 100 prepared queries
involved in a very interlaced manner.  Getting the EXPLAIN data is very
time consuming and since we've gone way past that point already by
obtaining call stack information, I am not interested in revisiting the
territory unless there is a very good reason for it.  At least I know we
can successfully upgrade to 3.7.5 without any performance issues.  It would
be nice to understand what is going on from that version forward, however,
because it is important that we be able to continue upgrades in the future.


On Fri, Jan 20, 2012 at 2:55 PM, John Elrick wrote:

> The problem is not in the queries.  The problem is in a two order of
> magnitude increase in _mallocs between the versions.  The _mallocs are
> coming from sqlite3Parser.
>
>
> On Fri, Jan 20, 2012 at 2:37 PM, Max Vlasov  wrote:
>
>> On Fri, Jan 20, 2012 at 10:05 PM, John Elrick > >wrote:
>>
>> > The change which results in a slow down occurred between 3.7.5.0 and
>> > 3.7.6.0.
>> >
>> >
>> What about EXPLAIN difference? Or just outputs of this prefix from both
>> versions?
>>
>> Max
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> John Elrick
> Fenestra Technologies
> 540-868-1377
>
>


-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some pieces of the puzzle are coming together

2012-01-20 Thread John Elrick
The problem is not in the queries.  The problem is in a two order of
magnitude increase in _mallocs between the versions.  The _mallocs are
coming from sqlite3Parser.

On Fri, Jan 20, 2012 at 2:37 PM, Max Vlasov  wrote:

> On Fri, Jan 20, 2012 at 10:05 PM, John Elrick  >wrote:
>
> > The change which results in a slow down occurred between 3.7.5.0 and
> > 3.7.6.0.
> >
> >
> What about EXPLAIN difference? Or just outputs of this prefix from both
> versions?
>
> Max
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some pieces of the puzzle are coming together

2012-01-20 Thread Max Vlasov
On Fri, Jan 20, 2012 at 10:05 PM, John Elrick wrote:

> The change which results in a slow down occurred between 3.7.5.0 and
> 3.7.6.0.
>
>
What about EXPLAIN difference? Or just outputs of this prefix from both
versions?

Max
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] BLOB concatenation?

2012-01-20 Thread Pavel Ivanov
>  > SELECT quote(cast(X'5445' || X'5354' as blob));
>
>        Indeed, it seems to work.  Thanks!

But beware that it's not guaranteed to work if blobs have embedded
'\0' character (as it's actually not guaranteed to work if blobs don't
have a valid UTF-8/UTF-16 text). Although I believe it works now and
wasn't changed for a long time. But keep that in mind just in case.


Pavel


On Fri, Jan 20, 2012 at 12:20 PM, Ivan Shmakov  wrote:
>> Pavel Ivanov writes:
>
> [...]
>
>  >> Unfortunately, the string concatenation operator, when applied to
>  >> two BLOB's, results in a text string instead of a BLOB, like:
>
>  >> SELECT quote (X'5445' || X'5354'); => 'TEST'
>
>  > Maybe the following?
>
>  > SELECT quote(cast(X'5445' || X'5354' as blob));
>
>        Indeed, it seems to work.  Thanks!
>
> --
> FSF associate member #7257
>
> ___
> 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


Re: [sqlite] Some pieces of the puzzle are coming together

2012-01-20 Thread John Elrick
The change which results in a slow down occurred between 3.7.5.0 and
3.7.6.0.

On Fri, Jan 20, 2012 at 8:34 AM, John Elrick wrote:

> Thank you sir.  I'll start looking.
>
>
> On Fri, Jan 20, 2012 at 8:27 AM, Richard Hipp  wrote:
>
>> On Fri, Jan 20, 2012 at 8:14 AM, John Elrick > >wrote:
>>
>> > I asked in an earlier posting if the amalgamations were available
>> > somewhere.
>> >
>>
>>
>>
>> http://www.sqlite.org/sqlite-amalgamation-.zip  where  is one of:
>>
>>  3071000
>>  3070900
>>  3070800
>>  3070700
>>  3070603
>>  3070602
>>  3070601
>>  3070600
>>  3070500
>>  3070400
>>  3_7_3
>>  3_7_2
>>  3_7_1
>>  3_7_0
>>  3_6_23_1
>>  3_6_23
>>  3_6_22
>>  3_6_21
>>  3_6_20
>>  3_6_19
>>  3_6_18
>>  3_6_17
>>  3_6_16
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> John Elrick
> Fenestra Technologies
> 540-868-1377
>
>


-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] BLOB concatenation?

2012-01-20 Thread Ivan Shmakov
> Pavel Ivanov writes:

[...]

 >> Unfortunately, the string concatenation operator, when applied to
 >> two BLOB's, results in a text string instead of a BLOB, like:

 >> SELECT quote (X'5445' || X'5354'); => 'TEST'

 > Maybe the following?

 > SELECT quote(cast(X'5445' || X'5354' as blob));

Indeed, it seems to work.  Thanks!

-- 
FSF associate member #7257

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] C# amalgamation hand holding requested

2012-01-20 Thread Simon Slavin

On 20 Jan 2012, at 3:42pm, Don V Nielsen wrote:

> Recent conversations by users has
> convinced me that I would be better off using the amalgamation file
> instead.  However, I don't know what steps in VS to do to specify the
> source and header files so that it compiles into my application.
> 
> Can someone walk through steps necessary for specifying properties,
> references, and source code.

And once it's done can we add it to the documentation or something ?  A page 
for each of the most common uses would be excellent: one for VS, one for common 
Linux compilations, one for Xcode on Macs, would be really useful.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to restore the column values into the structure.

2012-01-20 Thread Dinesh Behl
Hi Bhaskar,

I wrote the code to store the result of SELECT query.

I treated the resultset as a table where each cell is the column value and
row is set of cells, and table is set of rows.


Below is the snippet of the class structure.  You can modify it as per ur
requirement.

Hope it helps.

Dinesh

class SwCell

{

private:

string m_strName;

string m_strValue;

string m_strType;

public :

string getName();

string getValue();

int getType();

void setType(int type);

void setName(string name);

void setValue(string value);

};

class SwRow {

vector m_Row;

public:

void addCell(SwCell val);

void addCell(vector cells);

SWDBI_API SwCell getCell(int index);

SWDBI_API SwCell getCell(string cellName);

SWDBI_API int size();

SWDBI_API vector getRow();

};

class SwRowset

{

vector m_Rowset;

public:

void addRow(SwRow val);

SWDBI_API SwRow getRow(int index);

SWDBI_API int size();

};


On Fri, Jan 20, 2012 at 2:52 AM, bhaskarReddy  wrote:

>
> Hi Friends,
>
>How to store the values of a columns in to the appropriate
> variables.
>
> struct ABC
> {
> int a;
> int b;
> char *str;
> };
>
>a bname
>1 2 ABCD
>2 4 WXYZ
>
>
>   Now i am taking a variable to a structure, and i want to load the column
> values of a particular row.
>
>   ex:   struct ABC   st;
>
>st.a =  //store the record 1's   'a' value.
>st.b =  // store the record 1's   'b' value.
>   st.str = // store the record 1's'name' value.
>
> Regards,
> Bhaskar Reddy.
> --
> View this message in context:
> http://old.nabble.com/how-to-restore-the-column-values-into-the-structure.-tp33172778p33172778.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> 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] C# amalgamation hand holding requested

2012-01-20 Thread Don V Nielsen
I need help using the amalgamation in my projects.  I simply do not know
what steps to take in VS to implement it.

I have some fairly elaborate projects that I have been redeveloping to use
sqlite instead of .net structure and memory functions.  One project is
complete, but it uses the sqlite dll.  Recent conversations by users has
convinced me that I would be better off using the amalgamation file
instead.  However, I don't know what steps in VS to do to specify the
source and header files so that it compiles into my application.

Can someone walk through steps necessary for specifying properties,
references, and source code.  Again, this is C# development.  I've really
become self-aware just how little I know about VS in the terms of
application development.  I've been flying blind for quite some time.  I'm
just like a newbie.

dvn
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] BLOB concatenation?

2012-01-20 Thread Pavel Ivanov
>        Unfortunately, the string concatenation operator, when applied
>        to two BLOB's, results in a text string instead of a BLOB, like:
>
> SELECT quote (X'5445' || X'5354');
>  => 'TEST'

Maybe the following?

SELECT quote(cast(X'5445' || X'5354' as blob));


Pavel


On Fri, Jan 20, 2012 at 4:23 AM, Ivan Shmakov  wrote:
>        With substr (), it's possible to split a BLOB, like:
>
> SELECT quote (substr (X'1337cafe', 3, 2));
>  => X'CAFE'
>
>        However, how do I concatenate two blobs?
>
>        Unfortunately, the string concatenation operator, when applied
>        to two BLOB's, results in a text string instead of a BLOB, like:
>
> SELECT quote (X'5445' || X'5354');
>  => 'TEST'
>
> --
> FSF associate member #7257
>
> ___
> 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


Re: [sqlite] Windows Thread-safe

2012-01-20 Thread Pavel Ivanov
> Im observing that, if for example an SQL command in a transaction is
> uncorrect, the rollback does not work: the previously inserted records are
> not removed.

If you are trying to execute an incorrect SQL statement this statement
is not executed but transaction is not rolled back automatically. You
have to execute ROLLBACK or COMMIT after that by yourself.


Pavel


On Fri, Jan 20, 2012 at 8:07 AM, Marcello Botrugno
 wrote:
> Hi all,
> I am new of SQLite and I am developing a multithread application using
> SQLite 3.7.9 on MS Windows.
> I am using the precompiled version of SQLite downloaded from www.sqlite.org.
>
> Each thread of the application, opens a private connection to the database.
>
> Im observing that, if for example an SQL command in a transaction is
> uncorrect, the rollback does not work: the previously inserted records are
> not removed.
>
> Executing from sqlite3.exe the command:
>     PRAGMA  compile_options;
>
> I get the following data:
> ENABLE_FTS3
> ENABLE_RTREE
> TEMP_STORE=1
> THREADSAFE=0
>
> I deduce that the library I am using is not thread safe.
> I don't know if the behavior of rollback depends on this but I should like
> to use a version of SQLite copiled with THREADSAFE=1.
> Do know if  I need to compile the library by myself or is it possible to get
> a precompiled version of SQLite (threadsafe) somewhere ?
>
> Thanks for any help.
>
>
> ___
> 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


Re: [sqlite] sqlite.dll

2012-01-20 Thread Kevin Benson
On Thu, Jan 19, 2012 at 7:22 PM, Hashry Adijan  wrote:

> Hi,
>
> I need some help here.
>
> Just now I got a message if I start my pc, it says something like: "program
> not working, sqlite dll missing...etc"
>
> What does this meant?  Idont have a clue why it suddenly showup.
>
> If I need to re-download it, which was included in the reminder above, what
> do I need to download.
>
 If your problem relates to iTunes...your solution is probably either this:

http://www.mail-archive.com/sqlite-users@sqlite.org/msg66437.html

or *possibly* the batch file here:

https://discussions.apple.com/thread/3196615?start=30=0

--
   --
  --
 --ô¿ô--
K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Windows Thread-safe

2012-01-20 Thread Larry Brasfield

marcello.botrugno at dedalus.eu wrote:

Hi all,
I am new of SQLite and I am developing a multithread application using
SQLite 3.7.9 on MS Windows.
I am using the precompiled version of SQLite downloaded from www.sqlite.org.

Each thread of the application, opens a private connection to the database.

Im observing that, if for example an SQL command in a transaction is
uncorrect, the rollback does not work: the previously inserted records
are not removed.

Executing from sqlite3.exe the command:
  PRAGMA  compile_options;

I get the following data:
ENABLE_FTS3
ENABLE_RTREE
TEMP_STORE=1
THREADSAFE=0

I deduce that the library I am using is not thread safe.
I don't know if the behavior of rollback depends on this but I should
like to use a version of SQLite copiled with THREADSAFE=1.
Do know if  I need to compile the library by myself or is it possible to
get a precompiled version of SQLite (threadsafe) somewhere ?

Thanks for any help.


Are you using the precompiled DLL?  If so, running sqlite3.exe is not 
going to tell you anything about whether the DLL was compiled with 
SQLITE_THREADSAFE > 0.  You need to call sqlite3_threadsafe() to be 
sure, but the precompiled DLL is threadsafe as demonstrated by compiling 
and running the following code:


#include 
#include 
using namespace std;


int main(int argc, char* argv[])
{
HMODULE hm = LoadLibrary("sqlite3.dll");
if (hm) {
FARPROC fp = GetProcAddress(hm, "sqlite3_threadsafe");
if (fp) {
int threadsafe = fp();
cout << "sqlite3_threadsafe returns " << threadsafe;
}
else
cout << "NoProc";
}
else
cout << "Noload";
Sleep(5000);
return 0;
}

Getting to your real issue, I see no reason to think that passing bad 
SQL (or other malformed commands) to the prepare function should affect 
the course of a transaction.  There is SQL to begin, abort, rollback, or 
commit transactions.  Your malformed command never reaches the execution 
engine.


--
Larry Brasfield
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite.dll

2012-01-20 Thread Simon Slavin

On 20 Jan 2012, at 12:22am, Hashry Adijan wrote:

> Just now I got a message if I start my pc, it says something like: "program
> not working, sqlite dll missing...etc"
> 
> What does this meant?  Idont have a clue why it suddenly showup.
> 
> If I need to re-download it, which was included in the reminder above, what
> do I need to download. 

We don't know what to tell you because you didn't tell us what program it's 
complaining about.  Restart your PC again and this time write the message down.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some pieces of the puzzle are coming together

2012-01-20 Thread John Elrick
Thank you sir.  I'll start looking.

On Fri, Jan 20, 2012 at 8:27 AM, Richard Hipp  wrote:

> On Fri, Jan 20, 2012 at 8:14 AM, John Elrick  >wrote:
>
> > I asked in an earlier posting if the amalgamations were available
> > somewhere.
> >
>
>
>
> http://www.sqlite.org/sqlite-amalgamation-.zip  where  is one of:
>
>  3071000
>  3070900
>  3070800
>  3070700
>  3070603
>  3070602
>  3070601
>  3070600
>  3070500
>  3070400
>  3_7_3
>  3_7_2
>  3_7_1
>  3_7_0
>  3_6_23_1
>  3_6_23
>  3_6_22
>  3_6_21
>  3_6_20
>  3_6_19
>  3_6_18
>  3_6_17
>  3_6_16
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some pieces of the puzzle are coming together

2012-01-20 Thread Richard Hipp
On Fri, Jan 20, 2012 at 8:14 AM, John Elrick wrote:

> I asked in an earlier posting if the amalgamations were available
> somewhere.
>



http://www.sqlite.org/sqlite-amalgamation-.zip  where  is one of:

  3071000
  3070900
  3070800
  3070700
  3070603
  3070602
  3070601
  3070600
  3070500
  3070400
  3_7_3
  3_7_2
  3_7_1
  3_7_0
  3_6_23_1
  3_6_23
  3_6_22
  3_6_21
  3_6_20
  3_6_19
  3_6_18
  3_6_17
  3_6_16

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] detach necessary

2012-01-20 Thread Igor Tandetnik
Petra Abele  wrote:
> I have a simple question (at least I hope so): is an explicit DETACH
> database command necessary before an SQLITE3_close() or is the close()
> alone sufficient?

close is sufficient.
-- 
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug or expected behavior?

2012-01-20 Thread Igor Tandetnik
Alex Dupre  wrote:
> is it expected the following behavior or is it a bug?
> 
> %sqlite3 test.db
> SQLite version 3.7.9 2011-11-01 00:52:41
> sqlite> CREATE TABLE a (x BLOB);
> sqlite> INSERT INTO "a" VALUES(X'30313233');
> sqlite> INSERT INTO "a" VALUES('0124');
> sqlite> SELECT x, typeof(x) FROM a WHERE x LIKE '012%';
> 0123|blob
> 0124|text
> sqlite> select * from a where x = '0123'; <=== no record found

It's expected. LIKE operator converts its parameters to strings. = doesn't, but 
takes actual types into account. Consider:

select 1='1', 1 like '1';
0|1

-- 
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Some pieces of the puzzle are coming together

2012-01-20 Thread John Elrick
I asked in an earlier posting if the amalgamations were available
somewhere.  Since C isn't my primary language and I'm building on Windows,
I'd prefer to have the simplest possible route to recreating.  But yes,
that is precisely what I wanted to do in the beginning to identify the
point where everything changed.

On Thu, Jan 19, 2012 at 11:37 PM, Max Vlasov  wrote:

> John, another suggestion
>
> Can you test previous sqlite versions one by one towards older ones with
> one of your problem queries until the results are "good" again and send
> both good and bad EXPLAIN QUERY output here. I'm sure this will be greek
> for most of us :), but when Richard or Dan look at the difference in the
> vdbe code, they could notice something
>
> Max
>
> On Fri, Jan 20, 2012 at 1:17 AM, John Elrick  >wrote:
>
> > One more useful comparison.  The following query is prepared and step is
> > called with these results:
> >
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
John Elrick
Fenestra Technologies
540-868-1377
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Windows Thread-safe

2012-01-20 Thread Marcello Botrugno

Hi all,
I am new of SQLite and I am developing a multithread application using 
SQLite 3.7.9 on MS Windows.

I am using the precompiled version of SQLite downloaded from www.sqlite.org.

Each thread of the application, opens a private connection to the database.

Im observing that, if for example an SQL command in a transaction is 
uncorrect, the rollback does not work: the previously inserted records 
are not removed.


Executing from sqlite3.exe the command:
 PRAGMA  compile_options;

I get the following data:
ENABLE_FTS3
ENABLE_RTREE
TEMP_STORE=1
THREADSAFE=0

I deduce that the library I am using is not thread safe.
I don't know if the behavior of rollback depends on this but I should 
like to use a version of SQLite copiled with THREADSAFE=1.
Do know if  I need to compile the library by myself or is it possible to 
get a precompiled version of SQLite (threadsafe) somewhere ?


Thanks for any help.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Bug or expected behavior?

2012-01-20 Thread Alex Dupre

Hi All,
is it expected the following behavior or is it a bug?

%sqlite3 test.db
SQLite version 3.7.9 2011-11-01 00:52:41
sqlite> CREATE TABLE a (x BLOB);
sqlite> INSERT INTO "a" VALUES(X'30313233');
sqlite> INSERT INTO "a" VALUES('0124');
sqlite> SELECT x, typeof(x) FROM a WHERE x LIKE '012%';
0123|blob
0124|text
sqlite> select * from a where x = '0123'; <=== no record found
sqlite> select * from a where x like '0123';
0123
sqlite> select * from a where x = '0124';
0124

--
Alex Dupre
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] detach necessary

2012-01-20 Thread Petra Abele

Hello,

I have a simple question (at least I hope so): is an explicit DETACH 
database command necessary before an SQLITE3_close() or is the close() 
alone sufficient? I think, close() alone is enough but I can't find 
anything concerning that question in the documentation.


Why do I want to ommit the DETACH? I open a database, ATTACH another 
database, begin an exlusive transaction, do an insert, commit the 
transaction, close the database. If I need a DETACH, it could happen, 
that another exlusive transaction blocks the database and the DETACH 
does not succeed. So I would have to take care of that error. It would 
be easier, just to ommit the DETACH.


Thanks in advance for any help.

Petra
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite.dll

2012-01-20 Thread Hashry Adijan
Hi,

I need some help here.

Just now I got a message if I start my pc, it says something like: "program
not working, sqlite dll missing...etc"

What does this meant?  Idont have a clue why it suddenly showup.

If I need to re-download it, which was included in the reminder above, what
do I need to download. 

 

Thanks

 

Hash

 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread Jens Frederich
On Fri, Jan 20, 2012 at 12:40 PM, ASURADA  wrote:
> You have missing a point.
> I need 64bit static library. so I have to compile the sqlite.
>

Why you need a static library? For testing, you can direct embed the
Sqlite source in the test app.

                              Jens
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread ASURADA
I was tried SQLite3Test and SQLite3Static with "#define _WIN32_WINNT 0x0501"
macro. but It's not work.



Please make sure the _WIN32_WINNT macro is defined in all your projects
then (and for all build configurations).

--
Joe Mistachkin



Solution
+ SQLite3 (Dynamic Library)
+ SQLite3Static (Static Library)
+ SQLite3Test

Directory of Z:\...\SQLite3Library\sqlite

2012-01-16  23:0491,925 shell.c
2012-01-20  17:50 4,711,082 sqlite3.c
2012-01-16  23:06 4,227 sqlite3.def
2012-01-16  23:06   577,621 sqlite3.dll
2012-01-20  17:52   332,315 sqlite3.h
2012-01-17  11:3147,726 sqlite3.lib
2012-01-16  23:0424,158 sqlite3ext.h

Directory of Z:\...\SQLite3Library\VS2005\SQLite3
Directory of Z:\...\SQLite3Library\VS2005\SQLite3Library
Directory of Z:\...\SQLite3Library\VS2005\SQLite3Test

I have one solution. It contains 3 projects.
projects are use same sqlite files.

I try to compile source with Visual C++ 2010. It's fine. I can't understand
this situation.
What problem with Visual C++ 2005.


*Jens Frederich>*

Can you describe your project structure. One Visual Studio test project with
sqlite3.c sqlite3.h inside or two separate projects?



ASURADA wrote:
>** *>* What's the problem. How to fix this problem.*>* (I use Visual C++ 2005 
>on Windows 7 x64)*>* **In your project, please define the _WIN32_WINNT macro 
>to 0x500 and try
again.

--
Joe Mistachkin




I use sqlite library that is compiled by myself. Because I need static
library and 64bit library.
So I try to make library for version 3.7.10. It was successfully. No error
occur on compile time.
But It was not work. My SQLite library gave me a error message. My code is
fine with 3.7.9.
In case of work with memory db (:memory:), it is fine.

What's the problem. How to fix this problem.
(I use Visual C++ 2005 on Windows 7 x64)

test code
==
:***int rst = sqlite3_open( "e://data.db 
",  );*:Error
==
sqlite3.c
35391  if( isNT() ){
35392LPWSTR zTemp;
35393nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0) + 3; <<
Error occurred Line
35394zTemp = sqlite3_malloc( nByte*sizeof(zTemp[0]) );

Error Message
==
Unhandled exception at 0x in SQLite3Test.exe: 0xC005: Access
violation reading location 0x.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread ASURADA
You have missing a point.
I need 64bit static library. so I have to compile the sqlite.

my solution is simple not complex. It was fine til v3.7.9.



On Fri, Jan 20, 2012 at 10:21 AM, ASURADA http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>> wrote:
>* Solution*>* + SQLite3 (Dynamic Library)*>* + SQLite3Static (Static 
>Library)*>* + SQLite3Test*
Please simplify the setup. Please add sqlite3.c, sqlite3.h,
sqlite3ext.h direct to SQLite3Test project. Remove the project SQLite3
and SQLite3Static dependencies and retry.

  Jens



Solution
+ SQLite3 (Dynamic Library)
+ SQLite3Static (Static Library)
+ SQLite3Test

Directory of Z:\...\SQLite3Library\sqlite

2012-01-16  23:0491,925 shell.c
2012-01-20  17:50 4,711,082 sqlite3.c
2012-01-16  23:06 4,227 sqlite3.def
2012-01-16  23:06   577,621 sqlite3.dll
2012-01-20  17:52   332,315 sqlite3.h
2012-01-17  11:3147,726 sqlite3.lib
2012-01-16  23:0424,158 sqlite3ext.h

Directory of Z:\...\SQLite3Library\VS2005\SQLite3
Directory of Z:\...\SQLite3Library\VS2005\SQLite3Library
Directory of Z:\...\SQLite3Library\VS2005\SQLite3Test

I have one solution. It contains 3 projects.
projects are use same sqlite files.

I try to compile source with Visual C++ 2010. It's fine. I can't understand
this situation.
What problem with Visual C++ 2005.


*Jens Frederich>*

Can you describe your project structure. One Visual Studio test project with
sqlite3.c sqlite3.h inside or two separate projects?



ASURADA wrote:
>** *>* What's the problem. How to fix this problem.*>* (I use Visual C++ 2005 
>on Windows 7 x64)*>* **In your project, please define the _WIN32_WINNT macro 
>to 0x500 and try
again.

--
Joe Mistachkin




I use sqlite library that is compiled by myself. Because I need static
library and 64bit library.
So I try to make library for version 3.7.10. It was successfully. No error
occur on compile time.
But It was not work. My SQLite library gave me a error message. My code is
fine with 3.7.9.
In case of work with memory db (:memory:), it is fine.

What's the problem. How to fix this problem.
(I use Visual C++ 2005 on Windows 7 x64)

test code
==
:***int rst = sqlite3_open( "e://data.db 
",  );*:Error
==
sqlite3.c
35391  if( isNT() ){
35392LPWSTR zTemp;
35393nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0) + 3; <<
Error occurred Line
35394zTemp = sqlite3_malloc( nByte*sizeof(zTemp[0]) );

Error Message
==
Unhandled exception at 0x in SQLite3Test.exe: 0xC005: Access
violation reading location 0x.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] 3.7.10

2012-01-20 Thread Dan Kennedy

On 01/20/2012 06:16 PM, Alexandr Němec wrote:

Dear all,

we have two short questions regarding the new 3.7.10 SQLite release.

1. We read about the new "powersafe overwrite" feature in 3.7.10. We
would like to go on (for a while) without this. If we set
SQLITE_POWERSAFE_OVERWRITE to 0 in the amalgamation file, is this the
only thing that we have to do to go on without powersafe overwrite
assumption?


Right. Either compile sqlite3.c with -DSQLITE_POWERSAFE_OVERWRITE=0
or edit the #define that sets the default within it.


2. Compiling the 3.7.10 version in VS2005 (under default settings)
produces a compiler warning at line 68229 in the amalgamation file (find
the line below). The compiler complains about possible data loss when
truncating u16 to u8. Since there have never been compiler warnings in
previous versions, I just want to ask if this is expected so that we can
ignore the warning.

u.bb.r.flags = (u16)(UNPACKED_INCRKEY * (1 & (u.bb.oc - OP_SeekLt)));


This warning can be ignored. The (u16) cast should be changed to (u8),
but it's harmless.

Dan.



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] 3.7.10

2012-01-20 Thread Alexandr Němec

Dear all,
 
we have two short questions regarding the new 3.7.10 SQLite release.
 
1. We read about the new "powersafe overwrite" feature in 3.7.10. We would like 
to go on (for a while) without this. If we set SQLITE_POWERSAFE_OVERWRITE to 0 in the 
amalgamation file, is this the only thing that we have to do to go on without powersafe 
overwrite assumption?
 
2. Compiling the 3.7.10 version in VS2005 (under default settings) produces a 
compiler warning at line 68229 in the amalgamation file (find the line below). 
The compiler complains about possible data loss when truncating u16 to u8. 
Since there have never been compiler warnings in previous versions, I just want 
to ask if this is expected so that we can ignore the warning.
 
u.bb.r.flags = (u16)(UNPACKED_INCRKEY * (1 & (u.bb.oc - OP_SeekLt)));
 
Best regards
 
Alex

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread Joe Mistachkin

Please make sure the _WIN32_WINNT macro is defined in all your projects
then (and for all build configurations).

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread Jens Frederich
On Fri, Jan 20, 2012 at 10:21 AM, ASURADA  wrote:
> Solution
> + SQLite3 (Dynamic Library)
> + SQLite3Static (Static Library)
> + SQLite3Test

Please simplify the setup. Please add sqlite3.c, sqlite3.h,
sqlite3ext.h direct to SQLite3Test project. Remove the project SQLite3
and SQLite3Static dependencies and retry.

                              Jens
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] BLOB concatenation?

2012-01-20 Thread Ivan Shmakov
With substr (), it's possible to split a BLOB, like:

SELECT quote (substr (X'1337cafe', 3, 2));
  => X'CAFE'

However, how do I concatenate two blobs?

Unfortunately, the string concatenation operator, when applied
to two BLOB's, results in a text string instead of a BLOB, like:

SELECT quote (X'5445' || X'5354');
  => 'TEST'

-- 
FSF associate member #7257

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread ASURADA
Solution
+ SQLite3 (Dynamic Library)
+ SQLite3Static (Static Library)
+ SQLite3Test

Directory of Z:\...\SQLite3Library\sqlite

2012-01-16  23:0491,925 shell.c
2012-01-20  17:50 4,711,082 sqlite3.c
2012-01-16  23:06 4,227 sqlite3.def
2012-01-16  23:06   577,621 sqlite3.dll
2012-01-20  17:52   332,315 sqlite3.h
2012-01-17  11:3147,726 sqlite3.lib
2012-01-16  23:0424,158 sqlite3ext.h

Directory of Z:\...\SQLite3Library\VS2005\SQLite3
Directory of Z:\...\SQLite3Library\VS2005\SQLite3Library
Directory of Z:\...\SQLite3Library\VS2005\SQLite3Test

I have one solution. It contains 3 projects.
projects are use same sqlite files.

I try to compile source with Visual C++ 2010. It's fine. I can't understand
this situation.
What problem with Visual C++ 2005.


*Jens Frederich>*

Can you describe your project structure. One Visual Studio test project with
sqlite3.c sqlite3.h inside or two separate projects?



ASURADA wrote:
>* *>* What's the problem. How to fix this problem.*>* (I use Visual C++ 2005 
>on Windows 7 x64)*>* *
In your project, please define the _WIN32_WINNT macro to 0x500 and try
again.

--
Joe Mistachkin




I use sqlite library that is compiled by myself. Because I need static
library and 64bit library.
So I try to make library for version 3.7.10. It was successfully. No error
occur on compile time.
But It was not work. My SQLite library gave me a error message. My code is
fine with 3.7.9.
In case of work with memory db (:memory:), it is fine.

What's the problem. How to fix this problem.
(I use Visual C++ 2005 on Windows 7 x64)

test code
==
:**int rst = sqlite3_open( "e://data.db ",  );
:**
Error
==
sqlite3.c
35391  if( isNT() ){
35392LPWSTR zTemp;
35393nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0) + 3; <<
Error occurred Line
35394zTemp = sqlite3_malloc( nByte*sizeof(zTemp[0]) );

Error Message
==
Unhandled exception at 0x in SQLite3Test.exe: 0xC005: Access
violation reading location 0x.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread Jens Frederich
Can you describe your project structure. One Visual Studio test project with
sqlite3.c sqlite3.h inside or two separate projects?

                              Jens
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] 3.7.10 problem : SQLite header and source version mismatch

2012-01-20 Thread Kevin Benson
--
   --
  --
 --ô¿ô--
K e V i N


On Thu, Jan 19, 2012 at 10:48 PM, Kevin Youren  wrote:

> G'day,
>
> thanks for such a great program.
>
> Slight problem with sqlite-autoconf-3071000
>
> When I issue from the command line: sqlite3
>
> I get
>
> SQLite header and source version mismatch
> I used:
>
> ./configure
> make
> sudo make install (an Ubuntu system)

sudo ldconfig


--
   --
  --
 --ô¿ô--
K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread Joe Mistachkin

ASURADA wrote:
>
> _WIN32_WINNT was defined by 0x0501 already.
>

It must be defined in the project that you are using to actually compile the
SQLite
source code (i.e. not just the project that uses the SQLite code, unless
they are in
fact the same project). 

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread ASURADA
_WIN32_WINNT was defined by 0x0501 already.



>* *>* What's the problem. How to fix this problem.*>* (I use Visual C++ 2005 
>on Windows 7 x64)*>* *
In your project, please define the _WIN32_WINNT macro to 0x500 and try
again.

--
Joe Mistachkin
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Library run-time error

2012-01-20 Thread ASURADA
This is call stack on Visual Studio 2005

  ()
> SQLite3Test.exe!winFullPathname(sqlite3_vfs * pVfs=0x0055b6f8, const char
* zRelative=0x002bff30, int nFull=261, char * zFull=0x002bb098)  Line 35393
+ 0x12 bytes C
  SQLite3Test.exe!sqlite3OsFullPathname(sqlite3_vfs * pVfs=0x0055b6f8,
const char * zPath=0x002bff30, int nPathOut=261, char *
zPathOut=0x002bb098)  Line 14814 + 0x1a bytes C
  SQLite3Test.exe!sqlite3PagerOpen(sqlite3_vfs * pVfs=0x0055b6f8, Pager * *
ppPager=0x002bb000, const char * zFilename=0x002bff30, int nExtra=84, int
flags=0, int vfsFlags=262, void (PgHdr *)* xReinit=0x004aeea0)  Line 42654
+ 0x15 bytes C
  SQLite3Test.exe!sqlite3BtreeOpen(sqlite3_vfs * pVfs=0x0055b6f8, const
char * zFilename=0x002bff30, sqlite3 * db=0x002bf988, Btree * *
ppBtree=0x002bfb48, int flags=0, int vfsFlags=262)  Line 51051 + 0x20 bytes
C
  SQLite3Test.exe!openDatabase(const char * zFilename=0x005498b8, sqlite3 *
* ppDb=0x0018f43c, unsigned int flags=6, const char * zVfs=0x)
 Line 48870 + 0x28 bytes C
  SQLite3Test.exe!sqlite3_open(const char * zFilename=0x005498b8, sqlite3 *
* ppDb=0x0018f43c)  Line 48990 + 0x11 bytes C
  SQLite3Test.exe!CSQLite3TestDlg::Test()  Line 204 + 0xe bytes C++
  SQLite3Test.exe!CSQLite3TestDlg::OnBnClickedButtonTest()  Line 156 C++

When I compile with Visual C++ 2010. No error occurred. I can't understand
this situation.
Why it does not same 2005 and 2010?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users