[sqlite] codepages

2009-01-23 Thread John Smith
dear users
I use sqlite for vb6, utf-8 database,
when insert arabic data to database
and search it with 'like' operator
(within % syntax), return all records!!!
Please help me...
thanks
John Smith
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite not performing a certain update

2009-01-23 Thread John Machin
On 24/01/2009 5:09 AM, Onion Knight wrote:

>   "UPDATE tags SET lft = CASE WHEN lft BETWEEN ? AND ?"
>   "   THEN lft + ? ELSE lft + ?"
>   "END WHERE lft BETWEEN ? AND ?",

Two suggestions:

(A) Check to see if the corresponding SELECT works:

"SELECT *, CASE WHEN lft BETWEEN ? AND ?"
"THEN lft + ? ELSE lft + ?"
"END FROM tags WHERE lft BETWEEN ? AND ?",

(B) Note that the effect of C's compile-time concatenation of string 
literals means that that you end up with:

"... ELSE lft + ?END WHERE ..."
not "... ELSE lft + ? END WHERE ..."

The former case should just work, or (much less preferably) give an 
error return. However it's cheap to add a space and run it again to see 
if you've stumbled on a weird dark-corner-case bug.

Try (A), (B) and (A+B)

HTH,
John



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


Re: [sqlite] Is this a bug?

2009-01-23 Thread Griggs, Donald
-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of J. R. Westmoreland

Is there a way to get an autoincrement field without being a primary
key?


 Yes, you can create a trigger to do this.  (This also allows you great
flexibility, since you can, for instance, use an increment other than 1,
include a check digit, etc., but it's not "built-in" as the one for
primary key can be.)

Hope this helps,
   Donald

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


Re: [sqlite] Is this a bug?

2009-01-23 Thread J. R. Westmoreland
Is there a way to get an autoincrement field without being a primary key?


J. R. Westmoreland
E-mail: j...@jrw.org


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Friday, January 23, 2009 1:01 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Is this a bug?

J. R. Westmoreland  wrote:
> I have the following table creation statements and get an error.
>
> Functioning statement
>
> CREATE TABLE xxx (ID INTEGERPRIMARY KEY AUTOINCREMENT, .)
>
> If I remove the PRIMARY KEY" part of the statement, according to the
> docs on SQL that should be still a valid statement, I get an error.
>
> Brken statement:
>
> CREATE TABLE zzz (ID INTEGER AUTOINCREMENT .);

SQLite only supports AUTOINCREMENT together with PRIMARY KEY. See

http://sqlite.org/lang_createtable.html

> But, if I change "AUTOINCREMENT  "AUTO_INCREMENT" it works
>
> Functioning statement:
>
> CREATE TABLE zzz (ID INTEGER AUTO_INCREMENT .);

AUTO_INCREMENT has no special meaning in the syntax. It works for the 
same reason this works:

CREATE TABLE zzz (ID WHATEVER I WANT);

Neither makes ID an autoincrement field.

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


Re: [sqlite] How many tables can a database hold?

2009-01-23 Thread Brad Stiles
> Can someone tell me how many tables a given database can hold.

Try here: http://www.sqlite.org/limits.html

> I'm looking at an initial design of an application that could have a table
> of data for each city in a state. This could be possibly more than a
> thousand tables.

Is the data stored for cities so different that it can't be stored in
one set of tables for all cities, and keyed to another that has the
name?

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


[sqlite] A alternative design question

2009-01-23 Thread J. R. Westmoreland
I'm working on a design for a database that has as its goals two things.

First, speed and second, size. The database will be deployed to a hand held
device so memory/storage size is an issue.

 

When doing a select something like one of the following two cases which
would be faster?

 

1.   SELECT * FROM xxx WHERE . ID>=StartVal and ID=EndVal and Street
like.;

2.   Either creating a temporary table or having one already exist, see
previous message about max number of tables, then selecting only with
Streetas the ERE clause

 

