Re: [sqlite] Doesn't update return wrong code while there isn't record in table?
Thank you for you reply, :) But I see the return errmsg is "unknown error" on sqlite3.6.23-1. What does it mean? Kees Nuyt wrote: > > On Mon, 24 May 2010 01:27:05 -0700 (PDT), liubin liu > <7101...@sina.com> wrote: > > >> Doesn't update return wrong code while >> there isn't record in table? > > No. Your update tells SQLite to update all rows in the > selection. It did. In this case "all" meaning zero, but that > is not an error. Think of it as executing a mathematical set > function on an empty set. An set being empty is normal, not > an error. > >>Is it normal action? > > Yes. It's common in most if not all SQL database systems. > > The number of rows affected can be retrieved with the > sqlite3_changes() function. > http://www.sqlite.org/lang_corefunc.html > -- > ( Kees Nuyt > ) > c[_] > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://old.nabble.com/Doesn%27t-update-return-wrong-code-while-there-isn%27t-record-in-table--tp28654671p28663384.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
Re: [sqlite] network access problem
>Running in sqlite application in Virtual Box, attempt to open a >database with sqlite from a shared network folder >\\Vboxsvr\testdata however the open16 and openv2 (with read >only) both fail --- rc = 14. File opens file if moved locally to >hard drive. > >using latest version of sqlite3 3.6.23.1 > >this seems to be a bug in the open code of sqlite when accessing a >file across a network. I don't believe so: I use several bases which I open with MS short UNC syntax 200 times a day without any problem ever (using vanilla 3.6.23.1). Your issue is elsewhere. Make sure the account you use has enough rights to the destination folder and check you can access it with, for instance, a innocent application like a hex editor or a third-party SQLite manager. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] network access problem
On Mon, 24 May 2010 11:28:04 -0700 (PDT), Art wrote: >Running in sqlite application in Virtual Box, attempt to open a database >with sqlite from a shared network folder \\Vboxsvr\testdata >however the open16 and openv2 (with read only) both fail --- rc = 14. >File opens file if moved locally to hard drive. > >using latest version of sqlite3 3.6.23.1 > >this seems to be a bug in the open code of sqlite when accessing >a file across a network. A VBox shared folder is not exactly the best example of "sharing over a network". The purpose of shared folders is to copy files to and from virtual machines in an easy way. I think the locking primitives of VBox shared folders are not 100%. You could try again with NFSv4. >Thank you, > >Art Zerger > >azer...@yahoo.com -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Index not used in simple alias-like views
Op 24-mei-2010, om 17:59 heeft Dan Kennedy het volgende geschreven: > > On May 24, 2010, at 6:14 PM, Edzard Pasma wrote: > >> Hello, I found a blind spot of the query optimizer. This appears when >> a table is accessed as a view. I think the problem can be phrased as >> "the optimizer failing to push an outer join predicate into a >> view"... This simply means that the following example does not use >> the existing index: >> >> create table t (pk integer primary key); >> create table t2 (fk); >> create view v as select * from t; >> select * from t2 left outer join v on pk = fk; > > Not using the index because of point 3 on this list I would say: > >http://www.sqlite.org/optoverview.html#flattening > Sorry for considering this a shortcoming. By the way, this was observed with version 3.6.23.1. The recently proposed optimizer changes appear to relieve this situation as this is a case for an automatic index. Cheers. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] network access problem
I just tried -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: Monday, May 24, 2010 2:37 PM From: sqlite-users-boun...@sqlite.org on behalf of Art Sent: Mon 5/24/2010 1:28 PM To: sqlite-users@sqlite.org Subject: [sqlite] network access problem Running in sqlite application in Virtual Box, attempt to open a database with sqlite from a shared network folder \\Vboxsvr\testdata however the open16 and openv2 (with read only) both fail --- rc = 14. File opens file if moved locally to hard drive. using latest version of sqlite3 3.6.23.1 this seems to be a bug in the open code of sqlite when accessing a file across a network. Thank you, Art Zerger azer...@yahoo.com === Hi Art, I just succeeded in opening a db with a UNC path, under Windows XP Pro, using the same version (3.6.23.1) with the command-line utility -- but I do NOT use virtual box. Does the command-line utility fail for you under virtual box? Might you attempt it without virtualbox? Donald ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] network access problem
That's not a valid file path for open(). You need to mount the share as a drive before you can use it. Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org on behalf of Art Sent: Mon 5/24/2010 1:28 PM To: sqlite-users@sqlite.org Subject: [sqlite] network access problem Running in sqlite application in Virtual Box, attempt to open a database with sqlite from a shared network folder \\Vboxsvr\testdata however the open16 and openv2 (with read only) both fail --- rc = 14. File opens file if moved locally to hard drive. using latest version of sqlite3 3.6.23.1 this seems to be a bug in the open code of sqlite when accessing a file across a network. Thank you, Art Zerger azer...@yahoo.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] network access problem
Running in sqlite application in Virtual Box, attempt to open a database with sqlite from a shared network folder \\Vboxsvr\testdata however the open16 and openv2 (with read only) both fail --- rc = 14. File opens file if moved locally to hard drive. using latest version of sqlite3 3.6.23.1 this seems to be a bug in the open code of sqlite when accessing a file across a network. Thank you, Art Zerger azer...@yahoo.com ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Index not used in simple alias-like views
On May 24, 2010, at 6:14 PM, Edzard Pasma wrote: > Hello, I found a blind spot of the query optimizer. This appears when > a table is accessed as a view. I think the problem can be phrased as > "the optimizer failing to push an outer join predicate into a > view"... This simply means that the following example does not use > the existing index: > > create table t (pk integer primary key); > create table t2 (fk); > create view v as select * from t; > select * from t2 left outer join v on pk = fk; Not using the index because of point 3 on this list I would say: http://www.sqlite.org/optoverview.html#flattening ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Strange SQLITE_FULL error
If you'll note in the code it does set lastErrno to the GetLastError() return. Hopefully you have control of the code so you can add an "sqlite3_file_control" call to see what's going on. You should be able to do this when you get the SQLITE3_FULL return code. int errnum; sqlite3_file_control(sqlite3*, SQLITE_LAST_ERRNO,&errnum); Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org on behalf of John Wood Sent: Mon 5/24/2010 5:49 AM To: sqlite-users@sqlite.org Subject: [sqlite] Strange SQLITE_FULL error I'm coming accross a weird error from some deployed code. Several users occassionaly get an unexpected SQLITE_FULL error on calls to sqlite3_step(). It happens infrequently, and I've not been able to reproduce. First some background: - Windows only (seen on XP and Vista) - sqlite version 3.6.23 - Using Shared Cached Mode - Using Read Uncommitted mode - Not using temporary tables - Compiled with SQLITE_THREADSAFE=2 I know for a fact that these users have plenty of HD space (the crash report diagnostics show this). Although I can't rule out a "too large" DB, I'd be astonished if it was too large either in size or row count (we're only talking maximum 100,000's rows, not millions). Always, the users are able to restart and carry on without problems, suggesting this is a transitory issue. What's interesting is that, to my mind, the windows specific code in "winWrite" and "winRead" seems a bit liberal about how it generates SQLITE_FULL errors: it seems to return them simply if a call to SetFilePointer() fails, regardless of the error returned, or if it can't write the expected number of bytes. So, I'm speculating that in my case SQLITE_FULL might actually be because of an IO error which SQLite is incorrectly interpreting? Or if not an IO error, then a system resources problem (I have some other anecdotal evidence to suggest other crashes are related to low system resources). Can anyone concur with this, or suggest other possibilities? Thanks, John ___ 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] Index not used in simple alias-like views
Hello, I found a blind spot of the query optimizer. This appears when a table is accessed as a view. I think the problem can be phrased as "the optimizer failing to push an outer join predicate into a view"... This simply means that the following example does not use the existing index: create table t (pk integer primary key); create table t2 (fk); create view v as select * from t; select * from t2 left outer join v on pk = fk; I hope I may call this a shortcoming of the optimizer and that it will be changed is some future version. Best regards, Edzard. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Strange SQLITE_FULL error
I'm coming accross a weird error from some deployed code. Several users occassionaly get an unexpected SQLITE_FULL error on calls to sqlite3_step(). It happens infrequently, and I've not been able to reproduce. First some background: - Windows only (seen on XP and Vista) - sqlite version 3.6.23 - Using Shared Cached Mode - Using Read Uncommitted mode - Not using temporary tables - Compiled with SQLITE_THREADSAFE=2 I know for a fact that these users have plenty of HD space (the crash report diagnostics show this). Although I can't rule out a "too large" DB, I'd be astonished if it was too large either in size or row count (we're only talking maximum 100,000's rows, not millions). Always, the users are able to restart and carry on without problems, suggesting this is a transitory issue. What's interesting is that, to my mind, the windows specific code in "winWrite" and "winRead" seems a bit liberal about how it generates SQLITE_FULL errors: it seems to return them simply if a call to SetFilePointer() fails, regardless of the error returned, or if it can't write the expected number of bytes. So, I'm speculating that in my case SQLITE_FULL might actually be because of an IO error which SQLite is incorrectly interpreting? Or if not an IO error, then a system resources problem (I have some other anecdotal evidence to suggest other crashes are related to low system resources). Can anyone concur with this, or suggest other possibilities? Thanks, John ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] [lcc32] "sqlite3.c:6597 Character constant taken as not signed"
On Fri, 21 May 2010 21:32:13 -0400, Rich Rattanni wrote: >BloodShed Dev-C++ and ming? My choice for windows development. > >On Fri, May 21, 2010 at 11:01 AM, Richard Hipp wrote: >> This appears to be a bug in your compiler. The compiler is segfaulting. >> Can you use a different compiler? Sure, I'll try DevC++ and Ming. Thank you. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Doesn't update return wrong code while there isn't record in table?
On Mon, 24 May 2010 01:27:05 -0700 (PDT), liubin liu <7101...@sina.com> wrote: > Doesn't update return wrong code while > there isn't record in table? No. Your update tells SQLite to update all rows in the selection. It did. In this case "all" meaning zero, but that is not an error. Think of it as executing a mathematical set function on an empty set. An set being empty is normal, not an error. >Is it normal action? Yes. It's common in most if not all SQL database systems. The number of rows affected can be retrieved with the sqlite3_changes() function. http://www.sqlite.org/lang_corefunc.html -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] What languages can include SQLite statically?
Gilles, For Delphi I successfully used files from http://www.aducom.com to statically link sqlite files compiled with bcc (Borland command-line c compiler freely available now) with Delphi. Also the components of aducom.com will allow you to use all the power of Delphi database components with the sqlite without necessity to provide any additional dlls. But there are some adjustments needed, if you use c run-time from msvcrt dll (the forum at aducom.com shows how to do this), no other actions needed. But if you want to be free from msvcrt dependency, you can use c-runtime object files also available on aducom.com, but the version I used had a serious bug, Albert (from aducom.com) promised to fix on the site, probably you can use it as of now. Max maxerist.net On Fri, May 21, 2010 at 1:31 PM, Gilles Ganault wrote: > Hello > > My C skills are very basic. I was wondering: After compiling SQLite > into an .OBJ or .LIB file, what languages can be used to include this > output into a main program, so we end up with a single EXE. > > I assume we have the choice of: > - C > - C++ > - Delphi (?) > - Other? > > Thank you. > > ___ > 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] Doesn't update return wrong code while there isn't record in table?
Doesn't update return wrong code while there isn't record in table? Is it normal action? _code__ #include #include void create_db (void); int main (void) { int ret = -1; create_db (); sqlite3 *db = NULL; ret = sqlite3_open ("test.db", &db); sqlite3_stmt *p_stmt = NULL; ret = sqlite3_prepare_v2 (db, "UPDATE t1 SET id=12, d111='hello'", -1, &p_stmt, NULL); printf ("sqlite3_prepare_v2(): %d, %s\n", ret, sqlite3_errmsg(db)); ret = sqlite3_step (p_stmt); printf ("sqlite3_step(): %d, %s\n", ret, sqlite3_errmsg(db)); ret = sqlite3_finalize (p_stmt); printf ("sqlite3_finalize(): %d, %s\n", ret, sqlite3_errmsg(db)); ret = sqlite3_close (db); return 0; } void create_db (void) { int ret = -1; sqlite3 *db = NULL; ret = sqlite3_open ("test.db", &db); ret = sqlite3_exec (db, "CREATE TABLE t1 (id INTEGER PRIMARY KEY, d111 TEXT)", NULL,NULL,NULL); ret = sqlite3_close (db); } run result___ In Fedora-7.0, SQLite version 3.4.2, the result is: [t...@localhost sqlite3]$ ./sqlite3update sqlite3_prepare_v2(): 0, not an error sqlite3_step(): 101, not an error sqlite3_finalize(): 0, not an error [t...@localhost sqlite3]$ In my dev-board, SQLite version 3.6.23.1, the result is: [/usr1/bin]# ./sqlite3update sqlite3_prepare_v2(): 0, not an error sqlite3_step(): 101, unknown error sqlite3_finalize(): 0, not an error [/usr1/bin]# -- View this message in context: http://old.nabble.com/Doesn%27t-update-return-wrong-code-while-there-isn%27t-record-in-table--tp28654671p28654671.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