[sqlite] Help for Garbled

2011-02-28 Thread 陈强
Dear All: I have a problem toDisturb your. Why is the Chinese i Selected from SQLIte.exe and jdbc is not different. The Chinese from JDBC(rs.getString(index)) is normal but the Chinese from Sqlite.exe (Select data) is Garbled, my environment as list: Server os: 2003 Simple Chinese Server

[sqlite] Fwd: fts virtual table questions

2011-02-28 Thread Paul Shaffer
Edit: with doing a create virtual call --> without doing a create virtual call Original Message Subject: fts virtual table questions Date: Mon, 28 Feb 2011 22:46:32 -0700 From: Paul Shaffer To: General Discussion of SQLite Database

[sqlite] fts virtual table questions

2011-02-28 Thread Paul Shaffer
I am still testing my results and am new to fts. To use fts, is "create virtual table" required every time my program runs and opens the sqlite database? I see that the table (plus a few other related fts tables) is physically present in the database after my program closes. I would prefer to not

Re: [sqlite] "select disctict" calles tcl functions twice?

2011-02-28 Thread Nico Williams
On Mon, Feb 28, 2011 at 6:23 PM, John wrote: > Reading a little more about how the vdbe works and a little of the source > code, I then examined the output of explain.  Explain shows that the > statement: > >        select distinct x, abs(x) from T ; > > First loops over my T

[sqlite] BUG: e_vacuum.test & backcompat.test need ifcapable wal

2011-02-28 Thread Noah Hart
test files have a couple of lines similar to: execsql { PRAGMA journal_mode = wal } These tests need to be bracketed with ifcapable wal ~ Noah Hart -- View this message in context: http://old.nabble.com/BUG%3A-e_vacuum.test---backcompat.test-need-ifcapable-wal-tp31037029p31037029.html Sent

Re: [sqlite] "select disctict" calles tcl functions twice?

2011-02-28 Thread John
Reading a little more about how the vdbe works and a little of the source code, I then examined the output of explain. Explain shows that the statement: select distinct x, abs(x) from T ; First loops over my T table and builds an Ephemeral table, which has an index(?) that will allow

[sqlite] Potential problem with ON CONFLICT REPLACE?

2011-02-28 Thread Carl Baldwin
Hello, I've used sqlite for a number of years now. I ran in to something over the week-end like nothing I've experienced before. An application linked against 3.6.18 corrupted one of my databases. The application did not crash or misbehave, the only reason that I discovered the problem is that

Re: [sqlite] "select disctict" calles tcl functions twice?

2011-02-28 Thread John
That doesn't really make any sense. I'm not calling "fun" from the tcl body, just in the select statement. It didn't make any difference either. Any Ideas? John On Feb 28, 2011, at 8:49 AM, Black, Michael (IS) wrote: > I think your problem may be that fun() in your eval is being called

Re: [sqlite] EXT :Re: long insert statement failing on iPhone

2011-02-28 Thread Mickey Mestel
michael, > No such thing as "close enough" when it comes to different versions. > i do agree, although having tried 3 different version with exactly the same behavior, i don't expect 3.6.23.2 to act any different, although you never know. > Can somebody find the 3.6.23.2 amalgamation

Re: [sqlite] EXT :Re: long insert statement failing on iPhone

2011-02-28 Thread Black, Michael (IS)
No such thing as "close enough" when it comes to different versions. Can somebody find the 3.6.23.2 amalgamation for this guy? Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2011 01:44 PM, Drake Wilson wrote: > I'm inclined to believe this nullifies the main argument against > forking os_unix.c in the absence of strong evidence to the contrary. Here are some broken things in VFS of varying severity where fixing

[sqlite] :Re: long insert statement failing on iPhone