Thanks in advance for any suggestions.

 

Egards,

J. R.

 



J. R. Westmoreland

E-mail: j...@jrw.org

 

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


Re: [sqlite] How many tables can a database hold?

2009-01-23 Thread J Glassy
J.R,
 --I'd suggest you check out URL: http://www.sqlite.org/limits.html
--joins are typically limited to 64 tables

--Assuming you (CAN) define a database with >1000 tables, IMHO, this is a
fairly unconventional design strategy, if rarely needed -- some would say
this is inadvisable.  Typically this sort of structure is addressed via a
normalization of the schema, such that 'cities' are stored as record wise
tuples within a larger relational scheme. ...just a thought..

cheers,
Joe



On Fri, Jan 23, 2009 at 12:55 PM, J. R. Westmoreland  wrote:

> Can someone tell me how many tables a given database can hold.
>
> I'm looking at an initial design of an application that could have a table
> of data for each city in a state. This could be possibly more than a
> thousand tables.
>
> With that many tables how would the performance of the database be
> effected?
>
>
>
> Thanks,
>
> J. R.
>
>
>
>
>
> 
>
> J. R. Westmoreland
>
> E-mail: j...@jrw.org
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
--
Joseph Glassy
Research Analyst/Programmer
University of Montana NSF EPSCoR Program
Davidson Honors College Room 013
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is this a bug?

2009-01-23 Thread Igor Tandetnik
J. R. Westmoreland  wrote:
> I have the following table creation statements and get an error.
>
> Functioning statement
>
> CREATE TABLE xxx (ID INTEGERPRIMARY KEY AUTOINCREMENT, .)
>
> If I remove the PRIMARY KEY" part of the statement, according to the
> docs on SQL that should be still a valid statement, I get an error.
>
> Brken statement:
>
> CREATE TABLE zzz (ID INTEGER AUTOINCREMENT .);

SQLite only supports AUTOINCREMENT together with PRIMARY KEY. See

http://sqlite.org/lang_createtable.html

> But, if I change "AUTOINCREMENT  "AUTO_INCREMENT" it works
>
> Functioning statement:
>
> CREATE TABLE zzz (ID INTEGER AUTO_INCREMENT .);

AUTO_INCREMENT has no special meaning in the syntax. It works for the 
same reason this works:

CREATE TABLE zzz (ID WHATEVER I WANT);

Neither makes ID an autoincrement field.

Igor Tandetnik 



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


Re: [sqlite] Is this a bug?

2009-01-23 Thread Jay A. Kreibich
On Fri, Jan 23, 2009 at 12:51:07PM -0700, J. R. Westmoreland scratched on the 
wall:
> I have the following table creation statements and get an error. 
> 
> Functioning statement
> CREATE TABLE xxx (ID INTEGERPRIMARY KEY AUTOINCREMENT, .)

> If I remove the PRIMARY KEY" part of the statement, according to the docs on
> SQL that should be still a valid statement, I get an error.

  AUTOINCREMENT is only a valid modifier to INTEGER PRIMARY KEY.


> Brken statement:
> CREATE TABLE zzz (ID INTEGER AUTOINCREMENT .);
> 
> But, if I change "AUTOINCREMENT  "AUTO_INCREMENT" it works

  Yes, but it doesn't mean anything.  You've defined a user-type of
  "INTEGER AUTO_INCREMENT", which is about as meaningful to SQLite
  as "INTEGER PINEAPPLE" (also valid).



  http://sqlite.org/autoinc.html

  Also, see the syntax diagram here:

  http://sqlite.org/syntaxdiagrams.html#column-constraint



   -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Is this a bug?

2009-01-23 Thread J. R. Westmoreland
I have the following table creation statements and get an error. 

Scenario:

 

Functioning statement

CREATE TABLE xxx (ID INTEGERPRIMARY KEY AUTOINCREMENT, .)

 

If I remove the PRIMARY KEY" part of the statement, according to the docs on
SQL that should be still a valid statement, I get an error.

 

