Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Report errors from sqlite3_exec() and sqlite3_config() in speedtest1. Fix a bug in the main testing logic that was found by these error reports. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
659f1a98ae698d062269f8fdac84f733 |
User & Date: | drh 2013-11-23 11:45:58.348 |
Context
2013-11-23
| ||
21:29 | Add newlines at the end of some error messages in speedtest1. (check-in: 6b98f0af7a user: drh tags: trunk) | |
11:45 | Report errors from sqlite3_exec() and sqlite3_config() in speedtest1. Fix a bug in the main testing logic that was found by these error reports. (check-in: 659f1a98ae user: drh tags: trunk) | |
04:32 | Fix the order of parameters to SQLITE_CONFIG_PAGECACHE in the speedtest1.exe program. (check-in: dbe85ef6d2 user: drh tags: trunk) | |
Changes
Changes to test/speedtest1.c.
︙ | ︙ | |||
373 374 375 376 377 378 379 | zSql = sqlite3_vmprintf(zFormat, ap); va_end(ap); if( g.bSqlOnly ){ int n = (int)strlen(zSql); while( n>0 && (zSql[n-1]==';' || isspace(zSql[n-1])) ){ n--; } printf("%.*s;\n", n, zSql); }else{ | > | > > | 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | zSql = sqlite3_vmprintf(zFormat, ap); va_end(ap); if( g.bSqlOnly ){ int n = (int)strlen(zSql); while( n>0 && (zSql[n-1]==';' || isspace(zSql[n-1])) ){ n--; } printf("%.*s;\n", n, zSql); }else{ char *zErrMsg = 0; int rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg); if( zErrMsg ) fatal_error("SQL error: %s\n%s\n", zErrMsg, zSql); if( rc!=SQLITE_OK ) fatal_error("exec error: %s\n", sqlite3_errmsg(g.db)); } sqlite3_free(zSql); } /* Prepare an SQL statement */ void speedtest1_prepare(const char *zFormat, ...){ va_list ap; |
︙ | ︙ | |||
727 728 729 730 731 732 733 | speedtest1_run(); } speedtest1_exec("COMMIT"); speedtest1_end_test(); speedtest1_begin_test(290, "Refill two %d-row tables using REPLACE", sz); | | | | 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | speedtest1_run(); } speedtest1_exec("COMMIT"); speedtest1_end_test(); speedtest1_begin_test(290, "Refill two %d-row tables using REPLACE", sz); speedtest1_exec("REPLACE INTO t2(a,b,c) SELECT a,b,c FROM t1"); speedtest1_exec("REPLACE INTO t3(a,b,c) SELECT a,b,c FROM t1"); speedtest1_end_test(); n = sz/5; speedtest1_begin_test(290, "%d four-ways joins", n); speedtest1_exec("BEGIN"); speedtest1_prepare( |
︙ | ︙ | |||
803 804 805 806 807 808 809 | const char *zEncoding = 0; /* --utf16be or --utf16le */ const char *zDbName = 0; /* Name of the test database */ void *pHeap = 0; /* Allocated heap space */ void *pLook = 0; /* Allocated lookaside space */ void *pPCache = 0; /* Allocated storage for pcache */ int iCur, iHi; /* Stats values, current and "highwater" */ | | > | 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | const char *zEncoding = 0; /* --utf16be or --utf16le */ const char *zDbName = 0; /* Name of the test database */ void *pHeap = 0; /* Allocated heap space */ void *pLook = 0; /* Allocated lookaside space */ void *pPCache = 0; /* Allocated storage for pcache */ int iCur, iHi; /* Stats values, current and "highwater" */ int i; /* Loop counter */ int rc; /* API return code */ /* Process command-line arguments */ g.zWR = ""; g.zNN = ""; g.zPK = "UNIQUE"; g.szTest = 100; for(i=1; i<argc; i++){ |
︙ | ︙ | |||
897 898 899 900 901 902 903 | if( zDbName==0 ){ fatal_error(zHelp, argv[0]); } #endif if( nHeap>0 ){ pHeap = malloc( nHeap ); if( pHeap==0 ) fatal_error("cannot allocate %d-byte heap\n", nHeap); | | > | > | > | 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 | if( zDbName==0 ){ fatal_error(zHelp, argv[0]); } #endif if( nHeap>0 ){ pHeap = malloc( nHeap ); if( pHeap==0 ) fatal_error("cannot allocate %d-byte heap\n", nHeap); rc = sqlite3_config(SQLITE_CONFIG_HEAP, pHeap, nHeap, mnHeap); if( rc ) fatal_error("heap configuration failed: %d", rc); } if( nPCache>0 && szPCache>0 ){ pPCache = malloc( nPCache*szPCache ); if( pPCache==0 ) fatal_error("cannot allocate %d-byte pcache\n", nPCache*szPCache); rc = sqlite3_config(SQLITE_CONFIG_PAGECACHE, pPCache, szPCache, nPCache); if( rc ) fatal_error("pcache configuration failed: %d", rc); } if( nLook>0 ){ sqlite3_config(SQLITE_CONFIG_LOOKASIDE, 0, 0); } /* Open the database and the input file */ if( sqlite3_open(zDbName, &g.db) ){ fatal_error("Cannot open database file: %s\n", zDbName); } if( nLook>0 && szLook>0 ){ pLook = malloc( nLook*szLook ); rc = sqlite3_db_config(g.db, SQLITE_DBCONFIG_LOOKASIDE, pLook, szLook,nLook); if( rc ) fatal_error("lookaside configuration failed: %d", rc); } /* Set database connection options */ sqlite3_create_function(g.db, "random", 0, SQLITE_UTF8, 0, randomFunc, 0, 0); if( doTrace ) sqlite3_trace(g.db, traceCallback, 0); if( zKey ){ speedtest1_exec("PRAGMA key('%s')", zKey); |
︙ | ︙ |