Re: [sqlite] behavior of "collate" on views changed from 3.6.2 to 3.6.16 and beyond - intentional?

2009-11-18 Thread Vasu Nori
try using a user-defined collation function I included in the post. here it is again. static int twocaseCollatingFunc(void *NotUsed, int n1, const void *v1, int n2, const void *v2) { if (n1 < 2 || n2 < 2) { printf ("lengths are smaller than 2: n1 = %d, n2 = %d\n", n1, n2); return 0;

Re: [sqlite] Suggested user-defined-function example

2009-11-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Walter Dnes wrote: > It didn't help me because it used only one parameter. It didn't say > anything about you > - *MUST NOT* have commas between parameters in the function definition That is standard TCL rules and has nothing to do with SQLite. >

Re: [sqlite] behavior of "collate" on views changed from 3.6.2 to 3.6.16 and beyond - intentional?

2009-11-18 Thread Dan Kennedy
On Nov 19, 2009, at 6:40 AM, Vasu Nori wrote: > I am noticing a behavior change in processing of "collate" from > 3.6.2 to > versions 3.6.16 & beyond. > it *could* make sense but I find some inconsistencies.. let me > explain. > > 1. create a simple collation function which compares two

[sqlite] Suggested user-defined-function example

2009-11-18 Thread Walter Dnes
Whilst trying to get a TCL script to create a function in SQLite I ran into problems and did a lot of Googling. I got very tired of seeing the same old same old... proc sql_sqrt {x} {return [expr {sqrt($x)}]} db function sqrt sql_sqrt It didn't help me because it used only one parameter.

Re: [sqlite] Asynchronous I/O and shared cache

2009-11-18 Thread Dan Kennedy
On Nov 18, 2009, at 10:03 PM, Pavel Ivanov wrote: > I don't know what Dan meant by his words but AFAIK there's no mutex > making exclusive grab of shared cache by sqlite3_step() call. There is > only mutex making sqlite3_step() execution exclusive for connection > object. I meant the mutex that

Re: [sqlite] sqlite3_value_type question

2009-11-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jean-Christophe Deschamps wrote: > can we rely on testing for the 5 datatypes reliably? Yes, it will only be one of the 5 types. > I understand that when the argument comes from a column, then the type > returned by sqlite3_value_type() is the

[sqlite] sqlite3_value_type question

2009-11-18 Thread Jean-Christophe Deschamps
When the argument to sqlite3_value_type() is either a litteral or a result of some scalar function, can we rely on testing for the 5 datatypes reliably? I understand that when the argument comes from a column, then the type returned by sqlite3_value_type() is the column type. But litterals

[sqlite] behavior of "collate" on views changed from 3.6.2 to 3.6.16 and beyond - intentional?

2009-11-18 Thread Vasu Nori
I am noticing a behavior change in processing of "collate" from 3.6.2 to versions 3.6.16 & beyond. it *could* make sense but I find some inconsistencies.. let me explain. 1. create a simple collation function which compares two input strings based on just the second char (code is at the end of

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim Romano wrote: > I respectfully disagree, Roger, about the simplicity. Creating an > external DLL would complicate my distribution scenario significantly > because I'll have just as many users of my little database application > working with

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Simon Slavin
On 18 Nov 2009, at 9:27pm, Roger Binns wrote: > A C function of your choosing can be called on each new connection being > created:[snip] Thanks for your detailed answer. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Igor Tandetnik
Tim Romano wrote: > I respectfully disagree, Roger, about the simplicity. Creating an > external DLL would complicate my distribution scenario significantly > because I'll have just as many users of my little database > application working with Apple OSX as with Windows.

Re: [sqlite] Enable fts?

2009-11-18 Thread P Kishor
On Wed, Nov 18, 2009 at 4:28 PM, Grzegorz Wierzchowski wrote: > Wednesday 18 of November 2009 09:39:27 Trung Nguyen Duc napisał(a): >> Hi all, >> How can I enable fts1 or fts2 modules? >> Do I need any changes in configure.ac or Makefile.in? >>

Re: [sqlite] Enable fts?

2009-11-18 Thread Grzegorz Wierzchowski
Wednesday 18 of November 2009 09:39:27 Trung Nguyen Duc napisał(a): > Hi all, > How can I enable fts1 or fts2 modules? > Do I need any changes in configure.ac or Makefile.in? > ___ > sqlite-users mailing list > sqlite-users@sqlite.org >

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Tim Romano
Apologies. An accident -- I was trying to grab the To: address from a previous email and didn't realize there was a big thing attached. I don't see anything attached to this one. I hope there isn't. Tim Romano Jean-Christophe Deschamps wrote: > > Please don't set the ReplyTo field to the list

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Tim Romano
I respectfully disagree, Roger, about the simplicity. Creating an external DLL would complicate my distribution scenario significantly because I'll have just as many users of my little database application working with Apple OSX as with Windows. I guarantee you, it would be easier for the

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simon Slavin wrote: > I googled, and there doesn't seem to be a page which describes the abilities > and limitations the extension system has. A C function of your choosing can be called on each new connection being created:

Re: [sqlite] listing free bytes in sqlite files

2009-11-18 Thread Jay A. Kreibich
On Wed, Nov 18, 2009 at 08:31:24PM -, Matt scratched on the wall: > Hello, > > Given a sqlite database file I would like to create two lists: one of > bytes which are in use and one of bytes which are "free". > What would be the most efficient way to do this? You have to define "free."

Re: [sqlite] listing free bytes in sqlite files

2009-11-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt wrote: > Given a sqlite database file I would like to create two lists: one of bytes > which are in use and one of bytes which are "free". > What would be the most efficient way to do this? What are you actually trying to achieve? If you are

Re: [sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread Simon Slavin
On 18 Nov 2009, at 8:38pm, priimak wrote: > I understand that. However, that would not present a problem if I access > database by its symlink for reading only and database directly if I am > updating isn't? According to the documentation that could be a problem. The update application

Re: [sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread priimak
Pavel Ivanov wrote: >> That should not be a problem if I use symlink to access database for >> reads only and >> actual db file name for updating, isn't? >> > > I believe there can be a problem with such scenario. I don't know > exactly but I doubt that file system can operate with locks on

Re: [sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread priimak
Simon Slavin wrote: > On 18 Nov 2009, at 7:15pm, priimak wrote: > > >> I see. However, the problem is related to journal been named after the >> database name. >> That should not be a problem if I use symlink to access database for >> reads only and >> actual db file name for updating, isn't?

Re: [sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread Pavel Ivanov
> That should not be a problem if I use symlink to access database for > reads only and > actual db file name for updating, isn't? I believe there can be a problem with such scenario. I don't know exactly but I doubt that file system can operate with locks on file handle open via symlink and via

Re: [sqlite] listing free bytes in sqlite files

2009-11-18 Thread Simon Slavin
On 18 Nov 2009, at 8:31pm, Matt wrote: > Given a sqlite database file I would like to create two lists: one of bytes > which are in use and one of bytes which are "free". > What would be the most efficient way to do this? > > I have taken a look over the file format documentation but can't see

[sqlite] listing free bytes in sqlite files

2009-11-18 Thread Matt
Hello, Given a sqlite database file I would like to create two lists: one of bytes which are in use and one of bytes which are "free". What would be the most efficient way to do this? I have taken a look over the file format documentation but can't see a clear way to achieve this. Thanks,

Re: [sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread Simon Slavin
On 18 Nov 2009, at 7:15pm, priimak wrote: > I see. However, the problem is related to journal been named after the > database name. > That should not be a problem if I use symlink to access database for > reads only and > actual db file name for updating, isn't? If you use a symbolic link for

Re: [sqlite] Disk activity on Linux

2009-11-18 Thread Bret Patterson
Thanks Walter and Paul I'll look into the things you pointed out and let you guys know how it turns out. Open Source approval at IBM is version specific and the approval process is quite a bit of work so I'd like to avoid it as long as possible. Bret Patterson

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Simon Slavin
On 18 Nov 2009, at 6:05pm, Roger Binns wrote: > Tim Romano wrote: >> This would be a convenient function to have. Are there technical >> issues/obstacles? > > In general for all these feature requests for more functions there is no > need for them to be added to the SQLite core. There is a

Re: [sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread priimak
D. Richard Hipp wrote: > On Nov 18, 2009, at 1:53 PM, priimak wrote: > > >> Hi. >> >> I have a strange problem. I have a database a.db.1 and symlink a.db >> which points to a.db.1 >> When I use command line sqlite3 command I get following. >> >> % echo "select max(id) from t;" | sqlite3 a.db.1

Re: [sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread D. Richard Hipp
On Nov 18, 2009, at 1:53 PM, priimak wrote: > Hi. > > I have a strange problem. I have a database a.db.1 and symlink a.db > which points to a.db.1 > When I use command line sqlite3 command I get following. > > % echo "select max(id) from t;" | sqlite3 a.db.1 > SQL error near line 1: disk I/O

[sqlite] SQL error: disk I/O error and symlink

2009-11-18 Thread priimak
Hi. I have a strange problem. I have a database a.db.1 and symlink a.db which points to a.db.1 When I use command line sqlite3 command I get following. % echo "select max(id) from t;" | sqlite3 a.db.1 SQL error near line 1: disk I/O error but % echo "select max(id) from t;" | sqlite3 a.db

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim Romano wrote: > This would be a convenient function to have. Are there technical > issues/obstacles? In general for all these feature requests for more functions there is no need for them to be added to the SQLite core. There is a very simple

Re: [sqlite] bad data in a database file or bug?

2009-11-18 Thread Vasu Nori
On Wed, Nov 18, 2009 at 4:06 AM, D. Richard Hipp wrote: > > On Nov 17, 2009, at 9:49 PM, D. Richard Hipp wrote: > > > > > On Nov 17, 2009, at 9:45 PM, Vasu Nori wrote: > >> > >> sqlite> SELECT _id, typeof(_id) FROM feeds; > >> 1|integer > >> 2|integer > >> 3|integer > >>

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Pavel Ivanov
> The blob (x'41' is a blob literal) is expected to contain a UTF-8 sequence, I > believe. I think it should be a database encoding which is either UTF-8 or UTF-16. So for Tim's case if his database encoding is UTF-16 insert statement can be like this: insert test (id, myTextColumn) values(1,

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Jean-Christophe Deschamps
Hi Igor, >The blob (x'41' is a blob literal) is expected to contain a UTF-8 >sequence, I believe. That means the user enters the hex UTF-8 (or 16 depending on base encoding) representation of the character. E.g.: select cast(x'c389' as text); É Something like: select chrw(x'c9');

Re: [sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Igor Tandetnik
Tim Romano wrote: > I wanted to get a clearer sense of how SQLite treats decomposed > Unicode characters (http://unicode.org/faq/char_combmark.html#2) in > its various string functions and with the concatenation operator yet > there doesn't > seem to be any way to get them

Re: [sqlite] Asynchronous I/O and shared cache

2009-11-18 Thread Pavel Ivanov
I don't know what Dan meant by his words but AFAIK there's no mutex making exclusive grab of shared cache by sqlite3_step() call. There is only mutex making sqlite3_step() execution exclusive for connection object. Pavel On Wed, Nov 18, 2009 at 8:40 AM, presta wrote: > > I'm

[sqlite] another Feature Request: char from codepoint?

2009-11-18 Thread Tim Romano
I wanted to get a clearer sense of how SQLite treats decomposed Unicode characters (http://unicode.org/faq/char_combmark.html#2) in its various string functions and with the concatenation operator yet there doesn't seem to be any way to get them into the database using the SQlite3.EXE

Re: [sqlite] Asynchronous I/O and shared cache

2009-11-18 Thread presta
I'm confused according to Dan Kennedy : "Each shared-cache has its own mutex. The mutex is held for the duration of each sqlite3_step() call. So the way you're defining it here, you can't have "real" concurrency when using shared-cache mode in any case. " So, it's a little bit "antagonist" to

Re: [sqlite] Asynchronous I/O and shared cache

2009-11-18 Thread Pavel Ivanov
Shared cache instance is created on file-by-file basis, i.e. if you open connections to file1.db and file2.db they will have different cache instances and any manipulations with these database files won't influence one another at all (any write operations can be executed in parallel). But if you

Re: [sqlite] Asynchronous I/O and shared cache

2009-11-18 Thread presta
To be more precise I would like to parallelize writes operations on different tables, so potentially in different db (files). It's why I think about using multi databases (1 by table), the shared cache system and the asynchronized I/O.. So if a shared cache is shared accross different

Re: [sqlite] Asynchronous I/O and shared cache

2009-11-18 Thread Pavel Ivanov
>> So, does it possible to have more than one shared cache within a single >> process ? > > Open the same database twice, using two different handles. At least I think > it will work. Nope, it won't. That's the purpose of shared cache: if you open the same database several times with different

Re: [sqlite] bad data in a database file or bug?

2009-11-18 Thread D. Richard Hipp
On Nov 17, 2009, at 9:49 PM, D. Richard Hipp wrote: > > On Nov 17, 2009, at 9:45 PM, Vasu Nori wrote: >> >> sqlite> SELECT _id, typeof(_id) FROM feeds; >> 1|integer >> 2|integer >> 3|integer >> 4|integer >> 5|integer >> 6|integer >> 7|integer >> 8|integer >> 9|integer >> 10|integer >> 11|integer

[sqlite] Problem passing SQLite field values to TCL function

2009-11-18 Thread Walter Dnes
I start off passing a central latitude ($lat_degrees) and longitude ($long_degrees) and a radius ($radius) to a TCL script. Using the spherical cosine law to calculate distance, I want to select all sites in a table within that given radius. Here are 2 code fragments from the script...

Re: [sqlite] Asynchronous I/O and shared cache

2009-11-18 Thread presta
Thanks, I will try to use the shared cache with Async I/O "Each shared-cache has its own mutex"... So, does it possible to have more than one shared cache within a single process ? One shared cache by db ? -- View this message in context:

[sqlite] Enable fts?

2009-11-18 Thread Trung Nguyen Duc
Hi all, How can I enable fts1 or fts2 modules? Do I need any changes in configure.ac or Makefile.in? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users