Brken statement:

CREATE TABLE zzz (ID INTEGER AUTOINCREMENT .);

 

But, if I change "AUTOINCREMENT  "AUTO_INCREMENT" it works

 

Functioning statement:

CREATE TABLE zzz (ID INTEGER AUTO_INCREMENT .);

 

Did this get changed in SQL and I'm just not aware of it? Should I use
"AUTO_INCRMENT" verywhere now?

If it has change shouldn't the parser be consistant about it? 

 

Thanks,

J. R.

 



J. R. Westmoreland

E-mail: j...@jrw.org

 

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


Re: [sqlite] What is the advantage of using native c API over ODBC

2009-01-23 Thread John Stanton
You avoid an unecessary layer of software and have better control over 
the database.

goldy wrote:
> Hi All,
>
> What are the basic advantage of using SQLite with C API over ODBC.
> ___
> 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 not performing a certain update

2009-01-23 Thread Onion Knight
On Fri, Jan 23, 2009 at 7:24 PM, Igor Tandetnik  wrote:
> Do you, by any chance, start a transaction and then forget to commit it?
>
> Igor Tandetnik

No, transactions and concurrency is something I'm going to add later,
when I've got everything in a working state.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite not performing a certain update

2009-01-23 Thread Igor Tandetnik
Onion Knight  wrote:
> I have implemented functionality for adding, removing and renaming
> entries in C. When I got to implementing the function for changing the
> parent of an entry the SQL UPDATE-statements just aren't being
> performed.

Do you, by any chance, start a transaction and then forget to commit it?

Igor Tandetnik 



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


[sqlite] SQLite not performing a certain update

2009-01-23 Thread Onion Knight
I have a table representing a hierarchy using the nested set model, declared as

CREATE TABLE tags (
id INTEGER PRIMARY KEY AUTOINCREMENT,
label TEXT NOT NULL UNIQUE,
lft INTEGER NOT NULL,
rgt INTEGER NOT NULL
);

I have implemented functionality for adding, removing and renaming
entries in C. When I got to implementing the function for changing the
parent of an entry the SQL UPDATE-statements just aren't being
performed.
The part of the code that does the updating looks like this:

/* Earlier declarations. */
const char* updates[] = {
"UPDATE tags SET lft = CASE WHEN lft BETWEEN ? AND ?"
"   THEN lft + ? ELSE lft + ?"
"END WHERE lft BETWEEN ? AND ?",

"UPDATE tags SET rgt = CASE WHEN rgt BETWEEN ? AND ?"
"   THEN rgt + ? ELSE rgt + ?"
"END WHERE rgt BETWEEN ? AND ?"
};
sqlite3_stmt* stmt;
int src_lft, src_rgt, dest_rgt;
int affected_lft, affected_rgt;
int move, displacement;
int i;

/* The update statements being run at the end of the function. */
for (i = 0; i < sizeof(updates)/sizeof(*updates); i++) {
sqlite3_prepare_v2(db, updates[i], -1, , NULL);
sqlite3_bind_int(stmt, 1, src_lft);
sqlite3_bind_int(stmt, 2, src_rgt);
sqlite3_bind_int(stmt, 3, move);
sqlite3_bind_int(stmt, 4, displacement);
sqlite3_bind_int(stmt, 5, affected_lft);
sqlite3_bind_int(stmt, 6, affected_rgt);
sqlite3_step(stmt);
sqlite3_finalize(stmt);
}

The values put into the prepared statements are correct, and all the
sqlite3 function calls return SQLITE_OK, except step which returns
SQLITE_DONE, so everything seems to be in order. But when inspecting
the database afterwards no actual change have been made.

I have test program construct a test database which looks like this.

$ sqlite3 test.db "SELECT * FROM tags"
1|colors|1|14
2|green|2|7
3|light green|3|4
4|dark green|5|6
5|red|8|13
6|pink|9|10
7|magenta|11|12

