Re: [sqlite] Is version 3 seriously broken?
Jakub, the "official" sqlite version isn't broken, it's the WinCE port that is. I decided to announce that in the SQLite-WinCE page so people wouldn't expect it to just work. There are other issues with the WinCE port (like the Unicode handling, and that is also in the official version), but this is serious enough because it crashes (with a stack overflow exception) after inserting just 113 rows (and always 113 rows). My guess is that the official version allocated too much stack space, resulting in that exception. --- I now have tested the same program with SQLite v3.0.5 (inserted 5 rows) and the problem disappeared. So something was corrected in the source code that makes it use less stack. I would advise you to wait until I commit those changes to CVS and make a new release so you can try by yourself. I annexed your test program (with your bugs corrected), so you can check it works now. Regards, ~Nuno Lucas /* BUG: the right header to include is "sqlite3.h". "sqliteint.h" is an internal header and can't be used safelly */ /*/ #include #include #include #include bool TestExecuter( sqlite3 *db_hnd, char *query, ... ) { // char **_result_set; // int _n_row=0; // int _n_col=0; // char *_error_msg; va_list tmp_args; va_start( tmp_args, query ); char *tmp_query = sqlite3_vmprintf( query, tmp_args ); sqlite3_stmt * stmt = 0; const char* tail; // int tmp_ec = sqlite3_get_table( db_hnd, tmp_query, &_result_set, &_n_row, &_n_col, &_error_msg ); if ( sqlite3_prepare( db_hnd, tmp_query, strlen(tmp_query), , ) ) { OutputDebugString( _T("sqlite3_prepare: error\n") ); return false; } int rc = sqlite3_step( stmt ); switch ( rc ) { case SQLITE_ROW : // First row ready break; case SQLITE_DONE: // Ok, simply no results for this command break; default : // Some error OutputDebugString( (LPCWSTR)sqlite3_errmsg16(db_hnd) ); } rc = sqlite3_finalize( stmt ); if ( rc != SQLITE_OK ) OutputDebugString( (LPCWSTR)sqlite3_errmsg16(db_hnd) ); // Libero la query. sqlite3_free(tmp_query); /** BUG: no release of result set */ // sqlite3_free_table( _result_set ); /**/ // if ( (_n_row == -1) || (_error_msg != NULL) ) // { // TCHAR buf[512]; // _stprintf( buf, _T("Query Failed! - errmsg: %hs\n"), _error_msg ); // OutputDebugString( buf ); // /** BUG: no release of error message */ // sqlite3_free( _error_msg ); // /**/ // } // speedup things while testing // else // OutputDebugString( "Query Ok!\n" ); /** BUG: no va_end(tmp_args) */ va_end( tmp_args ); /**/ // return (_n_row == -1) || (_error_msg != NULL); return rc == SQLITE_OK; } int Test_Insert2(sqlite3 *db_hnd) { // Create some tables with data that we can select against TestExecuter( db_hnd, "CREATE TABLE d1(n int, log int)" ); TestExecuter( db_hnd, "BEGIN" ); char tmp_str[256]; for (int i=1;i<=5;i++) { // for ( int j=0; (1 << j) < i; j++ ) { sprintf(tmp_str,"INSERT INTO d1 VALUES(%d,%d)",i,i); TestExecuter( db_hnd, tmp_str ); } } TestExecuter( db_hnd, "END" ); TestExecuter( db_hnd, "SELECT * FROM d1 ORDER BY n" ); // finish_test return 0; } #define DB_TEST "\\Test.db" int WINAPI WinMain( HINSTANCE,HINSTANCE,LPTSTR,int ) { sqlite3 * db; int err = sqlite3_open( DB_TEST, ); if ( err ) return -1; Test_Insert2( db ); / BUG: no sqlite3_close can eventually corrupt the database */ sqlite3_close( db ); // return 0; }
Re[2]: [sqlite] trying to compile SQLite
Tuesday, August 31, 2004, 1:03:38 PM, Doug Currie ([EMAIL PROTECTED]) wrote: DC> This is the SQLite 2 API... are you intending to use SQLite 2 or 3? I download everything in early summer, and probably have 2.8. I hadn't noticed 3 was out. Guess I should upgrade Best regards, Jonathan Gennick Editor, O'Reilly & Associates 906.387.1698 mailto:[EMAIL PROTECTED]
Re[2]: [sqlite] trying to compile SQLite
CS> Oops, you've pasted the source twice, so we haven't got the errors:) Oh my. You know, that happens to me quite often, on both my Windows boxes. I hit ctrl-C, and it's like it doesn't register. My alt keystrokes, from alt-tab sequences, get eaten sometimes too. But let's not worry about *that* problem. It's probably some bizarre Windows setting that I checked once upon a time. CS> From the source, you don't appear to include sqlite.h, but do include CS> main.c! A typo? If your main file is called main.c, you'll get a recursive CS> include, which will break the compile. Well, I wasn't sure what to include, so I went with main.c. My main file was main.cc, so I don't know whether I was getting any sort of recursive include from that or not. It didn't appear so. HOWEVER, including sqlite.h makes a BIG difference. I've still got some errors to work through, but now they are in code that I myself have written, and I think I can work through them. Let me try at least, before I post back here. Thanks for your help, and that goes for everyone who posted. I haven't caught up with all the replies yet. Best regards, Jonathan Gennick Editor, O'Reilly & Associates 906.387.1698 mailto:[EMAIL PROTECTED] Tuesday, August 31, 2004, 12:54:52 PM, Christian Smith ([EMAIL PROTECTED]) wrote: CS> On Tue, 31 Aug 2004, Jonathan Gennick wrote: >>I'm trying to compile SQLite, but, unfortunately, with very >>little joy. I'm running on Windows (sorry), and I'm using >>Bloodshed's C++ IDE, which appears to run some form of GNU's >>C++ compiler. Is anyone else using this particular >>combination? >> >>Below my signature, I've pasted in the short program that >>I'm trying to compile. I've also pasted in the error >>messages that result. I'd be grateful for any help. CS> Oops, you've pasted the source twice, so we haven't got the errors:) CS> Without the errors, It's hard to hazard a guess. I assume you're using CS> SQLite 2.8.x >>From the source, you don't appear to include sqlite.h, but do include CS> main.c! A typo? If your main file is called main.c, you'll get a recursive CS> include, which will break the compile. >> >>If not Bloodshed, is there some other Windows C++ compiler that is >>known to be able to compile SQLite? I'd be happy to switch >>compilers, if that was the easiest way for me to get to some >>working code. CS> I believe the dll from the website is cross-compiled using mingw32 under CS> Linux, though I could be wrong. If in doubt, use the Windows binary from CS> the website until you've sorted your build problem. >> >>Of course, it could be my code that is flawed, and not the >>compiler, but the errors all appear come from SQLite source >>files, so I tend to think I'm encountering some sort of >>mismatch between SQLite and the compiler that I'm using. CS> See include diagnosis above. >> >>Best regards, >> >>Jonathan Gennick >>Editor, O'Reilly & Associates >>906.387.1698 mailto:[EMAIL PROTECTED] >> >> >>Here's the code I'm trying to compile: >> >>#include >>#include >>#include "main.c" >> >>using namespace std; >> >>int main(int argc, char *argv[]) >>{ >> sqlite *db; >> char *zErrMsg = 0; >> int rc; >> >> printf("Opening the database...\n\n"); >> db = sqlite_open("c:\SQLite\Projects|FirstTest\FirstDatabase", 0, ); >> if( db==0 ){ >>fprintf(stderr, "Can't open database: %s\n", zErrMsg); >>system("PAUSE"); >>exit(1); >> } >> >> printf("Closing the database...\n\n"); >> sqlite_close(db); >> >> system("PAUSE"); >> return 0; >>} >> >> >>And here are the results: >> >>#include >>#include >>#include "main.c" >> >>using namespace std; >> >>int main(int argc, char *argv[]) >>{ >> sqlite *db; >> char *zErrMsg = 0; >> int rc; >> >> printf("Opening the database...\n\n"); >> db = sqlite_open("c:\SQLite\Projects|FirstTest\FirstDatabase", 0, ); >> if( db==0 ){ >>fprintf(stderr, "Can't open database: %s\n", zErrMsg); >>system("PAUSE"); >>exit(1); >> } >> >> printf("Closing the database...\n\n"); >> sqlite_close(db); >> >> system("PAUSE"); >> return 0; >>} >>
RE: [sqlite] Locking in 3.0.5
>>So, Rob, are you go to tell us if you think the change >>is an improvement or not? It seems that with either of the new schemes, when using sqlite3_busy_timeout() one thread is going to timeout sooner or later. That being the case I prefer the new version on efficiency grounds. Being a lazy programmer, I like the behaviour of 2.8.15 where both threads can get to complete their update, timeouts allowing. This is behaviour that I am also used to with MS SQL Server. I agree with you that many programmers (myself included) don't want to have to worry about this stuff too much when using SQLite. Rob.
[sqlite] [ANN] Webbo Announces QuickLite 1.5 Beta
Hello everybody, Today Webbo is releasing QuickLite 1.5 Beta, a Cocoa wrapper for SQLite, the embeddable SQL database engine. QuickLite already includes SQLite, so there's no need to download and to configure. It provides the developer with a SQL database without running a separate RDBMS process. QuickLite is not a client library used to connect to a big database server. QuickLite is the server, reading and writing directly to and from the database files on disk. QuickLite 1.0 Features • Objected-oriented • Easy to use • Just 3 classes to deal with: QuickLiteDatabase, QuickLiteCursor, and QuickLiteRow • Data file compaction • Includes introspection methods to access table names, column names, indexes, etc. • Includes utility methods to create and drop tables, add and remove columns, insert data, and more! • Access to SQLite's last error ID and associated error string • BLOB support New features in QuickLite 1.5 • Updated with SQLite 3.0.4 • Data integrity check provided by SQLite • Datatype support includes QLString, QLNumber, QLBoolean, QLDateTime, and QLContainer • Better data caching: CacheAllData, CacheOnDemand, or DoNotCacheData • QuickEdit: add, edit, and remove rows without a single SQL statement, the OOP-way • Save and revert supported, database-wide and on a cursor-by-cursor basis • Distributed notifications, Fast User Switching-aware, sent when a commit action takes place • Debugging facilities to observe all SQL statements executed, as well as tracing QuickLite methods • Lots of optimizations The QuickLite package also includes a few examples as well. You may download it here: http://www.webbotech.com/ Enjoy! -- Tito
Re: [sqlite] trying to compile SQLite
Tuesday, August 31, 2004, 5:40:15 PM, Dennis Cote wrote: > I have also filed a ticket with attached patches to have the SQLite > makefiles (both sqlite 2 and 3) produce GCC compatible import libraries for > sqlite.dll in addition to the Borland and MSVC import libraries. > So now you can build applications statically linked to libsqlite.a or > dynamically linked to sqlite.dll through libsqlitedll.a GCC doesn't need libsqlitedll.a -- you can just link to sqlite.dll and gcc understands what to do. e
Re: [sqlite] Locking in 3.0.5
Rob Groves wrote: I have just read the archive mailing list from 16/08/2004, and it looks like this behaviour is on purpose (checkin 1879). So, Rob, are you go to tell us if you think the change is an improvement or not? -- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
RE: [sqlite] Locking in 3.0.5
I have just read the archive mailing list from 16/08/2004, and it looks like this behaviour is on purpose (checkin 1879). My mistake, Rob. -Original Message- From: Rob Groves [mailto:[EMAIL PROTECTED] Sent: 31 August 2004 22:17 To: [EMAIL PROTECTED] Subject: [sqlite] Locking in 3.0.5 Hi, I have observed different behaviour between 3.0.3 and 3.0.5. I didn't download 3.0.4 so can't comment on that. I am using two threads and setting a busy timeout on each with sqlite3_busy_timeout(). In 3.0.3 two threads trying to update the same row(s) would both retry until the one with the shortest busy timeout expired, and SQLITE_BUSY is returned. In 3.0.5, the 2nd thread trying to obtain the lock returns SQLITE_BUSY immediately. Any ideas? Rob.
[sqlite] Locking in 3.0.5
Hi, I have observed different behaviour between 3.0.3 and 3.0.5. I didn't download 3.0.4 so can't comment on that. I am using two threads and setting a busy timeout on each with sqlite3_busy_timeout(). In 3.0.3 two threads trying to update the same row(s) would both retry until the one with the shortest busy timeout expired, and SQLITE_BUSY is returned. In 3.0.5, the 2nd thread trying to obtain the lock returns SQLITE_BUSY immediately. Any ideas? Rob.
Re: [sqlite] OLE/DB provider for SQLite?
Did you noticed there are very few open source OLE/DB providers? MySQL only has one, and not maintained since 2001. It started as a commercial project and only later (L)GPL'ed. There is one open source for Inteerbase: http://sourceforge.net/projects/iboledb/ The reason for this, IMHO, is because it isn't easy programming and it doesn't make sense for most of the major languages exactly for the difficulty in making it work right. It's easy to just use the native language wrappers for this, but that will not work in other languages (or even different frameworks, like VCL/MFC). If you think my "business plan" is not fair, I would be pleased to ear any alternatives you might have to make it better. An alternative businessplan you can consider, could be like Marco Wobben has with the DBXpress-driver. You can give it for free, but ask money for the source-code. When it works good, I guess you can sell some of your source-codes. You could also have restrictions on the binary only version, for example, not to use for commercial projects. Maybe I would be the source-code, just for not being dependant to someone else for a critical driver in my software projects. I am glad I bought the source code from Marco Wobben, because he does not want to do some small changes I need. Regards Bert Verhees Best regards, ~Nuno Lucas
Re: [sqlite] OLE/DB provider for SQLite?
Steve O'Hara, dando pulos de alegria, escreveu : Nuno, You're not going to be making too many friends here with that attitude To my knowledge, all the wrappers for SQLite are free and most authors will also give you the source code too if you want it. Well, I decided to make the OLE/DB provider exactly to help a friend. I don't have any need for that. There are many payed wrappers for sqlite (including COM ones). Just visit the links in the wiki and you'll see that. I don't want to displease anyone, and it is the first time I intend to make some money from an "open source" project, but I also think we should get rewarded from doing things we don't like to do (that is called working as opposed to just programming for fun). For most people, a simple OLEDB provider would do the trick - there are plenty of examples of writing these in any MS language you like (VB, C etc) Did you noticed there are very few open source OLE/DB providers? MySQL only has one, and not maintained since 2001. It started as a commercial project and only later (L)GPL'ed. The reason for this, IMHO, is because it isn't easy programming and it doesn't make sense for most of the major languages exactly for the difficulty in making it work right. It's easy to just use the native language wrappers for this, but that will not work in other languages (or even different frameworks, like VCL/MFC). If you think my "business plan" is not fair, I would be pleased to ear any alternatives you might have to make it better. Best regards, ~Nuno Lucas
[sqlite] trying to compile SQLite
I'm trying to compile SQLite, but, unfortunately, with very little joy. I'm running on Windows (sorry), and I'm using Bloodshed's C++ IDE, which appears to run some form of GNU's C++ compiler. Is anyone else using this particular combination? Below my signature, I've pasted in the short program that I'm trying to compile. I've also pasted in the error messages that result. I'd be grateful for any help. If not Bloodshed, is there some other Windows C++ compiler that is known to be able to compile SQLite? I'd be happy to switch compilers, if that was the easiest way for me to get to some working code. Of course, it could be my code that is flawed, and not the compiler, but the errors all appear come from SQLite source files, so I tend to think I'm encountering some sort of mismatch between SQLite and the compiler that I'm using. Best regards, Jonathan Gennick Editor, O'Reilly & Associates 906.387.1698 mailto:[EMAIL PROTECTED] Here's the code I'm trying to compile: #include #include #include "main.c" using namespace std; int main(int argc, char *argv[]) { sqlite *db; char *zErrMsg = 0; int rc; printf("Opening the database...\n\n"); db = sqlite_open("c:\SQLite\Projects|FirstTest\FirstDatabase", 0, ); if( db==0 ){ fprintf(stderr, "Can't open database: %s\n", zErrMsg); system("PAUSE"); exit(1); } printf("Closing the database...\n\n"); sqlite_close(db); system("PAUSE"); return 0; } And here are the results: #include #include #include "main.c" using namespace std; int main(int argc, char *argv[]) { sqlite *db; char *zErrMsg = 0; int rc; printf("Opening the database...\n\n"); db = sqlite_open("c:\SQLite\Projects|FirstTest\FirstDatabase", 0, ); if( db==0 ){ fprintf(stderr, "Can't open database: %s\n", zErrMsg); system("PAUSE"); exit(1); } printf("Closing the database...\n\n"); sqlite_close(db); system("PAUSE"); return 0; }
[sqlite] output from a compilation of sqlite-3.0.5.tar.g on SunOS 5.8.
Not sure if you're interested in this, but, attached is output from a compilation of sqlite-3.0.5.tar.g on SunOS 5.8. with a non-default configure. How can I utilize the included tests against the resultant executable? reid compilerOutput.doc.gz Description: compilerOutput.doc.gz
Re: [sqlite] DLL Version
Steve O'Hara wrote: I obviously noticed the changed API from 2.8.15 to 3.x.x but one change has left me a little puzzled - the sqlite_libversion call has been removed. This means that I can no longer determine the version of the DLL I'm using at runtime. sqlite3_libversion() is in version 3.0.5. -- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
Re: [sqlite] Is version 3 seriously broken?
I didn't mention that I applied the diffs from SQLite-WinCE to version 3.0.5 with the same results. Jakub Jakub Adamek wrote: Hello, the version 3 is most probably broken. I traced down the crash problem in Windows CE, see http://sourceforge.net/mailarchive/forum.php?thread_id=5438459_id=35230 It happens in balance_nonroot but in the declare variable section! If I change the variables in balance_nonroot to "static", the test goes OK. But such an error must come from a wrong memory write before this function. I am not able to find this. I attach my test program, it only creates a table and starts inserting rows. As the simiral problem appears on other OSes, see http://www.mail-archive.com/[EMAIL PROTECTED]/msg03112.html, I wonder if some of the great developers could solve it? Best regards Jakub Darren Duncan wrote: At 2:20 PM -0400 8/29/04, D. Richard Hipp wrote: SQLite version 3.0.5 (beta) is now available on the website. Richard, thank you very much for that release. I have downloaded and compiled it under both Mac OS X 10.2.8 (GCC 3.1, 3.3), and Mac OS X 10.3.5 (GCC3.3), with each development environment having the default set of libraries and headers. It compiles without errors (but with warnings about long integer types) on all configurations, and ./sqlite3 starts up and quits normally. Under both Mac OS X 10.2.8 configurations, 'make test' continues to fail due to my TCL library being out of date, as I had reported previously. Under the Mac OS X 10.3.5 configurations, 'make test' succeeds, with a result of '0 errors out of 22364 tests'. 10.3.5 does have a new enough TCL bundled. So at least with the newer setup, I can confirm that everything works. Matt, I will eagerly test a newer DBD::SQLite as soon as you release it. -- Darren Duncan if (! db.execute ( "CREATE TABLE test (" "i INTEGER NOT NULL," "v VARCHAR (50)," "PRIMARY KEY (i));")) ERROR_RETURN_FALSE; vector values; values.push_back (12); values.push_back ("ahoj brouku"); values.push_back (13); values.push_back ("nazdar brouku"); if (! db.execute ( "INSERT INTO test VALUES (12, 'ahoj brouku')")) ERROR_RETURN_FALSE; if (db.execute ( "INSERT INTO test VALUES (12, 'nazdar brouku')")) ERROR_RETURN_FALSE; if (! db.execute ( "INSERT INTO test VALUES (13, 'nazdar brouku')")) ERROR_RETURN_FALSE; if (db.isExecutePrecompiledSupported()) { vector params; params.push_back (14); params.push_back ("cau brundibare"); if (! db.executePrecompiled ( "INSERT INTO test VALUES (?, ?)", params)) ERROR_RETURN_FALSE; if (db.executePrecompiled ( "INSERT INTO test VALUES (?, ?)", params)) ERROR_RETURN_FALSE; values.push_back (14); values.push_back ("cau brundibare"); } COneWayRecordset rs (db); if (! rs.openTable ("test")) ERROR_RETURN_FALSE; if (! rs.add()) ERROR_RETURN_FALSE; rs ["i"] = 15; rs ["v"] = "Hello world"; if (! rs.update()) ERROR_RETURN_FALSE; values.push_back (15); values.push_back ("Hello world"); if (! rs.open ("SELECT i, v FROM test")) ERROR_RETURN_FALSE; int irecord = 0; bool ok; while (rs.next()) { int i = rs ["i"].forceInt (); string s = rs ["v"].asString(); if (i != values [irecord*2].forceInt ()) ERROR_RETURN_FALSE; if (s != values [irecord*2+1].asString()) ERROR_RETURN_FALSE; irecord ++; } // fill some rows with string and binary data if (! db.begin()) ERROR_RETURN_FALSE; if (! rs.openTable ("test")) ERROR_RETURN_FALSE; vector vec; string s; for (int row=1; row < 1000; row ++) { vec.push_back ((uint8_t) (row & 0xFF)); s += long2string (row); CVariantValueBinary binary (& *vec.begin(), vec.size()); if (! rs.add()) ERROR_RETURN_FALSE; rs ["i"] = row * row; rs ["v"] = s; if (! rs.update()) ERROR_RETURN_FALSE; if (! rs.add()) ERROR_RETURN_FALSE; rs ["i"] = row * row + 1; rs ["v"] = binary; if (! rs.update()) ERROR_RETURN_FALSE; } if (! db.close()) ERROR_RETURN_FALSE; return true;
[sqlite] Is version 3 seriously broken?
Hello, the version 3 is most probably broken. I traced down the crash problem in Windows CE, see http://sourceforge.net/mailarchive/forum.php?thread_id=5438459_id=35230 It happens in balance_nonroot but in the declare variable section! If I change the variables in balance_nonroot to "static", the test goes OK. But such an error must come from a wrong memory write before this function. I am not able to find this. I attach my test program, it only creates a table and starts inserting rows. As the simiral problem appears on other OSes, see http://www.mail-archive.com/[EMAIL PROTECTED]/msg03112.html, I wonder if some of the great developers could solve it? Best regards Jakub Darren Duncan wrote: At 2:20 PM -0400 8/29/04, D. Richard Hipp wrote: SQLite version 3.0.5 (beta) is now available on the website. Richard, thank you very much for that release. I have downloaded and compiled it under both Mac OS X 10.2.8 (GCC 3.1, 3.3), and Mac OS X 10.3.5 (GCC3.3), with each development environment having the default set of libraries and headers. It compiles without errors (but with warnings about long integer types) on all configurations, and ./sqlite3 starts up and quits normally. Under both Mac OS X 10.2.8 configurations, 'make test' continues to fail due to my TCL library being out of date, as I had reported previously. Under the Mac OS X 10.3.5 configurations, 'make test' succeeds, with a result of '0 errors out of 22364 tests'. 10.3.5 does have a new enough TCL bundled. So at least with the newer setup, I can confirm that everything works. Matt, I will eagerly test a newer DBD::SQLite as soon as you release it. -- Darren Duncan if (! db.execute ( "CREATE TABLE test (" "i INTEGER NOT NULL," "v VARCHAR (50)," "PRIMARY KEY (i));")) ERROR_RETURN_FALSE; vector values; values.push_back (12); values.push_back ("ahoj brouku"); values.push_back (13); values.push_back ("nazdar brouku"); if (! db.execute ( "INSERT INTO test VALUES (12, 'ahoj brouku')")) ERROR_RETURN_FALSE; if (db.execute ( "INSERT INTO test VALUES (12, 'nazdar brouku')")) ERROR_RETURN_FALSE; if (! db.execute ( "INSERT INTO test VALUES (13, 'nazdar brouku')")) ERROR_RETURN_FALSE; if (db.isExecutePrecompiledSupported()) { vector params; params.push_back (14); params.push_back ("cau brundibare"); if (! db.executePrecompiled ( "INSERT INTO test VALUES (?, ?)", params)) ERROR_RETURN_FALSE; if (db.executePrecompiled ( "INSERT INTO test VALUES (?, ?)", params)) ERROR_RETURN_FALSE; values.push_back (14); values.push_back ("cau brundibare"); } COneWayRecordset rs (db); if (! rs.openTable ("test")) ERROR_RETURN_FALSE; if (! rs.add()) ERROR_RETURN_FALSE; rs ["i"] = 15; rs ["v"] = "Hello world"; if (! rs.update()) ERROR_RETURN_FALSE; values.push_back (15); values.push_back ("Hello world"); if (! rs.open ("SELECT i, v FROM test")) ERROR_RETURN_FALSE; int irecord = 0; bool ok; while (rs.next()) { int i = rs ["i"].forceInt (); string s = rs ["v"].asString(); if (i != values [irecord*2].forceInt ()) ERROR_RETURN_FALSE; if (s != values [irecord*2+1].asString()) ERROR_RETURN_FALSE; irecord ++; } // fill some rows with string and binary data if (! db.begin()) ERROR_RETURN_FALSE; if (! rs.openTable ("test")) ERROR_RETURN_FALSE; vector vec; string s; for (int row=1; row < 1000; row ++) { vec.push_back ((uint8_t) (row & 0xFF)); s += long2string (row); CVariantValueBinary binary (& *vec.begin(), vec.size()); if (! rs.add()) ERROR_RETURN_FALSE; rs ["i"] = row * row; rs ["v"] = s; if (! rs.update()) ERROR_RETURN_FALSE; if (! rs.add()) ERROR_RETURN_FALSE; rs ["i"] = row * row + 1; rs ["v"] = binary; if (! rs.update()) ERROR_RETURN_FALSE; } if (! db.close()) ERROR_RETURN_FALSE; return true;