2011-02-28 Thread Black, Michael (IS)
My experience says the problem/solution is probably simple...FINDING it is the hard part. You'll likely change one or two lines of code unless it's a problem with stack usage on SQlite that has changed. Anybody done any measurement on SQLite stack usage? Michael D. Black Senior Scientist NG

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Drake Wilson
Quoth Drake Wilson , on 2011-02-28 14:44:38 -0700: > Furthermore, another approach if the name<->FD thing is the only > requirement would be to retrieve all the original VFS methods at init > time (using sqlite3_vfs_find) and only alter a few of them when > registering the new

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Drake Wilson
Quoth Roger Binns , on 2011-02-28 13:03:43 -0800: > On 02/28/2011 12:41 PM, Drake Wilson wrote: > > Back on the original topic, I would rather think a custom VFS sounds > > like the way to go; > > It is technically correct that will work. However it is a *lot* of >

[sqlite] BUG: e_expr.test needs ifcapable utf16

2011-02-28 Thread Noah Hart
e_expr has a number of tests that need to have ifcapable utf16 bracketing For example: db eval { PRAGMA encoding = 'utf-16le' } do_qexpr_test e_expr-27.4.4 { CAST('ghi' AS blob) } X'670068006900' do_qexpr_test e_expr-27.4.5 { CAST(456 AS blob) } X'340035003600' do_qexpr_test e_expr-27.4.6 {

Re: [sqlite] EXT :Re: long insert statement failing on iPhone

2011-02-28 Thread Mickey Mestel
>> > > Note that this problem does /not/ happen if he accesses SQLite by calling the > version included in the iPhone frameworks. I still don't have a clue what > his problem is, but whatever it is it's not simple. correct. and i agree, it probably isn't simple:-(

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2011 12:41 PM, Drake Wilson wrote: > Back on the original topic, I would rather think a custom VFS sounds > like the way to go; It is technically correct that will work. However it is a *lot* of maintenance work. The custom VFS would be a

Re: [sqlite] EXT :Re: long insert statement failing on iPhone

2011-02-28 Thread Mickey Mestel
michael, > Well that's one you never mentioned...it works on the version with the SDK? it's on the second to last line of my original message, an easy place to miss. i should have put it in a more prominent place, as it is key. > > What version of sqlite comes with that? And why are

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Drake Wilson
Quoth Roger Binns , on 2011-02-28 12:20:04 -0800: > You could do that in Unix in many years. I shipped product in 1994 that > used it extensively (a master daemon would use accept() and then pass the > new file handles to child processes as appropriate). > > "I_SENDFD" is

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2011 11:59 AM, Robert Hairgrove wrote: > I'm only beginning to delve into the possibilities offered by the VFS > API in SQLite. However, from what I have seen so far, it seems like a > very complete abstraction to me. For one thing a SQLite

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Jay A. Kreibich
On Mon, Feb 28, 2011 at 12:20:04PM -0800, Roger Binns scratched on the wall: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 02/28/2011 11:33 AM, Richard Hipp wrote: > > and then sends over a file descriptor using IPC. > You could do that in Unix in many years. Apache 1.x depended

Re: [sqlite] EXT :Re: long insert statement failing on iPhone

2011-02-28 Thread Simon Slavin
On 28 Feb 2011, at 7:36pm, Black, Michael (IS) wrote: > Well that's one you never mentioned...it works on the version with the SDK? > > What version of sqlite comes with that? And why are you upgrading sqlite? Note that this problem does /not/ happen if he accesses SQLite by calling the

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2011 11:33 AM, Richard Hipp wrote: > and then sends > over a file descriptor using IPC. (I didn't know you could do that in > unix. In fact, I bet it requires a linux-only extension of some kind. > Correct me if I'm wrong.) You could do

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Robert Hairgrove
On Mon, 2011-02-28 at 14:33 -0500, Richard Hipp wrote: > On Mon, Feb 28, 2011 at 1:00 PM, Paweł Hajdan, Jr. [many interesting things snipped ...] > wrote: > > What do you think about adding a call like below to the VFS interface? > > > > int (*xOpenWrapper)(const char

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Richard Hipp
On Mon, Feb 28, 2011 at 2:33 PM, Richard Hipp wrote: > > > On Mon, Feb 28, 2011 at 1:00 PM, Paweł Hajdan, Jr. < > phajdan...@chromium.org> wrote: > >> >> What do you think about adding a call like below to the VFS interface? >> >> int (*xOpenWrapper)(const char *path, int flags,

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Richard Hipp
On Mon, Feb 28, 2011 at 1:00 PM, Paweł Hajdan, Jr. wrote: > On Mon, Feb 28, 2011 at 15:12, Richard Hipp wrote: > >> On Mon, Feb 28, 2011 at 8:36 AM, Paweł Hajdan, Jr. < >> phajdan...@chromium.org> wrote: >> >>> >>> I remember a part of earlier discussion

Re: [sqlite] EXT :Re: long insert statement failing on iPhone

2011-02-28 Thread Black, Michael (IS)
Well that's one you never mentioned...it works on the version with the SDK? What version of sqlite comes with that? And why are you upgrading sqlite? Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From:

Re: [sqlite] long insert statement failing on iPhone

2011-02-28 Thread Mickey Mestel
simon, > > The theory is that you are actually doing something wrong in your code, and > this triggers obvious problems on the iPhone itself because the iPhone itself > is so tight on space. However the simulator doesn't uncover these problems > because it has plenty of memory and stack

Re: [sqlite] long insert statement failing on iPhone

2011-02-28 Thread Simon Slavin
On 28 Feb 2011, at 5:39pm, Mickey Mestel wrote: > dan, >> >> I've have never tried this. But if I had the problem above, I would. >> >> http://landonf.bikemonkey.org/code/iphone/iPhone_Simulator_Valgrind.20081224.html > > looks interesting, but it doesn't support arm, which is where the

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Paweł Hajdan , Jr .
On Mon, Feb 28, 2011 at 15:12, Richard Hipp wrote: > On Mon, Feb 28, 2011 at 8:36 AM, Paweł Hajdan, Jr. < > phajdan...@chromium.org> wrote: > >> >> I remember a part of earlier discussion that there is a problem with >> journal and possibly other auxiliary files, i.e. we can't

Re: [sqlite] long insert statement failing on iPhone

2011-02-28 Thread Mickey Mestel
dan, > > I've have never tried this. But if I had the problem above, I would. > > > http://landonf.bikemonkey.org/code/iphone/iPhone_Simulator_Valgrind.20081224.html looks interesting, but it doesn't support arm, which is where the problem is showing up. the problem doesn't occur in

Re: [sqlite] long insert statement failing on iPhone

2011-02-28 Thread Dan Kennedy
On 02/26/2011 09:37 AM, Mickey Mestel wrote: > hi all, > > new to the list. > > we are compiling the sqlite.c amalgamation file into our project, as we > want to encrypt the database, and the sqlite that comes with the iOS sdk does > not allow for that. > > we are developing on

Re: [sqlite] long insert statement failing on iPhone

2011-02-28 Thread Mickey Mestel
michael, just getting into it, but... > Did you increase the main thread size too? i'm sure it's there, but i don't see a way to mess with the stack size on the main thread. docs say that (for a secondary thread, doesn't mention the main thread), that in order to be

Re: [sqlite] COUNT() extremely slow first time!

2011-02-28 Thread Black, Michael (IS)
Did you do multiple runs and average? And how are you measuring time? Did you do buffered reads? And you're MB/sec isn't accurate for the count() test. I think it was already said that count() doesn't read the entire record. The SQLite numbers are due to SQLite caching. If you make page

Re: [sqlite] EXT :Re: COUNT() extremely slow first time!

2011-02-28 Thread Max Vlasov
Michael, it's an interesting hypothesis. Maybe you can describe the following results. Recently I made a test program that just reads a file sequentially with different block sizes and results are still confusing. This was the same SSD drive and the functions were basically from api:

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Richard Hipp
On Mon, Feb 28, 2011 at 8:36 AM, Paweł Hajdan, Jr. wrote: > > I remember a part of earlier discussion that there is a problem with > journal and possibly other auxiliary files, i.e. we can't create/open them > just based on one file descriptor. > Right. If you call

Re: [sqlite] "select disctict" calles tcl functions twice?

2011-02-28 Thread Black, Michael (IS)
I think your problem may be that fun() in your eval is being called both from tcl and from sqlite. Name your proc fun2 and the problem will probably go away. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From:

Re: [sqlite] EXT :Re: COUNT() extremely slow first time!

2011-02-28 Thread Black, Michael (IS)
Those numbers make sense to me. Since count is doing a linear walk throughcorrect? #1 SSDs more than likely don't do "read ahead" like a disk drive. So what you're seeing is what read-ahead does for you. #2 Count is doing a linear scan of the table...Probability of 2K containing the next

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Paweł Hajdan , Jr .
2011/2/28 Richard Hipp > On Mon, Feb 28, 2011 at 7:39 AM, Paweł Hajdan, Jr. < > phajdan...@chromium.org> wrote: > >> I'd like to add an equivalent of fdopen to the sqlite's VFS ( >> http://www.sqlite.org/c3ref/vfs.html). The signature would similar to >> this: >> >> int

Re: [sqlite] long insert statement failing on iPhone

2011-02-28 Thread Black, Michael (IS)
Did you increase the main thread size too? I would bump them both up by a LOT. A 2X change might not be enough. The simulator might grow the stack in a different direction so it's just not visible. Can you turn on stack checking in the compiler? Or stack-usage? If it's not the stack

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Richard Hipp
On Mon, Feb 28, 2011 at 7:39 AM, Paweł Hajdan, Jr. wrote: > I'd like to add an equivalent of fdopen to the sqlite's VFS ( > http://www.sqlite.org/c3ref/vfs.html). The signature would similar to > this: > > int (*xFdOpen)(sqlite3_vfs*, int fd, sqlite3_file*, int flags, int

[sqlite] adding fdopen to VFS?

2011-02-28 Thread Paweł Hajdan , Jr .
I'd like to add an equivalent of fdopen to the sqlite's VFS ( http://www.sqlite.org/c3ref/vfs.html). The signature would similar to this: int (*xFdOpen)(sqlite3_vfs*, int fd, sqlite3_file*, int flags, int *pOutFlags); This would be needed to cleanly implement fd-passing in Chromium, from the

Re: [sqlite] Need help to confirm my understanding on Foreign Key indexes

2011-02-28 Thread Simon Slavin
On 28 Feb 2011, at 9:41am, rf rf wrote: > Looking at the documentation for the latest version I think I understand that > I must define indexes for all foreign keys, manually, with UNIQUE as > described in the documentation. If I don't then the database will give me an > immediate or

Re: [sqlite] Bug Report - undefined function as a default value cause segmentation fault.

2011-02-28 Thread Richard Hipp
On Sun, Feb 27, 2011 at 7:19 AM, raz daz wrote: > When setting an undefined function as a default value, subsequent inserts > cause a segmentation fault. > > POC: > sqlite3 poc.db "CREATE TABLE log (name char(30), ts datetime > DEFAULT(ff())); > insert into log (name)

[sqlite] Need help to confirm my understanding on Foreign Key indexes

2011-02-28 Thread rf rf
Looking at the documentation for the latest version I think I understand that I must define indexes for all foreign keys, manually, with UNIQUE as described in the documentation.  If I don't then the database will give me an immediate or deferred error.  These Foreign Key indexes are NOT

[sqlite] Bug Report - undefined function as a default value cause segmentation fault.

2011-02-28 Thread raz daz
When setting an undefined function as a default value, subsequent inserts cause a segmentation fault. POC: sqlite3 poc.db "CREATE TABLE log (name char(30), ts datetime DEFAULT(ff())); insert into log (name) values('xxx');" ___ sqlite-users mailing list

Re: [sqlite] Problem with VACUUM feature

2011-02-28 Thread Sudha Venkatareddy
Hi, As per the link http://www.sqlite.org/lang_vacuum.html , SQLite claims that "*The VACUUM command works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file*." In this phrase "*The VACUUM command works