In the test program I want to set red's parent to green, which has
proved to be difficult. If I create a new database, where I add the
elements so that this is the case (the add function can add a new
entry with a specified parent), I get the following database.

$ sqlite3 test.db "SELECT * FROM tags"
1|colors|1|14
2|green|2|13
3|light green|3|4
4|dark green|5|6
5|red|7|12
6|pink|8|9
7|magenta|10|11

Now, take the original database and do the UPDATE statements by hand
with the sqlite3 program and you get...

$ sqlite3 test.db "UPDATE tags SET lft = CASE WHEN lft BETWEEN 8 AND
13 THEN lft + (-1) ELSE lft + 6 END WHERE lft BETWEEN 7 AND 13"
$ sqlite3 test.db "UPDATE tags SET rgt = CASE WHEN rgt BETWEEN 8 AND
13 THEN rgt + (-1) ELSE rgt + 6 END WHERE rgt BETWEEN 7 AND 13"
$ sqlite3 test.db "SELECT * FROM tags"
1|colors|1|14
2|green|2|13
3|light green|3|4
4|dark green|5|6
5|red|7|12
6|pink|8|9
7|magenta|10|11

The exact same database as the previously constructed one. The
constants for the statements were taken as they were printed out from
the function which is supposed to change parent, so it should be the
same semantics. Bear in mind that UPDATE statements work fine in all
the other functions I use them in.

I really have no clue what could be wrong here. I'm using MinGW and
generated the sqlite3 library using dlltool.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] JDBC and sqllite 1.1

2009-01-23 Thread Kees Nuyt

On Fri, 23 Jan 2009 00:26:00 -0800 (PST), Alessandro Corti
 wrote in General Discussion of SQLite
Database :

>The last version of the jdbc is unable to connect
>to my old sqlite 1.1 db.
>I'm looking for a jdbc driver for sqlite 1.1.

Are you sure 1.1 applies to the SQLite version? 
The highest version in the SQLite v1  series I can find is
Version 1.0.32, dated 2001-23-07.

http://www.sqlite.org/cvstrac/timeline?d=180=2002-Jan-01=0==9=1=1=1=1

>Where can I find it?

I would migrate everything to new versions.

If that is too much of an effort, and you have to use the
old database format, why not simply keep using the ancient
jdbc version that is able to access it?

>Best regards,
>Garp
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Very slow query execution with SQLite Database

2009-01-23 Thread Michael Schlenker
manohar s schrieb:
> I have a SQLite database which is of size 1.5 GB. The problem that it is
> taking a lot of time (12 seconds after execution of vacuum) to execute a *
> SELECT* query.
> 
> Query  :
>   SELECT metric_id, MAX(timestamp_id) AS timestamp_id_max FROM
> snapshot_master GROUP BY metric_id
> 
> I do not understand why this query has to take 12 seconds?? I tried to
> optimize by creating more indexes but no luck.
> BTW, before execution of vacuum, time taken for Query to execute is aprrox.
> 17 minutes(1074890649319 nano seconds)
> 
> I am using sftp_profile for finding out the time.
> 
> 1) What am I doing wrong here?
> 2) Is there any problem in the database design?

If we might assume your table is 1.5 GB in size and you do that query you
have to do a full table scan for it. (unless SQLite can use the PK index if
it exists to speed it up).

So your probably I/O bound, 1.5 GB in 12 seconds is about 130MB/s, sounds
like full read speed of a current harddisk.

Michael

-- 
Michael Schlenker
Software Engineer

CONTACT Software GmbH   Tel.:   +49 (421) 20153-80
Wiener Straße 1-3   Fax:+49 (421) 20153-41
28359 Bremen
http://www.contact.de/  E-Mail: m...@contact.de

Sitz der Gesellschaft: Bremen
Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe
Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Very slow query execution with SQLite Database

2009-01-23 Thread D. Richard Hipp

On Jan 23, 2009, at 11:50 AM, manohar s wrote:

