| | @@ -68,21 +68,21 @@ |
| 68 | 68 | * thus we always assume that we have a console. That can be |
| 69 | 69 | * overridden with the -batch command line option. |
| 70 | 70 | */ |
| 71 | 71 | #define isatty(x) 1 |
| 72 | 72 | #endif |
| 73 | + |
| 74 | +/* True if the timer is enabled */ |
| 75 | +static int enableTimer = 0; |
| 73 | 76 | |
| 74 | 77 | #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(__RTP__) && !defined(_WRS_KERNEL) |
| 75 | 78 | #include <sys/time.h> |
| 76 | 79 | #include <sys/resource.h> |
| 77 | 80 | |
| 78 | 81 | /* Saved resource information for the beginning of an operation */ |
| 79 | 82 | static struct rusage sBegin; |
| 80 | 83 | |
| 81 | | -/* True if the timer is enabled */ |
| 82 | | -static int enableTimer = 0; |
| 83 | | - |
| 84 | 84 | /* |
| 85 | 85 | ** Begin timing an operation |
| 86 | 86 | */ |
| 87 | 87 | static void beginTimer(void){ |
| 88 | 88 | if( enableTimer ){ |
| | @@ -122,13 +122,10 @@ |
| 122 | 122 | static FILETIME ftKernelBegin; |
| 123 | 123 | static FILETIME ftUserBegin; |
| 124 | 124 | typedef BOOL (WINAPI *GETPROCTIMES)(HANDLE, LPFILETIME, LPFILETIME, LPFILETIME, LPFILETIME); |
| 125 | 125 | static GETPROCTIMES getProcessTimesAddr = NULL; |
| 126 | 126 | |
| 127 | | -/* True if the timer is enabled */ |
| 128 | | -static int enableTimer = 0; |
| 129 | | - |
| 130 | 127 | /* |
| 131 | 128 | ** Check to see if we have timer support. Return 1 if necessary |
| 132 | 129 | ** support found (or found previously). |
| 133 | 130 | */ |
| 134 | 131 | static int hasTimer(void){ |
| | @@ -2197,12 +2194,12 @@ |
| 2197 | 2194 | int i, n; |
| 2198 | 2195 | open_db(p); |
| 2199 | 2196 | |
| 2200 | 2197 | /* convert testctrl text option to value. allow any unique prefix |
| 2201 | 2198 | ** of the option name, or a numerical value. */ |
| 2202 | | - n = strlen(azArg[1]); |
| 2203 | | - for(i=0; i<sizeof(aCtrl)/sizeof(aCtrl[0]); i++){ |
| 2199 | + n = strlen30(azArg[1]); |
| 2200 | + for(i=0; i<(int)(sizeof(aCtrl)/sizeof(aCtrl[0])); i++){ |
| 2204 | 2201 | if( strncmp(azArg[1], aCtrl[i].zCtrlName, n)==0 ){ |
| 2205 | 2202 | if( testctrl<0 ){ |
| 2206 | 2203 | testctrl = aCtrl[i].ctrlCode; |
| 2207 | 2204 | }else{ |
| 2208 | 2205 | fprintf(stderr, "ambiguous option name: \"%s\"\n", azArg[i]); |
| | @@ -2650,10 +2647,11 @@ |
| 2650 | 2647 | static void main_init(struct callback_data *data) { |
| 2651 | 2648 | memset(data, 0, sizeof(*data)); |
| 2652 | 2649 | data->mode = MODE_List; |
| 2653 | 2650 | memcpy(data->separator,"|", 2); |
| 2654 | 2651 | data->showHeader = 0; |
| 2652 | + sqlite3_config(SQLITE_CONFIG_URI, 1); |
| 2655 | 2653 | sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data); |
| 2656 | 2654 | sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite> "); |
| 2657 | 2655 | sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...> "); |
| 2658 | 2656 | sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); |
| 2659 | 2657 | } |
| | @@ -2664,10 +2662,15 @@ |
| 2664 | 2662 | const char *zInitFile = 0; |
| 2665 | 2663 | char *zFirstCmd = 0; |
| 2666 | 2664 | int i; |
| 2667 | 2665 | int rc = 0; |
| 2668 | 2666 | |
| 2667 | + if( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)!=0 ){ |
| 2668 | + fprintf(stderr, "SQLite header and source version mismatch\n%s\n%s\n", |
| 2669 | + sqlite3_sourceid(), SQLITE_SOURCE_ID); |
| 2670 | + exit(1); |
| 2671 | + } |
| 2669 | 2672 | Argv0 = argv[0]; |
| 2670 | 2673 | main_init(&data); |
| 2671 | 2674 | stdin_is_interactive = isatty(0); |
| 2672 | 2675 | |
| 2673 | 2676 | /* Make sure we have a valid signal handler early, before anything |
| 2674 | 2677 | |