gitlab.com/danp128/sqlite@v1.0.0/internal/mptest/mptest_linux_amd64.go (about) 1 // Code generated by ccgo. DO NOT EDIT. 2 3 // mptest 4 // /* 5 // ** 2013-04-05 6 // ** 7 // ** The author disclaims copyright to this source code. In place of 8 // ** a legal notice, here is a blessing: 9 // ** 10 // ** May you do good and not evil. 11 // ** May you find forgiveness for yourself and forgive others. 12 // ** May you share freely, never taking more than you give. 13 // ** 14 // ************************************************************************* 15 // ** 16 // ** This is a program used for testing SQLite, and specifically for testing 17 // ** the ability of independent processes to access the same SQLite database 18 // ** concurrently. 19 // ** 20 // ** Compile this program as follows: 21 // ** 22 // ** gcc -g -c -Wall sqlite3.c $(OPTS) 23 // ** gcc -g -o mptest mptest.c sqlite3.o $(LIBS) 24 // ** 25 // ** Recommended options: 26 // ** 27 // ** -DHAVE_USLEEP 28 // ** -DSQLITE_NO_SYNC 29 // ** -DSQLITE_THREADSAFE=0 30 // ** -DSQLITE_OMIT_LOAD_EXTENSION 31 // ** 32 // ** Run like this: 33 // ** 34 // ** ./mptest $database $script 35 // ** 36 // ** where $database is the database to use for testing and $script is a 37 // ** test script. 38 // */ 39 package main 40 41 import ( 42 "math" 43 "os" 44 "unsafe" 45 46 "modernc.org/ccgo/crt" 47 "modernc.org/sqlite/internal/bin" 48 ) 49 50 var argv []*int8 51 52 func main() { 53 for _, v := range os.Args { 54 argv = append(argv, (*int8)(crt.CString(v))) 55 } 56 argv = append(argv, nil) 57 X_start(crt.NewTLS(), int32(len(os.Args)), &argv[0]) 58 } 59 60 func X_start(tls *crt.TLS, _argc int32, _argv **int8) { 61 crt.X__register_stdfiles(tls, Xstdin, Xstdout, Xstderr) 62 crt.X__builtin_exit(tls, Xmain(tls, _argc, _argv)) 63 } 64 65 var Xstdin unsafe.Pointer 66 67 func init() { 68 Xstdin = unsafe.Pointer(&X__stdfiles) 69 } 70 71 var X__stdfiles [3]unsafe.Pointer 72 73 var Xstdout unsafe.Pointer 74 75 func init() { 76 Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) 77 } 78 79 var Xstderr unsafe.Pointer 80 81 func init() { 82 Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) 83 } 84 85 func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { 86 var _iClient, _n, _i, _openFlags, _rc, _taskId, _nRep, _iRep, _iTmout, _7_nTry, _15_iTimeout int32 87 var _zClient, _zScript, _zTrace, _zCOption, _zJMode, _zNRep, _zTmout, _14_zTaskName *int8 88 var _15_pStmt unsafe.Pointer 89 r0 = int32(0) 90 _openFlags = int32(2) 91 _nRep = int32(1) 92 _iTmout = int32(0) 93 _g.Xargv0 = *elem0(_argv, 0) 94 _g.XiTrace = int32(1) 95 if _argc < int32(2) { 96 _usage(tls, *elem0(_argv, 0)) 97 } 98 _g.XzDbFile = *elem0(_argv, uintptr(1)) 99 if Xstrglob(tls, str(0), _g.XzDbFile) != 0 { 100 _usage(tls, *elem0(_argv, 0)) 101 } 102 if crt.Xstrcmp(tls, bin.Xsqlite3_sourceid(tls), str(7)) != int32(0) { 103 crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(92), unsafe.Pointer(bin.Xsqlite3_sourceid(tls)), unsafe.Pointer(str(7))) 104 crt.Xexit(tls, int32(1)) 105 } 106 _n = _argc - int32(2) 107 bin.Xsqlite3_snprintf(tls, int32(32), (*int8)(unsafe.Pointer(&_g.XzName)), str(152), crt.Xgetpid(tls)) 108 _zJMode = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(164), int32(1)) 109 _zNRep = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(176), int32(1)) 110 if _zNRep != nil { 111 _nRep = crt.Xatoi(tls, _zNRep) 112 } 113 if _nRep < int32(1) { 114 _nRep = int32(1) 115 } 116 _g.XzVfs = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(183), int32(1)) 117 _zClient = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(187), int32(1)) 118 _g.XzErrLog = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(194), int32(1)) 119 _g.XzLog = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(201), int32(1)) 120 _zTrace = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(205), int32(1)) 121 if _zTrace != nil { 122 _g.XiTrace = crt.Xatoi(tls, _zTrace) 123 } 124 if _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(211), int32(0)) != nil { 125 _g.XiTrace = int32(0) 126 } 127 _zTmout = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(217), int32(1)) 128 if _zTmout != nil { 129 _iTmout = crt.Xatoi(tls, _zTmout) 130 } 131 _g.XbSqlTrace = bool2int(_findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(225), int32(0)) != nil) 132 _g.XbSync = bool2int(_findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(234), int32(0)) != nil) 133 if _g.XzErrLog != nil { 134 *(**crt.XFILE)(unsafe.Pointer(&_g.XpErrLog)) = crt.Xfopen64(tls, _g.XzErrLog, str(239)) 135 goto _9 136 } 137 *(**crt.XFILE)(unsafe.Pointer(&_g.XpErrLog)) = (*crt.XFILE)(Xstderr) 138 _9: 139 if _g.XzLog != nil { 140 *(**crt.XFILE)(unsafe.Pointer(&_g.XpLog)) = crt.Xfopen64(tls, _g.XzLog, str(239)) 141 goto _11 142 } 143 *(**crt.XFILE)(unsafe.Pointer(&_g.XpLog)) = (*crt.XFILE)(Xstdout) 144 _11: 145 bin.Xsqlite3_config(tls, int32(16), _sqlErrorCallback, int32(0)) 146 if _zClient == nil { 147 goto _12 148 } 149 _iClient = crt.Xatoi(tls, _zClient) 150 if _iClient < int32(1) { 151 _fatalError(tls, str(241), _iClient) 152 } 153 bin.Xsqlite3_snprintf(tls, int32(32), (*int8)(unsafe.Pointer(&_g.XzName)), str(268), crt.Xgetpid(tls), _iClient) 154 goto _14 155 _12: 156 _7_nTry = int32(0) 157 if _g.XiTrace <= int32(0) { 158 goto _15 159 } 160 crt.Xprintf(tls, str(284), unsafe.Pointer(*elem0(_argv, 0))) 161 _i = int32(1) 162 _16: 163 if _i >= _argc { 164 goto _19 165 } 166 crt.Xprintf(tls, str(294), unsafe.Pointer(*elem0(_argv, uintptr(_i)))) 167 _i += 1 168 goto _16 169 _19: 170 crt.Xprintf(tls, str(298)) 171 crt.Xprintf(tls, str(300)) 172 _i = int32(0) 173 _20: 174 if store1(&_zCOption, bin.Xsqlite3_compileoption_get(tls, _i)) == nil { 175 goto _23 176 } 177 crt.Xprintf(tls, str(405), unsafe.Pointer(_zCOption)) 178 _i += 1 179 goto _20 180 _23: 181 crt.Xfflush(tls, (*crt.XFILE)(Xstdout)) 182 _15: 183 _iClient = int32(0) 184 _24: 185 if (_7_nTry % int32(5)) == int32(4) { 186 crt.Xprintf(tls, str(418), unsafe.Pointer(func() *int8 { 187 if _7_nTry > int32(5) { 188 return str(447) 189 } 190 return str(454) 191 }()), unsafe.Pointer(_g.XzDbFile)) 192 } 193 _rc = crt.Xunlink(tls, _g.XzDbFile) 194 if _rc != 0 && ((*crt.X__errno_location(tls)) == int32(2)) { 195 _rc = int32(0) 196 } 197 if ((_rc != int32(0)) && (preInc2(&_7_nTry, 1) < int32(60))) && (bin.Xsqlite3_sleep(tls, int32(1000)) > int32(0)) { 198 goto _24 199 } 200 if _rc != int32(0) { 201 _fatalError(tls, str(455), unsafe.Pointer(_g.XzDbFile), _7_nTry) 202 } 203 _openFlags |= int32(4) 204 _14: 205 _rc = bin.Xsqlite3_open_v2(tls, _g.XzDbFile, (**bin.Xsqlite3)(unsafe.Pointer(&_g.Xdb)), _openFlags, _g.XzVfs) 206 if _rc != 0 { 207 _fatalError(tls, str(496), unsafe.Pointer(_g.XzDbFile)) 208 } 209 if _iTmout > int32(0) { 210 bin.Xsqlite3_busy_timeout(tls, (*bin.Xsqlite3)(_g.Xdb), _iTmout) 211 } 212 if _zJMode != nil { 213 _runSql(tls, str(513), unsafe.Pointer(_zJMode)) 214 } 215 if _g.XbSync == 0 { 216 _trySql(tls, str(537)) 217 } 218 bin.Xsqlite3_enable_load_extension(tls, (*bin.Xsqlite3)(_g.Xdb), int32(1)) 219 bin.Xsqlite3_busy_handler(tls, (*bin.Xsqlite3)(_g.Xdb), _busyHandler, nil) 220 bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_g.Xdb), str(560), int32(0), int32(1), nil, func() func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem) { 221 v := _vfsNameFunc 222 return *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&v)) 223 }(), nil, nil) 224 bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_g.Xdb), str(568), int32(1), int32(1), nil, func() func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem) { 225 v := _evalFunc 226 return *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&v)) 227 }(), nil, nil) 228 _g.XiTimeout = int32(10000) 229 if _g.XbSqlTrace != 0 { 230 bin.Xsqlite3_trace(tls, (*bin.Xsqlite3)(_g.Xdb), _sqlTraceCallback, nil) 231 } 232 if _iClient <= int32(0) { 233 goto _38 234 } 235 if _n > int32(0) { 236 _unrecognizedArguments(tls, *elem0(_argv, 0), _n, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8)))))))))))) 237 } 238 if _g.XiTrace != 0 { 239 _logMessage(tls, str(573)) 240 } 241 _40: 242 _14_zTaskName = nil 243 _rc = _startScript(tls, _iClient, &_zScript, &_taskId, &_14_zTaskName) 244 if _rc == int32(101) { 245 goto _42 246 } 247 if _g.XiTrace != 0 { 248 _logMessage(tls, str(586), unsafe.Pointer(_14_zTaskName), _taskId) 249 } 250 _runScript(tls, _iClient, _taskId, _zScript, _14_zTaskName) 251 if _g.XiTrace != 0 { 252 _logMessage(tls, str(600), unsafe.Pointer(_14_zTaskName), _taskId) 253 } 254 _finishScript(tls, _iClient, _taskId, int32(0)) 255 bin.Xsqlite3_free(tls, unsafe.Pointer(_14_zTaskName)) 256 bin.Xsqlite3_sleep(tls, int32(10)) 257 goto _40 258 _42: 259 if _g.XiTrace != 0 { 260 _logMessage(tls, str(612)) 261 } 262 goto _47 263 _38: 264 if _n == int32(0) { 265 _fatalError(tls, str(623)) 266 } 267 if _n > int32(1) { 268 _unrecognizedArguments(tls, *elem0(_argv, 0), _n, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(int32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8)))))))))))) 269 } 270 _runSql(tls, str(647)) 271 _zScript = _readFile(tls, *elem0(_argv, uintptr(2))) 272 _iRep = int32(1) 273 _50: 274 if _iRep > _nRep { 275 goto _53 276 } 277 if _g.XiTrace != 0 { 278 _logMessage(tls, str(1083), unsafe.Pointer(*elem0(_argv, uintptr(2))), _iRep) 279 } 280 _runScript(tls, int32(0), int32(0), _zScript, *elem0(_argv, uintptr(2))) 281 if _g.XiTrace != 0 { 282 _logMessage(tls, str(1111), unsafe.Pointer(*elem0(_argv, uintptr(2))), _iRep) 283 } 284 _iRep += 1 285 goto _50 286 _53: 287 bin.Xsqlite3_free(tls, unsafe.Pointer(_zScript)) 288 _waitForClient(tls, int32(0), int32(2000), str(1137)) 289 _trySql(tls, str(1157)) 290 bin.Xsqlite3_sleep(tls, int32(10)) 291 _g.XiTimeout = int32(0) 292 _15_iTimeout = int32(1000) 293 _56: 294 if ((store2(&_rc, _trySql(tls, str(1186))) == int32(5)) || (_rc == int32(100))) && (_15_iTimeout > int32(0)) { 295 bin.Xsqlite3_sleep(tls, int32(10)) 296 _15_iTimeout -= int32(10) 297 goto _56 298 } 299 bin.Xsqlite3_sleep(tls, int32(100)) 300 _15_pStmt = _prepareSql(tls, str(1207)) 301 _15_iTimeout = int32(1000) 302 _60: 303 if (store2(&_rc, bin.Xsqlite3_step(tls, _15_pStmt)) == int32(5)) && (_15_iTimeout > int32(0)) { 304 bin.Xsqlite3_sleep(tls, int32(10)) 305 _15_iTimeout -= int32(10) 306 goto _60 307 } 308 if _rc == int32(100) { 309 _g.XnError += bin.Xsqlite3_column_int(tls, _15_pStmt, int32(0)) 310 _g.XnTest += bin.Xsqlite3_column_int(tls, _15_pStmt, int32(1)) 311 } 312 bin.Xsqlite3_finalize(tls, _15_pStmt) 313 _47: 314 bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_g.Xdb)) 315 _maybeClose(tls, (*crt.XFILE)(_g.XpLog)) 316 _maybeClose(tls, (*crt.XFILE)(_g.XpErrLog)) 317 if _iClient != int32(0) { 318 goto _64 319 } 320 crt.Xprintf(tls, str(1242), _g.XnError, _g.XnTest) 321 crt.Xprintf(tls, str(1278), unsafe.Pointer(*elem0(_argv, 0))) 322 _i = int32(1) 323 _65: 324 if _i >= _argc { 325 goto _68 326 } 327 crt.Xprintf(tls, str(294), unsafe.Pointer(*elem0(_argv, uintptr(_i)))) 328 _i += 1 329 goto _65 330 _68: 331 crt.Xprintf(tls, str(298)) 332 _64: 333 return bool2int(_g.XnError > int32(0)) 334 } 335 336 // C comment 337 // /* Global data 338 // */ 339 var _g TGlobal 340 341 // C comment 342 // /* Print a usage message for the program and exit */ 343 func _usage(tls *crt.TLS, _argv0 *int8) { 344 var _i int32 345 var _zTail *int8 346 _zTail = _argv0 347 _i = int32(0) 348 _0: 349 if (*elem1(_argv0, uintptr(_i))) == 0 { 350 goto _3 351 } 352 if int32(*elem1(_argv0, uintptr(_i))) == int32(47) { 353 _zTail = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv0))+uintptr(_i))))) + uintptr(int32(1)))) 354 } 355 _i += 1 356 goto _0 357 _3: 358 crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(1286), unsafe.Pointer(_zTail)) 359 crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(1325)) 360 crt.Xexit(tls, int32(1)) 361 } 362 363 // C comment 364 // /* 365 // ** Return TRUE if string z[] matches glob pattern zGlob[]. 366 // ** Return FALSE if the pattern does not match. 367 // ** 368 // ** Globbing rules: 369 // ** 370 // ** '*' Matches any sequence of zero or more characters. 371 // ** 372 // ** '?' Matches exactly one character. 373 // ** 374 // ** [...] Matches one character from the enclosed list of 375 // ** characters. 376 // ** 377 // ** [^...] Matches one character not in the enclosed list. 378 // ** 379 // ** '#' Matches any sequence of one or more digits with an 380 // ** optional + or - sign in front 381 // */ 382 func Xstrglob(tls *crt.TLS, _zGlob *int8, _z *int8) (r0 int32) { 383 var _c, _c2, _invert, _seen, _10_prior_c int32 384 _0: 385 if store2(&_c, int32(*postInc1(&_zGlob, 1))) == int32(0) { 386 goto _1 387 } 388 if _c != int32(42) { 389 goto _2 390 } 391 _3: 392 if store2(&_c, int32(*postInc1(&_zGlob, 1))) != int32(42) && _c != int32(63) { 393 goto _4 394 } 395 if (_c == int32(63)) && (int32(*postInc1(&_z, 1)) == int32(0)) { 396 return int32(0) 397 } 398 goto _3 399 _4: 400 if _c == int32(0) { 401 return int32(1) 402 } 403 if _c != int32(91) { 404 goto _10 405 } 406 _11: 407 if ((*_z) != 0) && Xstrglob(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zGlob))-uintptr(int32(1)))), _z) != 0 { 408 *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) 409 goto _11 410 } 411 return bool2int(int32(*_z) != int32(0)) 412 413 _10: 414 if store2(&_c2, int32(*postInc1(&_z, 1))) == int32(0) { 415 goto _15 416 } 417 _16: 418 if _c2 == _c { 419 goto _17 420 } 421 _c2 = int32(*postInc1(&_z, 1)) 422 if _c2 == int32(0) { 423 return int32(0) 424 } 425 goto _16 426 _17: 427 if Xstrglob(tls, _zGlob, _z) != 0 { 428 return int32(1) 429 } 430 goto _10 431 _15: 432 return int32(0) 433 434 _2: 435 if _c != int32(63) { 436 goto _21 437 } 438 if int32(*postInc1(&_z, 1)) == int32(0) { 439 return int32(0) 440 } 441 goto _50 442 _21: 443 if _c != int32(91) { 444 goto _24 445 } 446 _10_prior_c = int32(0) 447 _seen = int32(0) 448 _invert = int32(0) 449 _c = int32(*postInc1(&_z, 1)) 450 if _c == int32(0) { 451 return int32(0) 452 } 453 _c2 = int32(*postInc1(&_zGlob, 1)) 454 if _c2 == int32(94) { 455 _invert = int32(1) 456 _c2 = int32(*postInc1(&_zGlob, 1)) 457 } 458 if _c2 != int32(93) { 459 goto _27 460 } 461 if _c == int32(93) { 462 _seen = int32(1) 463 } 464 _c2 = int32(*postInc1(&_zGlob, 1)) 465 _27: 466 if _c2 == 0 || _c2 == int32(93) { 467 goto _30 468 } 469 if _c2 != int32(45) || int32(*elem1(_zGlob, 0)) == int32(93) || int32(*elem1(_zGlob, 0)) == int32(0) || _10_prior_c <= int32(0) { 470 goto _35 471 } 472 _c2 = int32(*postInc1(&_zGlob, 1)) 473 if (_c >= _10_prior_c) && (_c <= _c2) { 474 _seen = int32(1) 475 } 476 _10_prior_c = int32(0) 477 goto _38 478 _35: 479 if _c == _c2 { 480 _seen = int32(1) 481 } 482 _10_prior_c = _c2 483 _38: 484 _c2 = int32(*postInc1(&_zGlob, 1)) 485 goto _27 486 _30: 487 if (_c2 == int32(0)) || ((_seen ^ _invert) == int32(0)) { 488 return int32(0) 489 } 490 goto _50 491 _24: 492 if _c != int32(35) { 493 goto _43 494 } 495 if ((int32(*elem1(_z, 0)) == int32(45)) || (int32(*elem1(_z, 0)) == int32(43))) && (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, uintptr(1)))))))&int32(2048)) != 0 { 496 *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) 497 } 498 if (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, 0)))))) & int32(2048)) == 0 { 499 return int32(0) 500 } 501 *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) 502 _48: 503 if (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, 0)))))) & int32(2048)) != 0 { 504 *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) 505 goto _48 506 } 507 goto _50 508 _43: 509 if _c != int32(*postInc1(&_z, 1)) { 510 return int32(0) 511 } 512 _50: 513 goto _0 514 _1: 515 return bool2int(int32(*_z) == int32(0)) 516 } 517 518 // C comment 519 // /* 520 // ** Look for a command-line option. If present, return a pointer. 521 // ** Return NULL if missing. 522 // ** 523 // ** hasArg==0 means the option is a flag. It is either present or not. 524 // ** hasArg==1 means the option has an argument. Return a pointer to the 525 // ** argument. 526 // */ 527 func _findOption(tls *crt.TLS, _azArg **int8, _pnArg *int32, _zOption *int8, _hasArg int32) (r0 *int8) { 528 var _i, _j, _nArg int32 529 var _zReturn, _1_z *int8 530 _zReturn = nil 531 _nArg = *_pnArg 532 func() { 533 if _hasArg != int32(0) && _hasArg != int32(1) { 534 crt.X__builtin_fprintf(tls, Xstderr, str(1897), unsafe.Pointer(str(1933)), int32(1211), unsafe.Pointer(&_findOptionØ00__func__Ø000), unsafe.Pointer(str(1988))) 535 crt.X__builtin_abort(tls) 536 } 537 }() 538 _i = int32(0) 539 _3: 540 if _i >= _nArg { 541 goto _6 542 } 543 if (_i + _hasArg) >= _nArg { 544 goto _6 545 } 546 _1_z = *elem0(_azArg, uintptr(_i)) 547 if int32(*elem1(_1_z, 0)) != int32(45) { 548 goto _4 549 } 550 *(*uintptr)(unsafe.Pointer(&_1_z)) += uintptr(1) 551 if int32(*elem1(_1_z, 0)) != int32(45) { 552 goto _9 553 } 554 if int32(*elem1(_1_z, uintptr(1))) == int32(0) { 555 goto _6 556 } 557 *(*uintptr)(unsafe.Pointer(&_1_z)) += uintptr(1) 558 _9: 559 if crt.Xstrcmp(tls, _1_z, _zOption) != int32(0) { 560 goto _11 561 } 562 if _hasArg != 0 && (_i == (_nArg - int32(1))) { 563 _fatalError(tls, str(2011), unsafe.Pointer(_1_z)) 564 } 565 if _hasArg != 0 { 566 _zReturn = *elem0(_azArg, uintptr(_i+int32(1))) 567 goto _15 568 } 569 _zReturn = *elem0(_azArg, uintptr(_i)) 570 _15: 571 _j = (_i + int32(1)) + bool2int(_hasArg != int32(0)) 572 _16: 573 if _j < _nArg { 574 *elem0(_azArg, uintptr(postInc2(&_i, 1))) = *elem0(_azArg, uintptr(postInc2(&_j, 1))) 575 goto _16 576 } 577 *_pnArg = _i 578 return _zReturn 579 580 _11: 581 _4: 582 _i += 1 583 goto _3 584 _6: 585 return _zReturn 586 } 587 588 var _findOptionØ00__func__Ø000 [11]int8 589 590 func init() { 591 crt.Xstrncpy(nil, &_findOptionØ00__func__Ø000[0], str(2059), 11) 592 } 593 594 // C comment 595 // /* 596 // ** Print an error message and then quit. 597 // */ 598 func _fatalError(tls *crt.TLS, _zFormat *int8, args ...interface{}) { 599 var _3_nTry int32 600 var _zMsg *int8 601 var _ap []interface{} 602 var _zPrefix [30]int8 603 _ap = args 604 _zMsg = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) 605 _ap = nil 606 bin.Xsqlite3_snprintf(tls, int32(30), (*int8)(unsafe.Pointer(&_zPrefix)), str(2070), unsafe.Pointer(&_g.XzName)) 607 if _g.XpLog != nil { 608 _printWithPrefix(tls, (*crt.XFILE)(_g.XpLog), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) 609 crt.Xfflush(tls, (*crt.XFILE)(_g.XpLog)) 610 _maybeClose(tls, (*crt.XFILE)(_g.XpLog)) 611 } 612 if (_g.XpErrLog != nil) && _safe_strcmp(tls, _g.XzErrLog, _g.XzLog) != 0 { 613 _printWithPrefix(tls, (*crt.XFILE)(_g.XpErrLog), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) 614 crt.Xfflush(tls, (*crt.XFILE)(_g.XpErrLog)) 615 _maybeClose(tls, (*crt.XFILE)(_g.XpErrLog)) 616 } 617 bin.Xsqlite3_free(tls, unsafe.Pointer(_zMsg)) 618 if _g.Xdb == nil { 619 goto _3 620 } 621 _3_nTry = int32(0) 622 _g.XiTimeout = int32(0) 623 _4: 624 if (_trySql(tls, str(2081)) == int32(5)) && (postInc2(&_3_nTry, 1) < int32(100)) { 625 bin.Xsqlite3_sleep(tls, int32(10)) 626 goto _4 627 } 628 _3: 629 bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_g.Xdb)) 630 crt.Xexit(tls, int32(1)) 631 _ = _zPrefix 632 _ = _3_nTry 633 } 634 635 // C comment 636 // /* 637 // ** Print a message adding zPrefix[] to the beginning of every line. 638 // */ 639 func _printWithPrefix(tls *crt.TLS, _pOut *crt.XFILE, _zPrefix *int8, _zMsg *int8) { 640 var _1_i int32 641 _0: 642 if _zMsg == nil || (*elem1(_zMsg, 0)) == 0 { 643 goto _1 644 } 645 _1_i = int32(0) 646 _3: 647 if (*elem1(_zMsg, uintptr(_1_i))) == 0 || int32(*elem1(_zMsg, uintptr(_1_i))) == int32(10) || int32(*elem1(_zMsg, uintptr(_1_i))) == int32(13) { 648 goto _8 649 } 650 _1_i += 1 651 goto _3 652 _8: 653 crt.Xfprintf(tls, _pOut, str(2111), unsafe.Pointer(_zPrefix), _1_i, unsafe.Pointer(_zMsg)) 654 *(*uintptr)(unsafe.Pointer(&_zMsg)) += uintptr(_1_i) 655 _9: 656 if (int32(*elem1(_zMsg, 0)) == int32(10)) || (int32(*elem1(_zMsg, 0)) == int32(13)) { 657 *(*uintptr)(unsafe.Pointer(&_zMsg)) += uintptr(1) 658 goto _9 659 } 660 goto _0 661 _1: 662 } 663 664 // C comment 665 // /* 666 // ** Close output stream pOut if it is not stdout or stderr 667 // */ 668 func _maybeClose(tls *crt.TLS, _pOut *crt.XFILE) { 669 if (unsafe.Pointer(_pOut) != Xstdout) && (_pOut != (*crt.XFILE)(Xstderr)) { 670 crt.Xfclose(tls, _pOut) 671 } 672 } 673 674 // C comment 675 // /* 676 // ** Compare two pointers to strings, where the pointers might be NULL. 677 // */ 678 func _safe_strcmp(tls *crt.TLS, _a *int8, _b *int8) (r0 int32) { 679 if _a == _b { 680 return int32(0) 681 } 682 if _a == nil { 683 return int32(-1) 684 } 685 if _b == nil { 686 return int32(1) 687 } 688 return crt.Xstrcmp(tls, _a, _b) 689 } 690 691 // C comment 692 // /* 693 // ** Try to run arbitrary SQL. Return success code. 694 // */ 695 func _trySql(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 int32) { 696 var _rc int32 697 var _zSql *int8 698 var _ap []interface{} 699 _ap = args 700 _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) 701 _ap = nil 702 _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_g.Xdb), _zSql, nil, nil, nil) 703 bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) 704 return _rc 705 } 706 707 // C comment 708 // /* 709 // ** SQL error log callback 710 // */ 711 func _sqlErrorCallback(tls *crt.TLS, _pArg unsafe.Pointer, _iErrCode int32, _zMsg *int8) { 712 if (_iErrCode == int32(1)) && _g.XbIgnoreSqlErrors != 0 { 713 return 714 } 715 if ((_iErrCode & int32(255)) == int32(17)) && (_g.XiTrace < int32(3)) { 716 return 717 } 718 if ((_g.XiTimeout == int32(0)) && ((_iErrCode & int32(255)) == int32(5))) && (_g.XiTrace < int32(3)) { 719 return 720 } 721 if (_iErrCode & int32(255)) == int32(27) { 722 _logMessage(tls, str(2119), unsafe.Pointer(_zMsg)) 723 goto _8 724 } 725 _errorMessage(tls, str(2129), _iErrCode, unsafe.Pointer(_zMsg)) 726 _8: 727 } 728 729 // C comment 730 // /* 731 // ** Print a log message 732 // */ 733 func _logMessage(tls *crt.TLS, _zFormat *int8, args ...interface{}) { 734 var _zMsg *int8 735 var _ap []interface{} 736 var _zPrefix [30]int8 737 _ap = args 738 _zMsg = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) 739 _ap = nil 740 bin.Xsqlite3_snprintf(tls, int32(30), (*int8)(unsafe.Pointer(&_zPrefix)), str(2145), unsafe.Pointer(&_g.XzName)) 741 if _g.XpLog != nil { 742 _printWithPrefix(tls, (*crt.XFILE)(_g.XpLog), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) 743 crt.Xfflush(tls, (*crt.XFILE)(_g.XpLog)) 744 } 745 bin.Xsqlite3_free(tls, unsafe.Pointer(_zMsg)) 746 _ = _zPrefix 747 } 748 749 // C comment 750 // /* 751 // ** Print an error message 752 // */ 753 func _errorMessage(tls *crt.TLS, _zFormat *int8, args ...interface{}) { 754 var _zMsg *int8 755 var _ap []interface{} 756 var _zPrefix [30]int8 757 _ap = args 758 _zMsg = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) 759 _ap = nil 760 bin.Xsqlite3_snprintf(tls, int32(30), (*int8)(unsafe.Pointer(&_zPrefix)), str(2150), unsafe.Pointer(&_g.XzName)) 761 if _g.XpLog != nil { 762 _printWithPrefix(tls, (*crt.XFILE)(_g.XpLog), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) 763 crt.Xfflush(tls, (*crt.XFILE)(_g.XpLog)) 764 } 765 if (_g.XpErrLog != nil) && _safe_strcmp(tls, _g.XzErrLog, _g.XzLog) != 0 { 766 _printWithPrefix(tls, (*crt.XFILE)(_g.XpErrLog), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) 767 crt.Xfflush(tls, (*crt.XFILE)(_g.XpErrLog)) 768 } 769 bin.Xsqlite3_free(tls, unsafe.Pointer(_zMsg)) 770 _g.XnError += 1 771 _ = _zPrefix 772 } 773 774 // C comment 775 // /* 776 // ** Run arbitrary SQL. Issue a fatal error on failure. 777 // */ 778 func _runSql(tls *crt.TLS, _zFormat *int8, args ...interface{}) { 779 var _rc int32 780 var _zSql *int8 781 var _ap []interface{} 782 _ap = args 783 _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) 784 _ap = nil 785 _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_g.Xdb), _zSql, nil, nil, nil) 786 if _rc != int32(0) { 787 _fatalError(tls, str(2161), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_g.Xdb))), unsafe.Pointer(_zSql)) 788 } 789 bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) 790 } 791 792 // C comment 793 // /* 794 // ** Busy handler with a g.iTimeout-millisecond timeout 795 // */ 796 func _busyHandler(tls *crt.TLS, _pCD unsafe.Pointer, _count int32) (r0 int32) { 797 if (_count * int32(10)) <= _g.XiTimeout { 798 goto _0 799 } 800 if _g.XiTimeout > int32(0) { 801 _errorMessage(tls, str(2168), _g.XiTimeout) 802 } 803 return int32(0) 804 805 _0: 806 bin.Xsqlite3_sleep(tls, int32(10)) 807 return int32(1) 808 } 809 810 // C comment 811 // /* 812 // ** Auxiliary SQL function to return the name of the VFS 813 // */ 814 func _vfsNameFunc(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _argv *unsafe.Pointer) { 815 var _zVfs *int8 816 var _db unsafe.Pointer 817 _db = unsafe.Pointer(bin.Xsqlite3_context_db_handle(tls, (*bin.Xsqlite3_context)(_context))) 818 _zVfs = nil 819 820 bin.Xsqlite3_file_control(tls, (*bin.Xsqlite3)(_db), str(2187), int32(12), unsafe.Pointer(&_zVfs)) 821 if _zVfs != nil { 822 bin.Xsqlite3_result_text(tls, (*bin.Xsqlite3_context)(_context), _zVfs, int32(-1), bin.Xsqlite3_free) 823 } 824 } 825 826 // C comment 827 // /* 828 // ** Auxiliary SQL function to recursively evaluate SQL. 829 // */ 830 func _evalFunc(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _argv *unsafe.Pointer) { 831 var _rc int32 832 var _zSql, _zErrMsg *int8 833 var _db unsafe.Pointer 834 var _res XString 835 _db = unsafe.Pointer(bin.Xsqlite3_context_db_handle(tls, (*bin.Xsqlite3_context)(_context))) 836 _zSql = (*int8)(unsafe.Pointer(bin.Xsqlite3_value_text(tls, (*bin.XMem)(*elem4(_argv, 0))))) 837 _zErrMsg = nil 838 839 crt.Xmemset(tls, unsafe.Pointer(&_res), int32(0), uint64(16)) 840 _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_db), _zSql, _evalCallback, unsafe.Pointer(&_res), &_zErrMsg) 841 if _zErrMsg != nil { 842 bin.Xsqlite3_result_error(tls, (*bin.Xsqlite3_context)(_context), _zErrMsg, int32(-1)) 843 bin.Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg)) 844 goto _3 845 } 846 if _rc != 0 { 847 bin.Xsqlite3_result_error_code(tls, (*bin.Xsqlite3_context)(_context), _rc) 848 goto _3 849 } 850 bin.Xsqlite3_result_text(tls, (*bin.Xsqlite3_context)(_context), _res.Xz, int32(-1), func() func(*crt.TLS, unsafe.Pointer) { 851 v := uint64(18446744073709551615) 852 return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) 853 }()) 854 _3: 855 _stringFree(tls, &_res) 856 } 857 858 // C comment 859 // /* 860 // ** Callback function for evalSql() 861 // */ 862 func _evalCallback(tls *crt.TLS, _pCData unsafe.Pointer, _argc int32, _argv **int8, _azCol **int8) (r0 int32) { 863 var _i int32 864 var _p *XString 865 _p = (*XString)(_pCData) 866 867 _i = int32(0) 868 _0: 869 if _i >= _argc { 870 goto _3 871 } 872 _stringAppendTerm(tls, _p, *elem0(_argv, uintptr(_i))) 873 _i += 1 874 goto _0 875 _3: 876 return int32(0) 877 } 878 879 // C comment 880 // /* Append a new token onto the end of the string */ 881 func _stringAppendTerm(tls *crt.TLS, _p *XString, _z *int8) { 882 var _i int32 883 if _p.Xn != 0 { 884 _stringAppend(tls, _p, str(2192), int32(1)) 885 } 886 if _z == nil { 887 _stringAppend(tls, _p, str(2194), int32(3)) 888 return 889 } 890 _i = int32(0) 891 _2: 892 if (*elem1(_z, uintptr(_i))) == 0 || (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, uintptr(_i)))))))&int32(8192)) != 0 { 893 goto _6 894 } 895 _i += 1 896 goto _2 897 _6: 898 if (_i > int32(0)) && (int32(*elem1(_z, uintptr(_i))) == int32(0)) { 899 _stringAppend(tls, _p, _z, _i) 900 return 901 } 902 _stringAppend(tls, _p, str(2198), int32(1)) 903 _9: 904 if (*elem1(_z, 0)) == 0 { 905 goto _10 906 } 907 _i = int32(0) 908 _11: 909 if (*elem1(_z, uintptr(_i))) == 0 || int32(*elem1(_z, uintptr(_i))) == int32(39) { 910 goto _15 911 } 912 _i += 1 913 goto _11 914 _15: 915 if (*elem1(_z, uintptr(_i))) != 0 { 916 _stringAppend(tls, _p, _z, _i+int32(1)) 917 _stringAppend(tls, _p, str(2198), int32(1)) 918 *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_i + int32(1)) 919 goto _17 920 } 921 _stringAppend(tls, _p, _z, _i) 922 goto _10 923 _17: 924 goto _9 925 _10: 926 _stringAppend(tls, _p, str(2198), int32(1)) 927 } 928 929 // C comment 930 // /* Append n bytes of text to a string. If n<0 append the entire string. */ 931 func _stringAppend(tls *crt.TLS, _p *XString, _z *int8, _n int32) { 932 var _1_nAlloc int32 933 var _1_zNew *int8 934 if _n < int32(0) { 935 _n = int32(crt.Xstrlen(tls, _z)) 936 } 937 if (_p.Xn + _n) < _p.XnAlloc { 938 goto _1 939 } 940 _1_nAlloc = ((_p.XnAlloc * int32(2)) + _n) + int32(100) 941 _1_zNew = (*int8)(bin.Xsqlite3_realloc(tls, unsafe.Pointer(_p.Xz), _1_nAlloc)) 942 if _1_zNew == nil { 943 _fatalError(tls, str(2200)) 944 } 945 _p.Xz = _1_zNew 946 _p.XnAlloc = _1_nAlloc 947 _1: 948 crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.Xz))+uintptr(_p.Xn)))), unsafe.Pointer(_z), uint64(_n)) 949 _p.Xn += _n 950 *elem1(_p.Xz, uintptr(_p.Xn)) = 0 951 } 952 953 // C comment 954 // /* Free a string */ 955 func _stringFree(tls *crt.TLS, _p *XString) { 956 if _p.Xz != nil { 957 bin.Xsqlite3_free(tls, unsafe.Pointer(_p.Xz)) 958 } 959 crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint64(16)) 960 } 961 962 // C comment 963 // /* 964 // ** SQL Trace callback 965 // */ 966 func _sqlTraceCallback(tls *crt.TLS, _NotUsed1 unsafe.Pointer, _zSql *int8) { 967 _logMessage(tls, str(2214), _clipLength(tls, _zSql), unsafe.Pointer(_zSql)) 968 } 969 970 // C comment 971 // /* 972 // ** Return the length of a string omitting trailing whitespace 973 // */ 974 func _clipLength(tls *crt.TLS, _z *int8) (r0 int32) { 975 var _n int32 976 _n = int32(crt.Xstrlen(tls, _z)) 977 _0: 978 if (_n > int32(0)) && (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, uintptr(_n-int32(1))))))))&int32(8192)) != 0 { 979 _n -= 1 980 goto _0 981 } 982 return _n 983 } 984 985 // C comment 986 // /* Report on unrecognized arguments */ 987 func _unrecognizedArguments(tls *crt.TLS, _argv0 *int8, _nArg int32, _azArg **int8) { 988 var _i int32 989 crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(2221), unsafe.Pointer(_argv0)) 990 _i = int32(0) 991 _0: 992 if _i >= _nArg { 993 goto _3 994 } 995 crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(294), unsafe.Pointer(*elem0(_azArg, uintptr(_i)))) 996 _i += 1 997 goto _0 998 _3: 999 crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(298)) 1000 crt.Xexit(tls, int32(1)) 1001 } 1002 1003 // C comment 1004 // /* 1005 // ** Look up the next task for client iClient in the database. 1006 // ** Return the task script and the task number and mark that 1007 // ** task as being under way. 1008 // */ 1009 func _startScript(tls *crt.TLS, _iClient int32, _pzScript **int8, _pTaskId *int32, _pzTaskName **int8) (r0 int32) { 1010 var _taskId, _rc, _totalTime, _6_n int32 1011 var _pStmt unsafe.Pointer 1012 _pStmt = nil 1013 _totalTime = int32(0) 1014 *_pzScript = nil 1015 _g.XiTimeout = int32(0) 1016 _0: 1017 _rc = _trySql(tls, str(2249)) 1018 if _rc == int32(5) { 1019 bin.Xsqlite3_sleep(tls, int32(10)) 1020 _totalTime += int32(10) 1021 goto _0 1022 } 1023 if _rc != int32(0) { 1024 _fatalError(tls, str(2265), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_g.Xdb)))) 1025 } 1026 if _g.XnError != 0 || _g.XnTest != 0 { 1027 _runSql(tls, str(2284), _g.XnError, _g.XnTest) 1028 _g.XnError = int32(0) 1029 _g.XnTest = int32(0) 1030 } 1031 _pStmt = _prepareSql(tls, str(2337), _iClient) 1032 _rc = bin.Xsqlite3_step(tls, _pStmt) 1033 bin.Xsqlite3_finalize(tls, _pStmt) 1034 if _rc == int32(100) { 1035 _runSql(tls, str(2383), _iClient) 1036 _g.XiTimeout = int32(10000) 1037 _runSql(tls, str(2414)) 1038 return int32(101) 1039 } 1040 _pStmt = _prepareSql(tls, str(2434), _iClient) 1041 _rc = bin.Xsqlite3_step(tls, _pStmt) 1042 if _rc == int32(100) { 1043 _6_n = bin.Xsqlite3_column_bytes(tls, _pStmt, int32(0)) 1044 *_pzScript = (*int8)(bin.Xsqlite3_malloc(tls, _6_n+int32(1))) 1045 crt.Xstrcpy(tls, *_pzScript, (*int8)(unsafe.Pointer(bin.Xsqlite3_column_text(tls, _pStmt, int32(0))))) 1046 *_pTaskId = store2(&_taskId, bin.Xsqlite3_column_int(tls, _pStmt, int32(1))) 1047 *_pzTaskName = bin.Xsqlite3_mprintf(tls, str(2526), unsafe.Pointer(bin.Xsqlite3_column_text(tls, _pStmt, int32(2)))) 1048 bin.Xsqlite3_finalize(tls, _pStmt) 1049 _runSql(tls, str(2529), _taskId) 1050 _g.XiTimeout = int32(10000) 1051 _runSql(tls, str(2414)) 1052 return int32(0) 1053 } 1054 bin.Xsqlite3_finalize(tls, _pStmt) 1055 if _rc != int32(101) { 1056 goto _8 1057 } 1058 if _totalTime > int32(30000) { 1059 _errorMessage(tls, str(2612)) 1060 _runSql(tls, str(2661), _iClient) 1061 bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_g.Xdb)) 1062 crt.Xexit(tls, int32(1)) 1063 } 1064 _9: 1065 if _trySql(tls, str(2701)) == int32(5) { 1066 bin.Xsqlite3_sleep(tls, int32(10)) 1067 _totalTime += int32(10) 1068 goto _9 1069 } 1070 bin.Xsqlite3_sleep(tls, int32(100)) 1071 _totalTime += int32(100) 1072 goto _0 1073 _8: 1074 _fatalError(tls, str(2526), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_g.Xdb)))) 1075 goto _0 1076 } 1077 1078 // C comment 1079 // /* 1080 // ** Prepare an SQL statement. Issue a fatal error if unable. 1081 // */ 1082 func _prepareSql(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 unsafe.Pointer) { 1083 var _rc int32 1084 var _zSql *int8 1085 var _pStmt unsafe.Pointer 1086 var _ap []interface{} 1087 _pStmt = nil 1088 _ap = args 1089 _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) 1090 _ap = nil 1091 _rc = bin.Xsqlite3_prepare_v2(tls, (*bin.Xsqlite3)(_g.Xdb), _zSql, int32(-1), &_pStmt, nil) 1092 if _rc != int32(0) { 1093 bin.Xsqlite3_finalize(tls, _pStmt) 1094 _fatalError(tls, str(2161), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_g.Xdb))), unsafe.Pointer(_zSql)) 1095 } 1096 bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) 1097 return _pStmt 1098 } 1099 1100 // C comment 1101 // /* 1102 // ** Run a script. 1103 // */ 1104 func _runScript(tls *crt.TLS, _iClient int32, _taskId int32, _zScript *int8, _zFilename *int8) { 1105 var _lineno, _prevLine, _ii, _iBegin, _n, _c, _j, _len, _nArg, _8_rc, _12_jj, _15_jj, _15_isGlob, _20_k, _23_jj, _25_jj, _25_rc, _30_iNewClient, _32_iTimeout, _33_iTarget, _33_iEnd int32 1106 var _4_zSql, _12_zAns, _15_zAns, _15_zCopy, _19_zNewFile, _19_zNewScript, _19_zToDel, _33_zTask, _33_zTName, _41_zSql *int8 1107 var _25_pStmt unsafe.Pointer 1108 var _zError [1000]int8 1109 var _zCmd [30]int8 1110 var _sResult XString 1111 var _azArg [2][100]int8 1112 _lineno = int32(1) 1113 _prevLine = int32(1) 1114 _ii = int32(0) 1115 _iBegin = int32(0) 1116 crt.Xmemset(tls, unsafe.Pointer(&_sResult), int32(0), uint64(16)) 1117 _stringReset(tls, &_sResult) 1118 _0: 1119 if store2(&_c, int32(*elem1(_zScript, uintptr(_ii)))) == int32(0) { 1120 goto _1 1121 } 1122 _prevLine = _lineno 1123 _len = _tokenLength(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii))), &_lineno) 1124 if (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(_c)))))&int32(8192)) != 0 || ((_c == int32(47)) && (int32(*elem1(_zScript, uintptr(_ii+int32(1)))) == int32(42))) { 1125 _ii += _len 1126 goto _0 1127 } 1128 if ((_c != int32(45)) || (int32(*elem1(_zScript, uintptr(_ii+int32(1)))) != int32(45))) || ((int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(*elem1(_zScript, uintptr(_ii+int32(2))))))) & int32(1024)) == 0) { 1129 _ii += _len 1130 goto _0 1131 } 1132 if _ii > _iBegin { 1133 _4_zSql = bin.Xsqlite3_mprintf(tls, str(2708), _ii-_iBegin, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_iBegin))))) 1134 _evalSql(tls, &_sResult, _4_zSql) 1135 bin.Xsqlite3_free(tls, unsafe.Pointer(_4_zSql)) 1136 _iBegin = _ii + _len 1137 } 1138 if _g.XiTrace >= int32(2) { 1139 _logMessage(tls, str(2708), _len, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii))))) 1140 } 1141 _n = _extractToken(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(int32(2)))), _len-int32(2), (*int8)(unsafe.Pointer(&_zCmd)), int32(30)) 1142 _nArg = int32(0) 1143 _10: 1144 if _n >= (_len-int32(2)) || _nArg >= int32(2) { 1145 goto _14 1146 } 1147 _15: 1148 if (_n < (_len - int32(2))) && (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_zScript, uintptr((_ii+int32(2))+_n)))))))&int32(8192)) != 0 { 1149 _n += 1 1150 goto _15 1151 } 1152 if _n >= (_len - int32(2)) { 1153 goto _14 1154 } 1155 _n += _extractToken(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(int32(2))))))+uintptr(_n))), (_len-int32(2))-_n, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), uintptr(_nArg)))), int32(100)) 1156 _nArg += 1 1157 goto _10 1158 _14: 1159 _j = _nArg 1160 _19: 1161 if _j >= int32(2) { 1162 goto _22 1163 } 1164 *elem1((*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), uintptr(postInc2(&_j, 1))))), 0) = 0 1165 _j += 1 1166 goto _19 1167 _22: 1168 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2713)) == int32(0) { 1169 bin.Xsqlite3_sleep(tls, crt.Xatoi(tls, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), 0))))) 1170 goto _108 1171 } 1172 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2719)) != int32(0) { 1173 goto _25 1174 } 1175 _8_rc = crt.Xatoi(tls, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), 0)))) 1176 _finishScript(tls, _iClient, _taskId, int32(1)) 1177 if _8_rc == int32(0) { 1178 bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_g.Xdb)) 1179 } 1180 crt.Xexit(tls, _8_rc) 1181 goto _108 1182 _25: 1183 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2724)) != int32(0) { 1184 goto _28 1185 } 1186 if _g.XiTrace == int32(1) { 1187 _logMessage(tls, str(2708), _len-int32(1), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii))))) 1188 } 1189 _stringReset(tls, &_sResult) 1190 goto _108 1191 _28: 1192 if (crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2733)) == int32(0)) && (_iClient > int32(0)) { 1193 _finishScript(tls, _iClient, _taskId, int32(1)) 1194 goto _108 1195 } 1196 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2740)) == int32(0) { 1197 _stringReset(tls, &_sResult) 1198 goto _108 1199 } 1200 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2746)) != int32(0) { 1201 goto _36 1202 } 1203 _12_zAns = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + uintptr(_ii))) 1204 _12_jj = int32(7) 1205 _37: 1206 if _12_jj >= (_len-int32(1)) || (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_12_zAns, uintptr(_12_jj)))))))&int32(8192)) == 0 { 1207 goto _41 1208 } 1209 _12_jj += 1 1210 goto _37 1211 _41: 1212 *(*uintptr)(unsafe.Pointer(&_12_zAns)) += uintptr(_12_jj) 1213 if (((_len - _12_jj) - int32(1)) != _sResult.Xn) || crt.Xstrncmp(tls, _sResult.Xz, _12_zAns, uint64((_len-_12_jj)-int32(1))) != 0 { 1214 _errorMessage(tls, str(2752), _prevLine, unsafe.Pointer(_zFilename), (_len-_12_jj)-int32(1), unsafe.Pointer(_12_zAns), unsafe.Pointer(_sResult.Xz)) 1215 } 1216 _g.XnTest += 1 1217 _stringReset(tls, &_sResult) 1218 goto _108 1219 _36: 1220 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2797)) != int32(0) && crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2802)) != int32(0) { 1221 goto _46 1222 } 1223 _15_zAns = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + uintptr(_ii))) 1224 _15_isGlob = bool2int(int32(*elem1((*int8)(unsafe.Pointer(&_zCmd)), 0)) == int32(103)) 1225 _15_jj = int32(9) - (int32(3) * _15_isGlob) 1226 _47: 1227 if _15_jj >= (_len-int32(1)) || (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_15_zAns, uintptr(_15_jj)))))))&int32(8192)) == 0 { 1228 goto _51 1229 } 1230 _15_jj += 1 1231 goto _47 1232 _51: 1233 *(*uintptr)(unsafe.Pointer(&_15_zAns)) += uintptr(_15_jj) 1234 _15_zCopy = bin.Xsqlite3_mprintf(tls, str(2708), (_len-_15_jj)-int32(1), unsafe.Pointer(_15_zAns)) 1235 if (bool2int(bin.Xsqlite3_strglob(tls, _15_zCopy, _sResult.Xz) == int32(0)) ^ _15_isGlob) != 0 { 1236 _errorMessage(tls, str(2810), _prevLine, unsafe.Pointer(_zFilename), unsafe.Pointer(_15_zCopy), unsafe.Pointer(_sResult.Xz)) 1237 } 1238 bin.Xsqlite3_free(tls, unsafe.Pointer(_15_zCopy)) 1239 _g.XnTest += 1 1240 _stringReset(tls, &_sResult) 1241 goto _108 1242 _46: 1243 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2853)) == int32(0) { 1244 _logMessage(tls, str(2526), unsafe.Pointer(_sResult.Xz)) 1245 goto _108 1246 } 1247 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2860)) != int32(0) { 1248 goto _56 1249 } 1250 _19_zToDel = nil 1251 _19_zNewFile = (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), 0))) 1252 if int32(*elem1(_19_zNewFile, 0)) == int32(47) { 1253 goto _57 1254 } 1255 _20_k = int32(crt.Xstrlen(tls, _zFilename)) - int32(1) 1256 _58: 1257 if _20_k < int32(0) || int32(*elem1(_zFilename, uintptr(_20_k))) == int32(47) { 1258 goto _62 1259 } 1260 _20_k -= 1 1261 goto _58 1262 _62: 1263 if _20_k > int32(0) { 1264 _19_zNewFile = store1(&_19_zToDel, bin.Xsqlite3_mprintf(tls, str(2867), _20_k, unsafe.Pointer(_zFilename), unsafe.Pointer(_19_zNewFile))) 1265 } 1266 _57: 1267 _19_zNewScript = _readFile(tls, _19_zNewFile) 1268 if _g.XiTrace != 0 { 1269 _logMessage(tls, str(2875), unsafe.Pointer(_19_zNewFile)) 1270 } 1271 _runScript(tls, int32(0), int32(0), _19_zNewScript, _19_zNewFile) 1272 bin.Xsqlite3_free(tls, unsafe.Pointer(_19_zNewScript)) 1273 if _g.XiTrace != 0 { 1274 _logMessage(tls, str(2894), unsafe.Pointer(_19_zNewFile)) 1275 } 1276 bin.Xsqlite3_free(tls, unsafe.Pointer(_19_zToDel)) 1277 goto _108 1278 _56: 1279 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2911)) != int32(0) { 1280 goto _67 1281 } 1282 _23_jj = int32(7) 1283 _68: 1284 if _23_jj >= _len || (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_zScript, uintptr(_ii+_23_jj)))))))&int32(8192)) == 0 { 1285 goto _72 1286 } 1287 _23_jj += 1 1288 goto _68 1289 _72: 1290 _logMessage(tls, str(2708), _len-_23_jj, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_23_jj))))) 1291 goto _108 1292 _67: 1293 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2917)) != int32(0) { 1294 goto _74 1295 } 1296 _25_jj = int32(4) 1297 _75: 1298 if _25_jj >= _len || (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_zScript, uintptr(_ii+_25_jj)))))))&int32(8192)) == 0 { 1299 goto _79 1300 } 1301 _25_jj += 1 1302 goto _75 1303 _79: 1304 _25_pStmt = _prepareSql(tls, str(2920), _len-_25_jj, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_25_jj))))) 1305 _25_rc = bin.Xsqlite3_step(tls, _25_pStmt) 1306 if (_25_rc != int32(100)) || (bin.Xsqlite3_column_int(tls, _25_pStmt, int32(0)) == int32(0)) { 1307 _ii += _findEndif(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_len))), int32(1), &_lineno) 1308 } 1309 bin.Xsqlite3_finalize(tls, _25_pStmt) 1310 goto _108 1311 _74: 1312 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2932)) == int32(0) { 1313 _ii += _findEndif(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_len))), int32(0), &_lineno) 1314 goto _108 1315 } 1316 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2937)) == int32(0) { 1317 goto _108 1318 } 1319 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2943)) != int32(0) || _iClient != int32(0) { 1320 goto _88 1321 } 1322 _30_iNewClient = crt.Xatoi(tls, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), 0)))) 1323 if _30_iNewClient > int32(0) { 1324 _startClient(tls, _30_iNewClient) 1325 } 1326 goto _108 1327 _88: 1328 if (crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2949)) == int32(0)) && (_iClient == int32(0)) { 1329 _32_iTimeout = func() int32 { 1330 if _nArg >= int32(2) { 1331 return crt.Xatoi(tls, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), uintptr(1))))) 1332 } 1333 return int32(10000) 1334 }() 1335 bin.Xsqlite3_snprintf(tls, int32(1000), (*int8)(unsafe.Pointer(&_zError)), str(2954), _prevLine, unsafe.Pointer(_zFilename)) 1336 _waitForClient(tls, crt.Xatoi(tls, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), 0)))), _32_iTimeout, (*int8)(unsafe.Pointer(&_zError))) 1337 goto _108 1338 } 1339 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2969)) != int32(0) || _iClient != int32(0) { 1340 goto _97 1341 } 1342 _33_iTarget = crt.Xatoi(tls, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), 0)))) 1343 _33_iEnd = _findEnd(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_len))), &_lineno) 1344 if _33_iTarget < int32(0) { 1345 _errorMessage(tls, str(2974), _prevLine, unsafe.Pointer(_zFilename), _33_iTarget) 1346 goto _99 1347 } 1348 _33_zTask = bin.Xsqlite3_mprintf(tls, str(2708), _33_iEnd, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_len))))) 1349 if _nArg > int32(1) { 1350 _33_zTName = bin.Xsqlite3_mprintf(tls, str(2526), unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), uintptr(1)))) 1351 goto _101 1352 } 1353 _33_zTName = bin.Xsqlite3_mprintf(tls, str(3011), unsafe.Pointer(_filenameTail(tls, _zFilename)), _prevLine) 1354 _101: 1355 _startClient(tls, _33_iTarget) 1356 _runSql(tls, str(3017), _33_iTarget, unsafe.Pointer(_33_zTask), unsafe.Pointer(_33_zTName)) 1357 bin.Xsqlite3_free(tls, unsafe.Pointer(_33_zTask)) 1358 bin.Xsqlite3_free(tls, unsafe.Pointer(_33_zTName)) 1359 _99: 1360 _33_iEnd += _tokenLength(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_len)))))+uintptr(_33_iEnd))), &_lineno) 1361 _len += _33_iEnd 1362 _iBegin = _ii + _len 1363 goto _108 1364 _97: 1365 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(3073)) == int32(0) { 1366 _test_breakpoint(tls) 1367 goto _108 1368 } 1369 if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(3084)) == int32(0) { 1370 _g.XbIgnoreSqlErrors = func() int32 { 1371 if _nArg >= int32(1) { 1372 return bool2int(_booleanValue(tls, (*int8)(unsafe.Pointer(elem5((*[100]int8)(unsafe.Pointer(&_azArg)), 0)))) == 0) 1373 } 1374 return int32(1) 1375 }() 1376 goto _108 1377 } 1378 _errorMessage(tls, str(3100), _prevLine, unsafe.Pointer(_zFilename), unsafe.Pointer(&_zCmd)) 1379 _108: 1380 _ii += _len 1381 goto _0 1382 _1: 1383 if _iBegin < _ii { 1384 _41_zSql = bin.Xsqlite3_mprintf(tls, str(2708), _ii-_iBegin, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_iBegin))))) 1385 _runSql(tls, _41_zSql) 1386 bin.Xsqlite3_free(tls, unsafe.Pointer(_41_zSql)) 1387 } 1388 _stringFree(tls, &_sResult) 1389 _ = _zCmd 1390 _ = _zError 1391 _ = _azArg 1392 } 1393 1394 // C comment 1395 // /* Reset a string to an empty string */ 1396 func _stringReset(tls *crt.TLS, _p *XString) { 1397 if _p.Xz == nil { 1398 _stringAppend(tls, _p, str(2192), int32(1)) 1399 } 1400 _p.Xn = int32(0) 1401 *elem1(_p.Xz, 0) = 0 1402 } 1403 1404 // C comment 1405 // /* 1406 // ** Return the length of the next token. 1407 // */ 1408 func _tokenLength(tls *crt.TLS, _z *int8, _pnLine *int32) (r0 int32) { 1409 var _n, _1_inC, _1_c, _10_delim, _13_c int32 1410 _n = int32(0) 1411 if (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, 0))))))&int32(8192)) == 0 && (int32(*elem1(_z, 0)) != int32(47) || int32(*elem1(_z, uintptr(1))) != int32(42)) { 1412 goto _2 1413 } 1414 _1_inC = int32(0) 1415 if int32(*elem1(_z, 0)) == int32(47) { 1416 _1_inC = int32(1) 1417 _n = int32(2) 1418 } 1419 _3: 1420 if store2(&_1_c, int32(*elem1(_z, uintptr(postInc2(&_n, 1))))) == int32(0) { 1421 goto _5 1422 } 1423 if _1_c == int32(10) { 1424 *_pnLine += 1 1425 } 1426 if (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(_1_c))))) & int32(8192)) != 0 { 1427 goto _3 1428 } 1429 if (_1_inC != 0 && (_1_c == int32(42))) && (int32(*elem1(_z, uintptr(_n))) == int32(47)) { 1430 _n += 1 1431 _1_inC = int32(0) 1432 goto _16 1433 } 1434 if ((_1_inC == 0) && (_1_c == int32(47))) && (int32(*elem1(_z, uintptr(_n))) == int32(42)) { 1435 _n += 1 1436 _1_inC = int32(1) 1437 goto _16 1438 } 1439 if _1_inC == 0 { 1440 goto _5 1441 } 1442 _16: 1443 goto _3 1444 _5: 1445 _n -= 1 1446 goto _36 1447 _2: 1448 if int32(*elem1(_z, 0)) != int32(45) || int32(*elem1(_z, uintptr(1))) != int32(45) { 1449 goto _19 1450 } 1451 _n = int32(2) 1452 _20: 1453 if (*elem1(_z, uintptr(_n))) == 0 || int32(*elem1(_z, uintptr(_n))) == int32(10) { 1454 goto _24 1455 } 1456 _n += 1 1457 goto _20 1458 _24: 1459 if (*elem1(_z, uintptr(_n))) != 0 { 1460 *_pnLine += 1 1461 _n += 1 1462 } 1463 goto _36 1464 _19: 1465 if int32(*elem1(_z, 0)) != int32(34) && int32(*elem1(_z, 0)) != int32(39) { 1466 goto _28 1467 } 1468 _10_delim = int32(*elem1(_z, 0)) 1469 _n = int32(1) 1470 _29: 1471 if (*elem1(_z, uintptr(_n))) == 0 { 1472 goto _32 1473 } 1474 if int32(*elem1(_z, uintptr(_n))) == int32(10) { 1475 *_pnLine += 1 1476 } 1477 if int32(*elem1(_z, uintptr(_n))) != _10_delim { 1478 goto _34 1479 } 1480 _n += 1 1481 if int32(*elem1(_z, uintptr(_n+int32(1)))) != _10_delim { 1482 goto _32 1483 } 1484 _34: 1485 _n += 1 1486 goto _29 1487 _32: 1488 goto _36 1489 _28: 1490 _n = int32(1) 1491 _37: 1492 if store2(&_13_c, int32(*elem1(_z, uintptr(_n)))) == int32(0) || (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(_13_c)))))&int32(8192)) != 0 || _13_c == int32(34) || _13_c == int32(39) || _13_c == int32(59) { 1493 goto _44 1494 } 1495 _n += 1 1496 goto _37 1497 _44: 1498 _36: 1499 return _n 1500 } 1501 1502 // C comment 1503 // /* 1504 // ** Run arbitrary SQL and record the results in an output string 1505 // ** given by the first parameter. 1506 // */ 1507 func _evalSql(tls *crt.TLS, _p *XString, _zFormat *int8, args ...interface{}) (r0 int32) { 1508 var _rc int32 1509 var _zSql, _zErrMsg *int8 1510 var _ap []interface{} 1511 var _1_zErr [30]int8 1512 _zErrMsg = nil 1513 _ap = args 1514 _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) 1515 _ap = nil 1516 func() { 1517 if _g.XiTimeout <= int32(0) { 1518 crt.X__builtin_fprintf(tls, Xstderr, str(1897), unsafe.Pointer(str(1933)), int32(494), unsafe.Pointer(&_evalSqlØ00__func__Ø000), unsafe.Pointer(str(3136))) 1519 crt.X__builtin_abort(tls) 1520 } 1521 }() 1522 _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_g.Xdb), _zSql, _evalCallback, unsafe.Pointer(_p), &_zErrMsg) 1523 bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) 1524 if _rc == 0 { 1525 goto _2 1526 } 1527 bin.Xsqlite3_snprintf(tls, int32(30), (*int8)(unsafe.Pointer(&_1_zErr)), str(3149), _rc) 1528 _stringAppendTerm(tls, _p, (*int8)(unsafe.Pointer(&_1_zErr))) 1529 if _zErrMsg != nil { 1530 _stringAppendTerm(tls, _p, _zErrMsg) 1531 bin.Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg)) 1532 } 1533 _2: 1534 return _rc 1535 1536 _ = _1_zErr 1537 panic(0) 1538 } 1539 1540 var _evalSqlØ00__func__Ø000 [8]int8 1541 1542 func init() { 1543 crt.Xstrncpy(nil, &_evalSqlØ00__func__Ø000[0], str(3159), 8) 1544 } 1545 1546 // C comment 1547 // /* 1548 // ** Copy a single token into a string buffer. 1549 // */ 1550 func _extractToken(tls *crt.TLS, _zIn *int8, _nIn int32, _zOut *int8, _nOut int32) (r0 int32) { 1551 var _i int32 1552 if _nIn <= int32(0) { 1553 *elem1(_zOut, 0) = 0 1554 return int32(0) 1555 } 1556 _i = int32(0) 1557 _1: 1558 if _i >= _nIn || _i >= (_nOut-int32(1)) || (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_zIn, uintptr(_i)))))))&int32(8192)) != 0 { 1559 goto _6 1560 } 1561 *elem1(_zOut, uintptr(_i)) = *elem1(_zIn, uintptr(_i)) 1562 _i += 1 1563 goto _1 1564 _6: 1565 *elem1(_zOut, uintptr(_i)) = 0 1566 return _i 1567 } 1568 1569 // C comment 1570 // /* 1571 // ** Mark a script as having finished. Remove the CLIENT table entry 1572 // ** if bShutdown is true. 1573 // */ 1574 func _finishScript(tls *crt.TLS, _iClient int32, _taskId int32, _bShutdown int32) (r0 int32) { 1575 _runSql(tls, str(3167), _taskId) 1576 if _bShutdown != 0 { 1577 _runSql(tls, str(2383), _iClient) 1578 } 1579 return int32(0) 1580 } 1581 1582 // C comment 1583 // /* 1584 // ** Read the entire content of a file into memory 1585 // */ 1586 func _readFile(tls *crt.TLS, _zFilename *int8) (r0 *int8) { 1587 var _sz int64 1588 var _z *int8 1589 var _in *crt.XFILE 1590 _in = crt.Xfopen64(tls, _zFilename, str(3248)) 1591 if _in == nil { 1592 _fatalError(tls, str(3251), unsafe.Pointer(_zFilename)) 1593 } 1594 crt.Xfseek(tls, _in, 0, int32(2)) 1595 _sz = crt.Xftell(tls, _in) 1596 crt.Xrewind(tls, _in) 1597 _z = (*int8)(bin.Xsqlite3_malloc(tls, int32(_sz+int64(1)))) 1598 _sz = int64(crt.Xfread(tls, unsafe.Pointer(_z), uint64(1), uint64(_sz), _in)) 1599 *elem1(_z, uintptr(_sz)) = 0 1600 crt.Xfclose(tls, _in) 1601 return _z 1602 } 1603 1604 // C comment 1605 // /* 1606 // ** Find the number of characters up to the first character past the 1607 // ** of the next "--endif" or "--else" token. Nested --if commands are 1608 // ** also skipped. 1609 // */ 1610 func _findEndif(tls *crt.TLS, _z *int8, _stopAtElse int32, _pnLine *int32) (r0 int32) { 1611 var _n, _1_len, _3_skip int32 1612 _n = int32(0) 1613 _0: 1614 if (*elem1(_z, uintptr(_n))) == 0 { 1615 goto _1 1616 } 1617 _1_len = _tokenLength(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), _pnLine) 1618 if ((crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3280), uint64(7)) == int32(0)) && (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, uintptr(_n+int32(7))))))))&int32(8192)) != 0) || ((_stopAtElse != 0 && (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3288), uint64(6)) == int32(0))) && (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, uintptr(_n+int32(6))))))))&int32(8192)) != 0) { 1619 return _n + _1_len 1620 } 1621 if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3295), uint64(4)) == int32(0)) && (int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, uintptr(_n+int32(4))))))))&int32(8192)) != 0 { 1622 _3_skip = _findEndif(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n)))))+uintptr(_1_len))), int32(0), _pnLine) 1623 _n += _3_skip + _1_len 1624 goto _9 1625 } 1626 _n += _1_len 1627 _9: 1628 goto _0 1629 _1: 1630 return _n 1631 } 1632 1633 // C comment 1634 // /* 1635 // ** Start up a client process for iClient, if it is not already 1636 // ** running. If the client is already running, then this routine 1637 // ** is a no-op. 1638 // */ 1639 func _startClient(tls *crt.TLS, _iClient int32) { 1640 var _1_rc int32 1641 var _1_zSys *int8 1642 _runSql(tls, str(3300), _iClient) 1643 if bin.Xsqlite3_changes(tls, (*bin.Xsqlite3)(_g.Xdb)) == 0 { 1644 goto _0 1645 } 1646 _1_zSys = bin.Xsqlite3_mprintf(tls, str(3342), unsafe.Pointer(_g.Xargv0), unsafe.Pointer(_g.XzDbFile), _iClient, _g.XiTrace) 1647 if _g.XbSqlTrace != 0 { 1648 _1_zSys = bin.Xsqlite3_mprintf(tls, str(3373), unsafe.Pointer(_1_zSys)) 1649 } 1650 if _g.XbSync != 0 { 1651 _1_zSys = bin.Xsqlite3_mprintf(tls, str(3387), unsafe.Pointer(_1_zSys)) 1652 } 1653 if _g.XzVfs != nil { 1654 _1_zSys = bin.Xsqlite3_mprintf(tls, str(3397), unsafe.Pointer(_1_zSys), unsafe.Pointer(_g.XzVfs)) 1655 } 1656 if _g.XiTrace >= int32(2) { 1657 _logMessage(tls, str(3411), unsafe.Pointer(_1_zSys)) 1658 } 1659 _1_zSys = bin.Xsqlite3_mprintf(tls, str(3424), unsafe.Pointer(_1_zSys)) 1660 _1_rc = crt.Xsystem(tls, _1_zSys) 1661 if _1_rc != 0 { 1662 _errorMessage(tls, str(3429), _1_rc) 1663 } 1664 bin.Xsqlite3_free(tls, unsafe.Pointer(_1_zSys)) 1665 _0: 1666 } 1667 1668 // C comment 1669 // /* 1670 // ** Wait for a client process to complete all its tasks 1671 // */ 1672 func _waitForClient(tls *crt.TLS, _iClient int32, _iTimeout int32, _zErrPrefix *int8) { 1673 var _rc int32 1674 var _pStmt unsafe.Pointer 1675 if _iClient > int32(0) { 1676 _pStmt = _prepareSql(tls, str(3463), _iClient) 1677 goto _1 1678 } 1679 _pStmt = _prepareSql(tls, str(3559)) 1680 _1: 1681 _g.XiTimeout = int32(0) 1682 _2: 1683 if ((store2(&_rc, bin.Xsqlite3_step(tls, _pStmt)) == int32(5)) || (_rc == int32(100))) && (_iTimeout > int32(0)) { 1684 bin.Xsqlite3_reset(tls, _pStmt) 1685 bin.Xsqlite3_sleep(tls, int32(50)) 1686 _iTimeout -= int32(50) 1687 goto _2 1688 } 1689 bin.Xsqlite3_finalize(tls, _pStmt) 1690 _g.XiTimeout = int32(10000) 1691 if _rc == int32(101) { 1692 goto _6 1693 } 1694 if _zErrPrefix == nil { 1695 _zErrPrefix = str(454) 1696 } 1697 if _iClient > int32(0) { 1698 _errorMessage(tls, str(3640), unsafe.Pointer(_zErrPrefix), _iClient) 1699 goto _9 1700 } 1701 _errorMessage(tls, str(3672), unsafe.Pointer(_zErrPrefix)) 1702 _9: 1703 _6: 1704 } 1705 1706 // C comment 1707 // /* 1708 // ** Find the number of characters up to the start of the next "--end" token. 1709 // */ 1710 func _findEnd(tls *crt.TLS, _z *int8, _pnLine *int32) (r0 int32) { 1711 var _n int32 1712 _n = int32(0) 1713 _0: 1714 if ((*elem1(_z, uintptr(_n))) != 0) && (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3706), uint64(5)) != 0 || ((int32(*elem3(*crt.X__ctype_b_loc(tls), uintptr(int32(uint8(*elem1(_z, uintptr(_n+int32(5)))))))) & int32(8192)) == 0)) { 1715 _n += _tokenLength(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), _pnLine) 1716 goto _0 1717 } 1718 return _n 1719 } 1720 1721 // C comment 1722 // /* Return a pointer to the tail of a filename 1723 // */ 1724 func _filenameTail(tls *crt.TLS, _z *int8) (r0 *int8) { 1725 var _i, _j int32 1726 _i = store2(&_j, int32(0)) 1727 _0: 1728 if (*elem1(_z, uintptr(_i))) == 0 { 1729 goto _3 1730 } 1731 if int32(*elem1(_z, uintptr(_i))) == int32(47) { 1732 _j = _i + int32(1) 1733 } 1734 _i += 1 1735 goto _0 1736 _3: 1737 return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(_j))) 1738 } 1739 1740 // C comment 1741 // /* This routine exists as a convenient place to set a debugger 1742 // ** breakpoint. 1743 // */ 1744 func _test_breakpoint(tls *crt.TLS) { 1745 _test_breakpointØ00cntØ001 += 1 1746 } 1747 1748 // C comment 1749 // /* This routine exists as a convenient place to set a debugger 1750 // ** breakpoint. 1751 // */ 1752 var _test_breakpointØ00cntØ001 int32 1753 1754 // C comment 1755 // /* 1756 // ** Interpret zArg as a boolean value. Return either 0 or 1. 1757 // */ 1758 func _booleanValue(tls *crt.TLS, _zArg *int8) (r0 int32) { 1759 var _i int32 1760 if _zArg == nil { 1761 return int32(0) 1762 } 1763 _i = int32(0) 1764 _1: 1765 if int32(*elem1(_zArg, uintptr(_i))) < int32(48) || int32(*elem1(_zArg, uintptr(_i))) > int32(57) { 1766 goto _5 1767 } 1768 _i += 1 1769 goto _1 1770 _5: 1771 if (_i > int32(0)) && (int32(*elem1(_zArg, uintptr(_i))) == int32(0)) { 1772 return crt.Xatoi(tls, _zArg) 1773 } 1774 if (bin.Xsqlite3_stricmp(tls, _zArg, str(3712)) == int32(0)) || (bin.Xsqlite3_stricmp(tls, _zArg, str(3715)) == int32(0)) { 1775 return int32(1) 1776 } 1777 if (bin.Xsqlite3_stricmp(tls, _zArg, str(3719)) == int32(0)) || (bin.Xsqlite3_stricmp(tls, _zArg, str(3723)) == int32(0)) { 1778 return int32(0) 1779 } 1780 _errorMessage(tls, str(3726), unsafe.Pointer(_zArg)) 1781 return int32(0) 1782 } 1783 1784 func bool2int(b bool) int32 { 1785 if b { 1786 return 1 1787 } 1788 return 0 1789 } 1790 func bug20530(interface{}) {} //TODO remove when https://github.com/golang/go/issues/20530 is fixed. 1791 func init() { nzf32 *= -1; nzf64 *= -1 } 1792 1793 var inf = math.Inf(1) 1794 var nzf32 float32 // -0.0 1795 var nzf64 float64 // -0.0 1796 func elem0(a **int8, index uintptr) **int8 { 1797 return (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index)) 1798 } 1799 func elem4(a *unsafe.Pointer, index uintptr) *unsafe.Pointer { 1800 return (*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index)) 1801 } 1802 func elem5(a *[100]int8, index uintptr) *[100]int8 { 1803 return (*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 100*index)) 1804 } 1805 func elem1(a *int8, index uintptr) *int8 { 1806 return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 1*index)) 1807 } 1808 func elem3(a *uint16, index uintptr) *uint16 { 1809 return (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 2*index)) 1810 } 1811 func postInc1(p **int8, d int) *int8 { 1812 q := (*uintptr)(unsafe.Pointer(p)) 1813 v := *q 1814 *q += uintptr(d) 1815 return (*int8)(unsafe.Pointer(v)) 1816 } 1817 func postInc2(p *int32, d int32) int32 { v := *p; *p += d; return v } 1818 func preInc2(p *int32, d int32) int32 { v := *p + d; *p = v; return v } 1819 func store1(p **int8, v *int8) *int8 { *p = v; return v } 1820 func store2(p *int32, v int32) int32 { *p = v; return v } 1821 1822 type TGlobal struct { 1823 Xargv0 *int8 1824 XzVfs *int8 1825 XzDbFile *int8 1826 Xdb unsafe.Pointer 1827 XzErrLog *int8 1828 XpErrLog unsafe.Pointer 1829 XzLog *int8 1830 XpLog unsafe.Pointer 1831 XzName [32]int8 1832 XtaskId int32 1833 XiTrace int32 1834 XbSqlTrace int32 1835 XbIgnoreSqlErrors int32 1836 XnError int32 1837 XnTest int32 1838 XiTimeout int32 1839 XbSync int32 1840 } // t6 struct{argv0 *int8,zVfs *int8,zDbFile *int8,db *struct{},zErrLog *int8,pErrLog *struct{},zLog *int8,pLog *struct{},zName [32]int8,taskId int32,iTrace int32,bSqlTrace int32,bIgnoreSqlErrors int32,nError int32,nTest int32,iTimeout int32,bSync int32} 1841 1842 type XString struct { 1843 Xz *int8 1844 Xn int32 1845 XnAlloc int32 1846 } // t7 struct{z *int8,n int32,nAlloc int32} 1847 func str(n int) *int8 { return (*int8)(unsafe.Pointer(&strTab[n])) } 1848 func wstr(n int) *int32 { return (*int32)(unsafe.Pointer(&strTab[n])) } 1849 1850 var strTab = []byte("*.test\x002017-06-08 14:26:16 0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b\x00SQLite library and header mismatch\x0aLibrary: %s\x0aHeader: %s\x0a\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\x0a\x00%05d.client%02d\x00BEGIN: %s\x00 %s\x00\x0a\x00With SQLite 3.19.3 2017-06-08 14:26:16 0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b\x0a\x00-DSQLITE_%s\x0a\x00... %strying to unlink '%s'\x0a\x00still \x00\x00unable to unlink '%s' after %d attempts\x0a\x00cannot open [%s]\x00PRAGMA journal_mode=%Q;\x00PRAGMA synchronous=OFF\x00vfsname\x00eval\x00start-client\x00begin %s (%d)\x00end %s (%d)\x00end-client\x00missing script filename\x00DROP TABLE IF EXISTS task;\x0aDROP TABLE IF EXISTS counters;\x0aDROP TABLE IF EXISTS client;\x0aCREATE TABLE task(\x0a id INTEGER PRIMARY KEY,\x0a name TEXT,\x0a client INTEGER,\x0a starttime DATE,\x0a endtime DATE,\x0a script TEXT\x0a);CREATE INDEX task_i1 ON task(client, starttime);\x0aCREATE INDEX task_i2 ON task(client, endtime);\x0aCREATE TABLE counters(nError,nTest);\x0aINSERT INTO counters VALUES(0,0);\x0aCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\x0a\x00begin script [%s] cycle %d\x0a\x00end script [%s] cycle %d\x0a\x00during shutdown...\x0a\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\x0a\x00END: %s\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\x0a\x00Options:\x0a --errlog FILENAME Write errors to FILENAME\x0a --journalmode MODE Use MODE as the journal_mode\x0a --log FILENAME Log messages to FILENAME\x0a --quiet Suppress unnecessary output\x0a --vfs NAME Use NAME as the VFS\x0a --repeat N Repeat the test N times\x0a --sqltrace Enable SQL tracing\x0a --sync Enable synchronous disk writes\x0a --timeout MILLISEC Busy timeout is MILLISEC\x0a --trace BOOLEAN Enable or disable tracing\x0a\x00%s:%i: assertion failure in %s: %s\x0a\x00../../../sqlite.org/sqlite-src-3190300/mptest/mptest.c\x00hasArg==0 || hasArg==1\x00command-line option \"--%s\" requires an argument\x00findOption\x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s%.*s\x0a\x00(info) %s\x00(errcode=%d) %s\x00%s: \x00%s:ERROR: \x00%s\x0a%s\x0a\x00timeout after %dms\x00main\x00 \x00nil\x00'\x00out of memory\x00[%.*s]\x00%s: unrecognized arguments:\x00BEGIN IMMEDIATE\x00in startScript: %s\x00UPDATE counters SET nError=nError+%d, nTest=nTest+%d\x00SELECT 1 FROM client WHERE id=%d AND wantHalt\x00DELETE FROM client WHERE id=%d\x00COMMIT TRANSACTION;\x00SELECT script, id, name FROM task WHERE client=%d AND starttime IS NULL ORDER BY id LIMIT 1\x00%s\x00UPDATE task SET starttime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00Waited over 30 seconds with no work. Giving up.\x00DELETE FROM client WHERE id=%d; COMMIT;\x00COMMIT\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\x0aExpected [%.*s]\x0a Got [%s]\x00glob\x00notglob\x00line %d of %s:\x0aExpected [%s]\x0a Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\x0a\x00end script [%s]\x0a\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\x0a\x00task\x00line %d of %s: bad client number: %d\x00%s:%d\x00INSERT INTO task(client,script,name) VALUES(%d,'%q',%Q)\x00breakpoint\x00show-sql-errors\x00line %d of %s: unknown command --%s\x00g.iTimeout>0\x00error(%d)\x00evalSql\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00rb\x00cannot open \"%s\" for reading\x00--endif\x00--else\x00--if\x00INSERT OR IGNORE INTO client VALUES(%d,0)\x00%s \"%s\" --client %d --trace %d\x00%z --sqltrace\x00%z --sync\x00%z --vfs \"%s\"\x00system('%q')\x00%z &\x00system() fails with error code %d\x00SELECT 1 FROM task WHERE client=%d AND client IN (SELECT id FROM client) AND endtime IS NULL\x00SELECT 1 FROM task WHERE client IN (SELECT id FROM client) AND endtime IS NULL\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00--end\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00")