> I have a SQLite database which is of size 1.5 GB. The problem that  
> it is
> taking a lot of time (12 seconds after execution of vacuum) to  
> execute a *
> SELECT* query.
>
> Here is the create Table statement:
> CREATE TABLE IF NOT EXISTS [snapshot_master] (
>PRIMARY KEY (metric_id,
> timestamp_id),
>[timestamp_id] INTEGER  
> NOT NULL,
>[metric_id] INTEGER NOT  
> NULL,
>[metric_now] TEXT,
>[metric_diff] TEXT
>)
>
> Index on this Table for the column:
>  *timestamp_id*
>
> Query  :
>  SELECT metric_id, MAX(timestamp_id) AS timestamp_id_max FROM
> snapshot_master GROUP BY metric_id

Have you tried:

 CREATE INDEX xyzzy ON snapshot_master(metric_id, timestamp_id);

>
>
> I do not understand why this query has to take 12 seconds?? I tried to
> optimize by creating more indexes but no luck.
> BTW, before execution of vacuum, time taken for Query to execute is  
> aprrox.
> 17 minutes(1074890649319 nano seconds)
>
> I am using sftp_profile for finding out the time.
>
> 1) What am I doing wrong here?
> 2) Is there any problem in the database design?
>
> Waiting for your response,
> Manohar.S
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
d...@hwaci.com



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


[sqlite] Very slow query execution with SQLite Database

2009-01-23 Thread manohar s
I have a SQLite database which is of size 1.5 GB. The problem that it is
taking a lot of time (12 seconds after execution of vacuum) to execute a *
SELECT* query.

Here is the create Table statement:
 CREATE TABLE IF NOT EXISTS [snapshot_master] (
PRIMARY KEY (metric_id,
timestamp_id),
[timestamp_id] INTEGER NOT NULL,
[metric_id] INTEGER NOT NULL,
[metric_now] TEXT,
[metric_diff] TEXT
)

Index on this Table for the column:
  *timestamp_id*

Query  :
  SELECT metric_id, MAX(timestamp_id) AS timestamp_id_max FROM
snapshot_master GROUP BY metric_id

I do not understand why this query has to take 12 seconds?? I tried to
optimize by creating more indexes but no luck.
BTW, before execution of vacuum, time taken for Query to execute is aprrox.
17 minutes(1074890649319 nano seconds)

I am using sftp_profile for finding out the time.

1) What am I doing wrong here?
2) Is there any problem in the database design?

Waiting for your response,
Manohar.S
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Adding Custom Column Data Types

2009-01-23 Thread Mike McGonagle
Hello all,

I am in the process of integrating SQLite into a multimedia
environment/programming language. One thing that I would like to be
able to do is support all the various datatypes in this language, and
one in particular is a list of other primitive datatypes. Is there a
way to add a "user-type" so that when 'sqlite3_column_type' is called,
it would return a unique ID for this "user-type"?

I am hoping that I can use this to do some further processing to the
stored data to convert it back into the native format the environment
uses.

Or is there a better way?

Thanks,

Mike


-- 
Peace may sound simple—one beautiful word— but it requires everything
we have, every quality, every strength, every dream, every high ideal.
—Yehudi Menuhin (1916–1999), musician
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Progress update while Prepare() is executing

2009-01-23 Thread Derek Developer
I am using 
sqlite3_prepare_v2()
to process my SQl queries. This takes around 80% of the processing time 
compared to recovering the result set.

Once the querire has been processed i can obviously provide a progress bar when 
stepping through the result set, but what progress indication is available 
during the prepare stage?
   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Ticket #3602

2009-01-23 Thread Dan

On Jan 23, 2009, at 5:37 PM, Jens Miltner wrote:

> Hi,
>
> I filed ticket #3602 a couple of days ago:
>
> Essentially, when using empty test sets ("IN ()" / "NOT IN ()") in the
> WHERE expression of a query, an assert() fires inside the bestIndex
> function. The assert expects pExpr->pList to be non-NULL and the code
> actually checks for this to be non-NULL, so apart from the assert()
> firing, nothing bad seems to happen.
> [Just in case you're going to ask why we would use empty test sets -
> these are queries generated by code]
>
> Since we're using the debug build of sqlite in our debug builds of our
> app, we stumble across this this assert() firing every now and then,
> which is somewhat annoying.
> While I could remove the assert in our code, I'm hesitating to do so,
> because my assumption is the assert() is there for a reason...
> Unfortunately, I don't know the parser well enough to decide whether
> this assert() is something that's pointing out potential trouble or
> whether it's just an incorrect assumption at this point.
>
> Can somebody with more knowledge of the parse please check whether
> this assert() is correct or whether either a NULL pExpr->pList is ok
> at this point or maybe pExpr->pList should be an empty list when
> passing an empty test sets (it's quick and easy to reproduce - see the
> ticket description)?
>
> I'd appreciate some input on the severity of this assertion.

Initially it looks like the ALWAYS(pExpr->pList) can be replaced
with just pExpr->pList. The assert() is wrong.

Dan.


>
>
> Thanks,
> -jens
>
>
> ___
> 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] Ticket #3602

2009-01-23 Thread Jens Miltner
Hi,

I filed ticket #3602 a couple of days ago:

Essentially, when using empty test sets ("IN ()" / "NOT IN ()") in the  
WHERE expression of a query, an assert() fires inside the bestIndex  
function. The assert expects pExpr->pList to be non-NULL and the code  
actually checks for this to be non-NULL, so apart from the assert()  
firing, nothing bad seems to happen.
[Just in case you're going to ask why we would use empty test sets -  
these are queries generated by code]

Since we're using the debug build of sqlite in our debug builds of our  
app, we stumble across this this assert() firing every now and then,  
which is somewhat annoying.
While I could remove the assert in our code, I'm hesitating to do so,  
because my assumption is the assert() is there for a reason...
Unfortunately, I don't know the parser well enough to decide whether  
this assert() is something that's pointing out potential trouble or  
whether it's just an incorrect assumption at this point.

Can somebody with more knowledge of the parse please check whether  
this assert() is correct or whether either a NULL pExpr->pList is ok  
at this point or maybe pExpr->pList should be an empty list when  
passing an empty test sets (it's quick and easy to reproduce - see the  
ticket description)?

I'd appreciate some input on the severity of this assertion.

Thanks,
-jens


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


Re: [sqlite] Leading/trailing whitespace overrides Numeric type affinity - workarounds ?

2009-01-23 Thread MikeW
Roger Binns  writes:

> 
> 
> MikeW wrote:
> > I guess one approach would be to compile with SQLITE_ENABLE_COLUMN_METADATA
> > and then to read the column type from there rather than from 
> > sqlite3_column_type().
> 
> Or just call sqlite3_column_decltype -
> http://sqlite.org/c3ref/column_decltype.html - which will tell you what
> was used in the create table SQL.
> 
> Roger
> 
Hey - I was *not* aware of that !
(Goes away to re-RTFM)

Cheers,
MikeW



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


Re: [sqlite] What is the advantage of using native c API over ODBC

2009-01-23 Thread Michael Knigge
> Hi All,
> What are the basic advantage of using SQLite with C API over ODBC.

1. Better Performance.

2. You can use SQLite Features that are not "mappable" to the ODBC-API.

3. You don't have to worry if there are Bugs in the ODBC-Driver.

4. No need to install the ODBC-Driver to let your Application run

5. You can use the latest SQLite release ando don't have to wait until 
the author of the ODBC driver releases a new version.



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


[sqlite] JDBC and sqllite 1.1

2009-01-23 Thread Alessandro Corti
The last version of the jdbc is unable to connect to my old sqllite 1.1 db.
I'm looking for a jdbc driver for sqllite 1.1.
Where can I find it?

Best regards,
Garp



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