mirror of
https://gitlab.com/cznic/sqlite.git
synced 2025-06-16 23:48:36 +00:00
SQLite 3.37.0: rc2
This commit is contained in:
Makefilego.modgo.sum
internal
mptest
main_darwin_amd64.gomain_freebsd_amd64.gomain_linux_386.gomain_linux_amd64.gomain_linux_arm.gomain_linux_arm64.gomain_linux_s390x.gomain_windows_amd64.go
testfixture
lib
capi_linux_s390x.gocapi_windows_amd64.gosqlite_darwin_amd64.gosqlite_freebsd_amd64.gosqlite_linux_386.gosqlite_linux_amd64.gosqlite_linux_arm.gosqlite_linux_arm64.gosqlite_linux_s390x.gosqlite_windows_amd64.go
libtest
capi_linux_s390x.gocapi_windows_amd64.gosqlite_darwin_amd64.gosqlite_freebsd_amd64.gosqlite_linux_386.gosqlite_linux_amd64.gosqlite_linux_arm.gosqlite_linux_arm64.gosqlite_linux_s390x.gosqlite_windows_amd64.go
speedtest1
main_darwin_amd64.gomain_freebsd_amd64.gomain_linux_386.gomain_linux_amd64.gomain_linux_arm.gomain_linux_arm64.gomain_linux_s390x.gomain_windows_amd64.go
tcl_test.gotestdata
3.36.0
tcl
8_3_names.testaffinity2.testaffinity3.testaggerror.testaggnested.testalias.testall.testalter.testalter2.testalter3.testalter4.testalterauth.testalterauth2.testaltercol.testaltercorrupt.testalterdropcol.testalterdropcol2.testalterlegacy.testaltermalloc.testaltermalloc2.testaltermalloc3.testalterqf.testaltertab.testaltertab2.testaltertab3.testamatch1.testanalyze.testanalyze3.testanalyze4.testanalyze5.testanalyze6.testanalyze7.testanalyze8.testanalyze9.testanalyzeC.testanalyzeD.testanalyzeE.testanalyzeF.testanalyzeG.testanalyzer1.testasync.testasync2.testasync3.testasync4.testasync5.testatof1.testatomic.testatomic2.testatrc.cattach.testattach2.testattach3.testattach4.testattachmalloc.testauth.testauth2.testauth3.testautoanalyze1.testautoinc.testautoindex1.testautoindex2.testautoindex3.testautoindex4.testautoindex5.testautovacuum.testautovacuum_ioerr2.testavfs.testavtrans.testbackcompat.testbackup.testbackup2.testbackup4.testbackup5.testbackup_ioerr.testbackup_malloc.testbadutf.testbadutf2.testbc_common.tclbestindex1.testbestindex2.testbestindex3.testbestindex4.testbestindex5.testbestindex6.testbestindex7.testbetween.testbigfile.testbigfile2.testbigmmap.testbigrow.testbigsort.testbind.testbindxfer.testbitvec.testblob.testboundary1.tclboundary1.testboundary2.tclboundary2.testboundary3.tclboundary3.testboundary4.tclboundary4.testbtree01.testbtree02.testbtreefault.testbusy.testbusy2.testcache.testcacheflush.testcachespill.testcapi2.testcapi3.testcapi3b.testcapi3c.testcapi3d.testcapi3e.testcarray01.testcast.testcffault.testcheck.testcheckfault.testchunksize.testclose.testclosure01.testcoalesce.testcollate1.testcollate2.testcollate3.testcollate4.testcollate5.testcollate6.testcollate7.testcollate8.testcollate9.testcollateA.testcollateB.testcolmeta.testcolname.testcolumncount.testconflict.testconflict2.testconflict3.testcontrib01.testcorrupt.testcorrupt2.testcorrupt3.testcorrupt4.testcorrupt5.testcorrupt6.testcorrupt7.testcorrupt8.testcorrupt9.testcorruptA.testcorruptB.testcorruptC.testcorruptD.testcorruptE.testcorruptF.testcorruptG.testcorruptH.testcorruptI.testcorruptJ.testcorruptK.testcorruptL.testcorruptM.testcorruptN.testcost.testcount.testcountofview.testcoveridxscan.testcrash.testcrash2.testcrash3.testcrash4.testcrash5.testcrash6.testcrash7.testcrash8.testcrashM.testcrashtest1.ccreatetab.testcse.testcsv01.testctime.testcursorhint.testcursorhint2.testdataversion1.testdate.testdate2.testdbdata.testdbfuzz.cdbfuzz001.testdbfuzz2-seed1.dbdbfuzz2.cdbpage.testdbstatus.testdbstatus2.testdecimal.testdefault.testdelete.testdelete2.testdelete3.testdelete4.testdelete_db.testdescidx1.testdescidx2.testdescidx3.testdiskfull.testdistinct.testdistinct2.testdistinctagg.teste_blobbytes.teste_blobclose.teste_blobopen.teste_blobwrite.teste_changes.teste_createtable.teste_delete.teste_droptrigger.teste_dropview.teste_expr.teste_fkey.teste_fts3.teste_insert.teste_reindex.teste_resolve.teste_select.teste_select2.teste_totalchanges.teste_update.teste_uri.teste_vacuum.teste_wal.teste_walauto.teste_walckpt.teste_walhook.testemptytable.testenc.testenc2.testenc3.testenc4.testeqp.testerrmsg.testeval.testexclusive.testexclusive2.testexec.testexists.testexists2.testexistsfault.testexpr.testexpr2.testexprfault.testextension01.testexternal_reader.testextraquick.testfallocate.testfilectrl.testfilefmt.testfilter1.testfilter2.tclfilter2.testfilterfault.testfkey1.testfkey2.testfkey3.testfkey4.testfkey5.testfkey6.testfkey7.testfkey8.testfkey_malloc.testfordelete.testformat4.testfts-9fd058691.testfts1a.testfts1b.testfts1c.testfts1d.testfts1e.testfts1f.testfts1i.testfts1j.testfts1k.testfts1l.testfts1m.testfts1n.testfts1o.testfts1porter.testfts2.testfts2a.testfts2b.testfts2c.testfts2d.testfts2e.testfts2f.testfts2g.testfts2h.testfts2i.testfts2j.testfts2k.testfts2l.testfts2m.testfts2n.testfts2o.testfts2p.testfts2q.testfts2r.testfts2token.testfts3.testfts3_common.tclfts3aa.testfts3ab.testfts3ac.testfts3ad.testfts3ae.testfts3af.testfts3ag.testfts3ah.testfts3ai.testfts3aj.testfts3ak.testfts3al.testfts3am.testfts3an.testfts3ao.testfts3atoken.testfts3auto.testfts3aux1.testfts3aux2.testfts3b.testfts3c.testfts3comp1.testfts3conf.testfts3corrupt.testfts3corrupt2.testfts3corrupt3.testfts3corrupt4.testfts3corrupt5.testfts3corrupt6.testfts3cov.testfts3d.testfts3defer.testfts3defer2.testfts3defer3.testfts3drop.testfts3e.testfts3expr.testfts3expr2.testfts3expr3.testfts3expr4.testfts3expr5.testfts3fault.testfts3fault2.testfts3first.testfts3fuzz001.testfts3join.testfts3malloc.testfts3matchinfo.testfts3matchinfo2.testfts3misc.testfts3near.testfts3offsets.testfts3prefix.testfts3prefix2.testfts3query.testfts3rank.testfts3rnd.testfts3shared.testfts3snippet.testfts3snippet2.testfts3sort.testfts3tok1.testfts3tok_err.testfts3varint.testfts4aa.testfts4check.testfts4content.testfts4docid.testfts4growth.testfts4growth2.testfts4incr.testfts4langid.testfts4lastrowid.testfts4merge.testfts4merge2.testfts4merge3.testfts4merge4.testfts4merge5.testfts4min.testfts4noti.testfts4onepass.testfts4opt.testfts4record.testfts4rename.testfts4umlaut.testfts4unicode.testfts4upfrom.testfull.testfunc.testfunc2.testfunc3.testfunc4.testfunc5.testfunc6.testfunc7.testfuzz-oss1.testfuzz.testfuzz2.testfuzz3.testfuzz4.testfuzz_common.tclfuzz_malloc.testfuzzcheck.cfuzzdata1.dbfuzzdata2.dbfuzzdata3.dbfuzzdata4.dbfuzzdata5.dbfuzzdata6.dbfuzzdata7.dbfuzzdata8.dbfuzzer1.testfuzzer2.testfuzzerfault.testgcfault.testgencol1.testgenesis.tclhaving.testhexlit.testhidden.testhook.testhook2.testicu.testieee754.testimposter1.testin.testin2.testin3.testin4.testin5.testin6.testincrblob.testincrblob2.testincrblob3.testincrblob4.testincrblob_err.testincrblobfault.testincrcorrupt.testincrvacuum.testincrvacuum2.testincrvacuum3.testincrvacuum_ioerr.testindex.testindex2.testindex3.testindex4.testindex5.testindex6.testindex7.testindex8.testindex9.testindexedby.testindexexpr1.testindexexpr2.testindexfault.testinit.testinsert.testinsert2.testinsert3.testinsert4.testinsert5.testinsertfault.testinstr.testinstrfault.testintarray.testinterrupt.testinterrupt2.testintpkey.testintreal.testio.testioerr.testioerr2.testioerr3.testioerr4.testioerr5.testioerr6.testistrue.testjoin.testjoin2.testjoin3.testjoin4.testjoin5.testjoin6.testjournal1.testjournal2.testjournal3.testjrnlmode.testjrnlmode2.testjrnlmode3.testjson101.testjson102.testjson103.testjson104.testjson105.testkeyword1.testkvtest.clastinsert.testlaststmtchanges.testlemon-test01.ylike.testlike2.testlike3.testlimit.testlimit2.testloadext.testloadext2.testlock.testlock2.testlock3.testlock4.testlock5.testlock6.testlock7.testlock_common.tcllookaside.testmain.testmake-where7.tclmalloc.testmalloc3.testmalloc4.testmalloc5.testmalloc6.testmalloc7.testmalloc8.testmalloc9.testmallocA.testmallocAll.testmallocB.testmallocC.testmallocD.testmallocE.testmallocF.testmallocG.testmallocH.testmallocI.testmallocJ.testmallocK.testmallocL.testmallocM.testmalloc_common.tclmalloctraceviewer.tclmanydb.testmem5.testmemdb.testmemdb1.testmemjournal.testmemleak.testmemsubsys1.testmemsubsys2.testminmax.testminmax2.testminmax3.testminmax4.testmisc1.testmisc2.testmisc3.testmisc4.testmisc5.testmisc6.testmisc7.testmisc8.testmisuse.testmjournal.testmmap1.testmmap2.testmmap3.testmmap4.testmmapfault.testmmapwarm.testmultiplex.testmultiplex2.testmultiplex3.testmultiplex4.testmutex1.testmutex2.testnan.testnockpt.testnolock.testnormalize.testnotify1.testnotify2.testnotify3.testnotnull.testnotnull2.testnotnullfault.testnull.testnulls1.testnumcast.testnumindex1.testoffset1.testopenv2.testoptfuzz-db01.coptfuzz-db01.txtoptfuzz.corderby1.testorderby2.testorderby3.testorderby4.testorderby5.testorderby6.testorderby7.testorderby8.testorderby9.testorderbyA.testoserror.testossfuzz.cossshell.covfl.testpager1.testpager2.testpager3.testpager4.testpagerfault.testpagerfault2.testpagerfault3.testpageropt.testpagesize.testparser1.testpcache.testpcache2.testpercentile.testpermutations.testpg_common.tclpragma.testpragma2.testpragma3.testpragma4.testpragma5.testpragmafault.testprefixes.testprintf.testprintf2.testprogress.testptrchng.testpushdown.testqueryonly.testquick.testquota-glob.testquota.testquota2.testquote.testrandexpr1.tclrandexpr1.testrbu.testrdonly.testrecover.testregexp1.testregexp2.testreindex.testreleasetest.tclreleasetest_data.tclresetdb.testresolver01.testreturning1.testrollback.testrollback2.testrollbackfault.testround1.testrowallock.testrowhash.testrowid.testrowvalue.testrowvalue2.testrowvalue3.testrowvalue4.testrowvalue5.testrowvalue6.testrowvalue7.testrowvalue8.testrowvalue9.testrowvaluefault.testrowvaluevtab.testrtree.testrun-wordcount.shsavepoint.testsavepoint2.testsavepoint4.testsavepoint5.testsavepoint6.testsavepoint7.testsavepointfault.testscanstatus.testschema.testschema2.testschema3.testschema4.testschema5.testschema6.testschemafault.testsecuredel.testsecuredel2.testselect1.testselect2.testselect3.testselect4.testselect5.testselect6.testselect7.testselect8.testselect9.testselectA.testselectB.testselectC.testselectD.testselectE.testselectF.testselectG.testserver1.testsession.testsessionfuzz-data1.dbsessionfuzz.cshared.testshared2.testshared3.testshared4.testshared6.testshared7.testshared8.testshared9.testsharedA.testsharedB.testshared_err.testsharedlock.testshell1.testshell2.testshell3.testshell4.testshell5.testshell6.testshell7.testshell8.testshmlock.testshortread1.testshow_speedtest1_rtree.tclshrink.testsidedelete.testskipscan1.testskipscan2.testskipscan3.testskipscan5.testskipscan6.testsnapshot.testsnapshot2.testsnapshot3.testsnapshot4.testsnapshot_fault.testsnapshot_up.testsoak.testsoftheap1.testsort.testsort2.testsort3.testsort4.testsort5.testsorterref.testsortfault.testspeed1.testspeed1p.explainspeed1p.testspeed2.testspeed3.testspeed4.testspeed4p.explainspeed4p.testspeedtest1.cspellfix.testspellfix2.testspellfix3.testspellfix4.testsqldiff1.testsqllimits1.testsqllog.teststartup.cstat.teststatfault.teststmt.teststmtvtab1.testsubjournal.testsubquery.testsubquery2.testsubselect.testsubstr.testsubtype1.testsuperlock.testswarmvtab.testswarmvtab2.testswarmvtab3.testswarmvtabfault.testsymlink.testsymlink2.testsync.testsync2.testsyscall.testsysfault.testtabfunc01.testtable.testtableapi.testtableopts.testtclsqlite.testtempdb.testtempdb2.testtempfault.testtemptable.testtemptable2.testtemptable3.testtemptrigger.testtester.tclthread001.testthread002.testthread003.testthread004.testthread005.testthread1.testthread2.testthread_common.tclthreadtest1.cthreadtest2.cthreadtest3.cthreadtest4.cthreadtest5.ctime-wordcount.shtkt-02a8e81d44.testtkt-18458b1a.testtkt-26ff0c2d1e.testtkt-2a5629202f.testtkt-2d1a5c67d.testtkt-2ea2425d34.testtkt-31338dca7e.testtkt-313723c356.testtkt-385a5b56b9.testtkt-38cb5df375.testtkt-3998683a16.testtkt-3a77c9714e.testtkt-3fe897352e.testtkt-4a03edc4c8.testtkt-4c86b126f2.testtkt-4dd95f6943.testtkt-4ef7e3cfca.testtkt-54844eea3f.testtkt-5d863f876e.testtkt-5e10420e8d.testtkt-5ee23731f.testtkt-6bfb98dfc0.testtkt-752e1646fc.testtkt-78e04e52ea.testtkt-7a31705a7e6.testtkt-7bbfb7d442.testtkt-80ba201079.testtkt-80e031a00f.testtkt-8454a207b9.testtkt-868145d012.testtkt-8c63ff0ec.testtkt-91e2e8ba6f.testtkt-94c04eaadb.testtkt-9a8b09f8e6.testtkt-9d68c883.testtkt-9f2eb3abac.testtkt-a7b7803e.testtkt-a7debbe0.testtkt-a8a0d2996a.testtkt-b1d3a2e531.testtkt-b351d95f9.testtkt-b72787b1.testtkt-b75a9ca6b0.testtkt-ba7cbfaedc.testtkt-bd484a090c.testtkt-bdc6bbbb38.testtkt-c48d99d690.testtkt-c694113d5.testtkt-cbd054fa6b.testtkt-d11f09d36e.testtkt-d635236375.testtkt-d82e3f3721.testtkt-f3e5abed55.testtkt-f67b41381a.testtkt-f777251dc7a.testtkt-f7b4edec.testtkt-f973c7ac31.testtkt-fa7bf5ec.testtkt-fc62af4523.testtkt-fc7bd6358f.testtkt1435.testtkt1443.testtkt1444.testtkt1449.testtkt1473.testtkt1501.testtkt1512.testtkt1514.testtkt1536.testtkt1537.testtkt1567.testtkt1644.testtkt1667.testtkt1873.testtkt2141.testtkt2192.testtkt2213.testtkt2251.testtkt2285.testtkt2332.testtkt2339.testtkt2391.testtkt2409.testtkt2450.testtkt2565.testtkt2640.testtkt2643.testtkt2686.testtkt2767.testtkt2817.testtkt2820.testtkt2822.testtkt2832.testtkt2854.testtkt2920.testtkt2927.testtkt2942.testtkt3080.testtkt3093.testtkt3121.testtkt3201.testtkt3292.testtkt3298.testtkt3334.testtkt3346.testtkt3357.testtkt3419.testtkt3424.testtkt3442.testtkt3457.testtkt3461.testtkt3493.testtkt3508.testtkt3522.testtkt3527.testtkt3541.testtkt3554.testtkt3581.testtkt35xx.testtkt3630.testtkt3718.testtkt3731.testtkt3757.testtkt3761.testtkt3762.testtkt3773.testtkt3791.testtkt3793.testtkt3810.testtkt3824.testtkt3832.testtkt3838.testtkt3841.testtkt3871.testtkt3879.testtkt3911.testtkt3918.testtkt3922.testtkt3929.testtkt3935.testtkt3992.testtkt3997.testtkt4018.testtokenize.testtpch01.testtrace.testtrace2.testtrace3.testtrans.testtrans2.testtrans3.testtransitive1.testtrigger1.testtrigger2.testtrigger3.testtrigger4.testtrigger5.testtrigger6.testtrigger7.testtrigger8.testtrigger9.testtriggerA.testtriggerB.testtriggerC.testtriggerD.testtriggerE.testtriggerF.testtriggerG.testtriggerupfrom.testtrustschema1.testtt3_checkpoint.ctt3_index.ctt3_lookaside1.ctt3_shared.ctt3_stress.ctt3_vacuum.ctypes.testtypes2.testtypes3.testunionall.testunionall2.testunionallfault.testunionvtab.testunionvtabfault.testunique.testunique2.testunixexcl.testunordered.testupdate.testupdate2.testupfrom1.tclupfrom1.testupfrom2.testupfrom3.testupfromfault.testupsert1.testupsert2.testupsert3.testupsert4.testupsert5.testupsertfault.testuri.testuri2.testuserauth01.testutf16align.testvacuum-into.testvacuum.testvacuum2.testvacuum3.testvacuum4.testvacuum5.testvacuum6.testvacuummem.testvarint.testveryquick.testview.testview2.testvtab1.testvtab2.testvtab3.testvtab4.testvtab5.testvtab6.testvtab7.testvtab8.testvtab9.testvtabA.testvtabB.testvtabC.testvtabD.testvtabE.testvtabF.testvtabH.testvtabI.testvtabJ.testvtab_alter.testvtab_err.testvtab_shared.testvtabdrop.testwal.testwal2.testwal3.testwal4.testwal5.testwal6.testwal64k.testwal7.testwal8.testwal9.testwal_common.tclwalbak.testwalbig.testwalblock.testwalcksum.testwalcrash.testwalcrash2.testwalcrash3.testwalcrash4.testwalfault.testwalfault2.testwalhook.testwalmode.testwalnoshm.testwaloverwrite.testwalpersist.testwalprotocol.testwalprotocol2.testwalro.testwalro2.testwalrofault.testwalsetlk.testwalshared.testwalslow.testwalthread.testwalvfs.testwapp.tclwapptest.tclwhere.testwhere2.testwhere3.testwhere4.testwhere5.testwhere6.testwhere7.testwhere8.testwhere9.testwhereA.testwhereB.testwhereC.testwhereD.testwhereE.testwhereF.testwhereG.testwhereH.testwhereI.testwhereJ.testwhereK.testwhereL.testwhereM.testwherefault.testwherelfault.testwherelimit.testwherelimit2.testwin32heap.testwin32lock.testwin32longpath.testwin32nolock.testwindow1.testwindow2.tclwindow2.testwindow3.tclwindow3.testwindow4.tclwindow4.testwindow5.testwindow6.testwindow7.tclwindow7.testwindow8.tclwindow8.testwindow9.testwindowA.testwindowB.testwindowerr.tclwindowerr.testwindowfault.testwindowpushd.testwith1.testwith2.testwith3.testwith4.testwith5.testwith6.testwithM.testwithout_rowid1.testwithout_rowid2.testwithout_rowid3.testwithout_rowid4.testwithout_rowid5.testwithout_rowid6.testwithout_rowid7.testwordcount.cwritecrash.testzeroblob.testzerodamage.testzipfile.testzipfile2.testzipfilefault.test
3.37.0
tcl
8_3_names.testaffinity2.testaffinity3.testaggerror.testaggnested.testalias.testall.testalter.testalter2.testalter3.testalter4.testalterauth.testalterauth2.testaltercol.testaltercorrupt.testalterdropcol.testalterdropcol2.testalterfault.testalterlegacy.testaltermalloc.testaltermalloc2.testaltermalloc3.testalterqf.testaltertab.testaltertab2.testaltertab3.testamatch1.testanalyze.testanalyze3.testanalyze4.testanalyze5.testanalyze6.testanalyze7.testanalyze8.testanalyze9.testanalyzeC.testanalyzeD.testanalyzeE.testanalyzeF.testanalyzeG.testanalyzer1.testasync.testasync2.testasync3.testasync4.testasync5.testatof1.testatomic.testatomic2.testatrc.cattach.testattach2.testattach3.testattach4.testattachmalloc.testauth.testauth2.testauth3.testautoanalyze1.testautoinc.testautoindex1.testautoindex2.testautoindex3.testautoindex4.testautoindex5.testautovacuum.testautovacuum2.testautovacuum_ioerr2.testavfs.testavtrans.testbackcompat.testbackup.testbackup2.testbackup4.testbackup5.testbackup_ioerr.testbackup_malloc.testbadutf.testbadutf2.testbc_common.tclbestindex1.testbestindex2.testbestindex3.testbestindex4.testbestindex5.testbestindex6.testbestindex7.testbetween.testbigfile.testbigfile2.testbigmmap.testbigrow.testbigsort.testbind.testbindxfer.testbitvec.testblob.testboundary1.tclboundary1.testboundary2.tclboundary2.testboundary3.tclboundary3.testboundary4.tclboundary4.testbtree01.testbtree02.testbtreefault.testbusy.testbusy2.testcache.testcacheflush.testcachespill.testcapi2.testcapi3.testcapi3b.testcapi3c.testcapi3d.testcapi3e.testcarray01.testcast.testcffault.testchanges.testcheck.testcheckfault.testchunksize.testclose.testclosure01.testcoalesce.testcollate1.testcollate2.testcollate3.testcollate4.testcollate5.testcollate6.testcollate7.testcollate8.testcollate9.testcollateA.testcollateB.testcolmeta.testcolname.testcolumncount.testconflict.testconflict2.testconflict3.testcontrib01.testcorrupt.testcorrupt2.testcorrupt3.testcorrupt4.testcorrupt5.testcorrupt6.testcorrupt7.testcorrupt8.testcorrupt9.testcorruptA.testcorruptB.testcorruptC.testcorruptD.testcorruptE.testcorruptF.testcorruptG.testcorruptH.testcorruptI.testcorruptJ.testcorruptK.testcorruptL.testcorruptM.testcorruptN.testcost.testcount.testcountofview.testcoveridxscan.testcrash.testcrash2.testcrash3.testcrash4.testcrash5.testcrash6.testcrash7.testcrash8.testcrashM.testcrashtest1.ccreatetab.testcse.testcsv01.testctime.testcursorhint.testcursorhint2.testdataversion1.testdate.testdate2.testdbdata.testdbfuzz.cdbfuzz001.testdbfuzz2-seed1.dbdbfuzz2.cdbpage.testdbstatus.testdbstatus2.testdecimal.testdefault.testdelete.testdelete2.testdelete3.testdelete4.testdelete_db.testdescidx1.testdescidx2.testdescidx3.testdiskfull.testdistinct.testdistinct2.testdistinctagg.teste_blobbytes.teste_blobclose.teste_blobopen.teste_blobwrite.teste_changes.teste_createtable.teste_delete.teste_droptrigger.teste_dropview.teste_expr.teste_fkey.teste_fts3.teste_insert.teste_reindex.teste_resolve.teste_select.teste_select2.teste_totalchanges.teste_update.teste_uri.teste_vacuum.teste_wal.teste_walauto.teste_walckpt.teste_walhook.testemptytable.testenc.testenc2.testenc3.testenc4.testeqp.testerrmsg.testeval.testexclusive.testexclusive2.testexec.testexists.testexists2.testexistsfault.testexpr.testexpr2.testexprfault.testextension01.testexternal_reader.testextraquick.testfallocate.testfilectrl.testfilefmt.testfilter1.testfilter2.tclfilter2.testfilterfault.testfkey1.testfkey2.testfkey3.testfkey4.testfkey5.testfkey6.testfkey7.testfkey8.testfkey_malloc.testfordelete.testformat4.testfts-9fd058691.testfts1a.testfts1b.testfts1c.testfts1d.testfts1e.testfts1f.testfts1i.testfts1j.testfts1k.testfts1l.testfts1m.testfts1n.testfts1o.testfts1porter.testfts2.testfts2a.testfts2b.testfts2c.testfts2d.testfts2e.testfts2f.testfts2g.testfts2h.testfts2i.testfts2j.testfts2k.testfts2l.testfts2m.testfts2n.testfts2o.testfts2p.testfts2q.testfts2r.testfts2token.testfts3.testfts3_common.tclfts3aa.testfts3ab.testfts3ac.testfts3ad.testfts3ae.testfts3af.testfts3ag.testfts3ah.testfts3ai.testfts3aj.testfts3ak.testfts3al.testfts3am.testfts3an.testfts3ao.testfts3atoken.testfts3auto.testfts3aux1.testfts3aux2.testfts3b.testfts3c.testfts3comp1.testfts3conf.testfts3corrupt.testfts3corrupt2.testfts3corrupt3.testfts3corrupt4.testfts3corrupt5.testfts3corrupt6.testfts3cov.testfts3d.testfts3defer.testfts3defer2.testfts3defer3.testfts3drop.testfts3e.testfts3expr.testfts3expr2.testfts3expr3.testfts3expr4.testfts3expr5.testfts3f.testfts3fault.testfts3fault2.testfts3first.testfts3fuzz001.testfts3join.testfts3malloc.testfts3matchinfo.testfts3matchinfo2.testfts3misc.testfts3near.testfts3offsets.testfts3prefix.testfts3prefix2.testfts3query.testfts3rank.testfts3rnd.testfts3shared.testfts3snippet.testfts3snippet2.testfts3sort.testfts3tok1.testfts3tok_err.testfts3varint.testfts4aa.testfts4check.testfts4content.testfts4docid.testfts4growth.testfts4growth2.testfts4incr.testfts4langid.testfts4lastrowid.testfts4merge.testfts4merge2.testfts4merge3.testfts4merge4.testfts4merge5.testfts4min.testfts4noti.testfts4onepass.testfts4opt.testfts4record.testfts4rename.testfts4umlaut.testfts4unicode.testfts4upfrom.testfull.testfunc.testfunc2.testfunc3.testfunc4.testfunc5.testfunc6.testfunc7.testfuzz-oss1.testfuzz.testfuzz2.testfuzz3.testfuzz4.testfuzz_common.tclfuzz_malloc.testfuzzcheck.cfuzzdata1.dbfuzzdata2.dbfuzzdata3.dbfuzzdata4.dbfuzzdata5.dbfuzzdata6.dbfuzzdata7.dbfuzzdata8.dbfuzzer1.testfuzzer2.testfuzzerfault.testgcfault.testgencol1.testgenesis.tclhaving.testhexlit.testhidden.testhook.testhook2.testicu.testieee754.testimposter1.testin.testin2.testin3.testin4.testin5.testin6.testincrblob.testincrblob2.testincrblob3.testincrblob4.testincrblob_err.testincrblobfault.testincrcorrupt.testincrvacuum.testincrvacuum2.testincrvacuum3.testincrvacuum_ioerr.testindex.testindex2.testindex3.testindex4.testindex5.testindex6.testindex7.testindex8.testindex9.testindexedby.testindexexpr1.testindexexpr2.testindexfault.testinit.testinsert.testinsert2.testinsert3.testinsert4.testinsert5.testinsertfault.testinstr.testinstrfault.testintarray.testinterrupt.testinterrupt2.testintpkey.testintreal.testio.testioerr.testioerr2.testioerr3.testioerr4.testioerr5.testioerr6.testistrue.testjoin.testjoin2.testjoin3.testjoin4.testjoin5.testjoin6.testjournal1.testjournal2.testjournal3.testjrnlmode.testjrnlmode2.testjrnlmode3.testjson101.testjson102.testjson103.testjson104.testjson105.testkeyword1.testkvtest.clastinsert.testlaststmtchanges.testlemon-test01.ylike.testlike2.testlike3.testlimit.testlimit2.testloadext.testloadext2.testlock.testlock2.testlock3.testlock4.testlock5.testlock6.testlock7.testlock_common.tcllookaside.testmain.testmake-where7.tclmalloc.testmalloc3.testmalloc4.testmalloc5.testmalloc6.testmalloc7.testmalloc8.testmalloc9.testmallocA.testmallocAll.testmallocB.testmallocC.testmallocD.testmallocE.testmallocF.testmallocG.testmallocH.testmallocI.testmallocJ.testmallocK.testmallocL.testmallocM.testmalloc_common.tclmalloctraceviewer.tclmanydb.testmem5.testmemdb.testmemdb1.testmemjournal.testmemleak.testmemsubsys1.testmemsubsys2.testminmax.testminmax2.testminmax3.testminmax4.testmisc1.testmisc2.testmisc3.testmisc4.testmisc5.testmisc6.testmisc7.testmisc8.testmisuse.testmjournal.testmmap1.testmmap2.testmmap3.testmmap4.testmmapfault.testmmapwarm.testmultiplex.testmultiplex2.testmultiplex3.testmultiplex4.testmutex1.testmutex2.testnan.testnockpt.testnolock.testnormalize.testnotify1.testnotify2.testnotify3.testnotnull.testnotnull2.testnotnullfault.testnull.testnulls1.testnumcast.testnumindex1.testoffset1.testopenv2.testoptfuzz-db01.coptfuzz-db01.txtoptfuzz.corderby1.testorderby2.testorderby3.testorderby4.testorderby5.testorderby6.testorderby7.testorderby8.testorderby9.testorderbyA.testoserror.testossfuzz.cossshell.covfl.testpager1.testpager2.testpager3.testpager4.testpagerfault.testpagerfault2.testpagerfault3.testpageropt.testpagesize.testparser1.testpcache.testpcache2.testpercentile.testpermutations.testpg_common.tclpragma.testpragma2.testpragma3.testpragma4.testpragma5.testpragmafault.testprefixes.testprintf.testprintf2.testprogress.testptrchng.testpushdown.testqueryonly.testquick.testquota-glob.testquota.testquota2.testquote.testrandexpr1.tclrandexpr1.testrbu.testrdonly.testrecover.testregexp1.testregexp2.testreindex.testreleasetest.tclreleasetest_data.tclresetdb.testresolver01.testreturning1.testrollback.testrollback2.testrollbackfault.testround1.testrowallock.testrowhash.testrowid.testrowvalue.testrowvalue2.testrowvalue3.testrowvalue4.testrowvalue5.testrowvalue6.testrowvalue7.testrowvalue8.testrowvalue9.testrowvalueA.testrowvaluefault.testrowvaluevtab.testrtree.testrun-wordcount.shsavepoint.testsavepoint2.testsavepoint4.testsavepoint5.testsavepoint6.testsavepoint7.testsavepointfault.testscanstatus.testschema.testschema2.testschema3.testschema4.testschema5.testschema6.testschemafault.testsecuredel.testsecuredel2.testselect1.testselect2.testselect3.testselect4.testselect5.testselect6.testselect7.testselect8.testselect9.testselectA.testselectB.testselectC.testselectD.testselectE.testselectF.testselectG.testserver1.testsession.testsessionfuzz-data1.dbsessionfuzz.cshared.testshared2.testshared3.testshared4.testshared6.testshared7.testshared8.testshared9.testsharedA.testsharedB.testshared_err.testsharedlock.testshell1.testshell2.testshell3.testshell4.testshell5.testshell6.testshell7.testshell8.testshmlock.testshortread1.testshow_speedtest1_rtree.tclshrink.testsidedelete.testskipscan1.testskipscan2.testskipscan3.testskipscan5.testskipscan6.testsnapshot.testsnapshot2.testsnapshot3.testsnapshot4.testsnapshot_fault.testsnapshot_up.testsoak.testsoftheap1.testsort.testsort2.testsort3.testsort4.testsort5.testsorterref.testsortfault.testspeed1.testspeed1p.explainspeed1p.testspeed2.testspeed3.testspeed4.testspeed4p.explainspeed4p.testspeedtest1.cspellfix.testspellfix2.testspellfix3.testspellfix4.testsqldiff1.testsqllimits1.testsqllog.teststartup.cstat.teststatfault.teststmt.teststmtvtab1.teststrict1.teststrict2.testsubjournal.testsubquery.testsubquery2.testsubselect.testsubstr.testsubtype1.testsuperlock.testswarmvtab.testswarmvtab2.testswarmvtab3.testswarmvtabfault.testsymlink.testsymlink2.testsync.testsync2.testsyscall.testsysfault.testtabfunc01.testtable.testtableapi.testtableopts.testtclsqlite.testtempdb.testtempdb2.testtempfault.testtemptable.testtemptable2.testtemptable3.testtemptrigger.testtester.tclthread001.testthread002.testthread003.testthread004.testthread005.testthread1.testthread2.testthread_common.tclthreadtest1.cthreadtest2.cthreadtest3.cthreadtest4.cthreadtest5.ctime-wordcount.shtkt-02a8e81d44.testtkt-18458b1a.testtkt-26ff0c2d1e.testtkt-2a5629202f.testtkt-2d1a5c67d.testtkt-2ea2425d34.testtkt-31338dca7e.testtkt-313723c356.testtkt-385a5b56b9.testtkt-38cb5df375.testtkt-3998683a16.testtkt-3a77c9714e.testtkt-3fe897352e.testtkt-4a03edc4c8.testtkt-4c86b126f2.testtkt-4dd95f6943.testtkt-4ef7e3cfca.testtkt-54844eea3f.testtkt-5d863f876e.testtkt-5e10420e8d.testtkt-5ee23731f.testtkt-6bfb98dfc0.testtkt-752e1646fc.testtkt-78e04e52ea.testtkt-7a31705a7e6.testtkt-7bbfb7d442.testtkt-80ba201079.testtkt-80e031a00f.testtkt-8454a207b9.testtkt-868145d012.testtkt-8c63ff0ec.testtkt-91e2e8ba6f.testtkt-94c04eaadb.testtkt-9a8b09f8e6.testtkt-9d68c883.testtkt-9f2eb3abac.testtkt-a7b7803e.testtkt-a7debbe0.testtkt-a8a0d2996a.testtkt-b1d3a2e531.testtkt-b351d95f9.testtkt-b72787b1.testtkt-b75a9ca6b0.testtkt-ba7cbfaedc.testtkt-bd484a090c.testtkt-bdc6bbbb38.testtkt-c48d99d690.testtkt-c694113d5.testtkt-cbd054fa6b.testtkt-d11f09d36e.testtkt-d635236375.testtkt-d82e3f3721.testtkt-f3e5abed55.testtkt-f67b41381a.testtkt-f777251dc7a.testtkt-f7b4edec.testtkt-f973c7ac31.testtkt-fa7bf5ec.testtkt-fc62af4523.testtkt-fc7bd6358f.testtkt1435.testtkt1443.testtkt1444.testtkt1449.testtkt1473.testtkt1501.testtkt1512.testtkt1514.testtkt1536.testtkt1537.testtkt1567.testtkt1644.testtkt1667.testtkt1873.testtkt2141.testtkt2192.testtkt2213.testtkt2251.testtkt2285.testtkt2332.testtkt2339.testtkt2391.testtkt2409.testtkt2450.testtkt2565.testtkt2640.testtkt2643.testtkt2686.testtkt2767.testtkt2817.testtkt2820.testtkt2822.testtkt2832.testtkt2854.testtkt2920.testtkt2927.testtkt2942.testtkt3080.testtkt3093.testtkt3121.testtkt3201.testtkt3292.testtkt3298.testtkt3334.testtkt3346.testtkt3357.testtkt3419.testtkt3424.testtkt3442.testtkt3457.testtkt3461.testtkt3493.testtkt3508.testtkt3522.testtkt3527.testtkt3541.testtkt3554.testtkt3581.testtkt35xx.testtkt3630.testtkt3718.testtkt3731.testtkt3757.testtkt3761.testtkt3762.testtkt3773.testtkt3791.testtkt3793.testtkt3810.testtkt3824.testtkt3832.testtkt3838.testtkt3841.testtkt3871.testtkt3879.testtkt3911.testtkt3918.testtkt3922.testtkt3929.testtkt3935.testtkt3992.testtkt3997.testtkt4018.testtokenize.testtpch01.testtrace.testtrace2.testtrace3.testtrans.testtrans2.testtrans3.testtransitive1.testtrigger1.testtrigger2.testtrigger3.testtrigger4.testtrigger5.testtrigger6.testtrigger7.testtrigger8.testtrigger9.testtriggerA.testtriggerB.testtriggerC.testtriggerD.testtriggerE.testtriggerF.testtriggerG.testtriggerupfrom.testtrustschema1.testtt3_checkpoint.ctt3_index.ctt3_lookaside1.ctt3_shared.ctt3_stress.ctt3_vacuum.ctypes.testtypes2.testtypes3.testunionall.testunionall2.testunionallfault.testunionvtab.testunionvtabfault.testunique.testunique2.testunixexcl.testunordered.testupdate.testupdate2.testupfrom1.tclupfrom1.testupfrom2.testupfrom3.testupfromfault.testupsert1.testupsert2.testupsert3.testupsert4.testupsert5.testupsertfault.testuri.testuri2.testuserauth01.testutf16align.testvacuum-into.testvacuum.testvacuum2.testvacuum3.testvacuum4.testvacuum5.testvacuum6.testvacuummem.testvarint.testveryquick.testview.testview2.testvtab1.testvtab2.testvtab3.testvtab4.testvtab5.testvtab6.testvtab7.testvtab8.testvtab9.testvtabA.testvtabB.testvtabC.testvtabD.testvtabE.testvtabF.testvtabH.testvtabI.testvtabJ.testvtabK.testvtab_alter.testvtab_err.testvtab_shared.testvtabdrop.testwal.testwal2.testwal3.testwal4.testwal5.testwal6.testwal64k.testwal7.testwal8.testwal9.testwal_common.tclwalbak.testwalbig.testwalblock.testwalcksum.testwalcrash.testwalcrash2.testwalcrash3.testwalcrash4.testwalfault.testwalfault2.testwalhook.testwalmode.testwalnoshm.testwaloverwrite.testwalpersist.testwalprotocol.testwalprotocol2.testwalro.testwalro2.testwalrofault.testwalsetlk.testwalshared.testwalslow.testwalthread.testwalvfs.testwapp.tclwapptest.tclwhere.testwhere2.testwhere3.testwhere4.testwhere5.testwhere6.testwhere7.testwhere8.testwhere9.testwhereA.testwhereB.testwhereC.testwhereD.testwhereE.testwhereF.testwhereG.testwhereH.testwhereI.testwhereJ.testwhereK.testwhereL.testwhereM.testwherefault.testwherelfault.testwherelimit.testwherelimit2.testwin32heap.testwin32lock.testwin32longpath.testwin32nolock.testwindow1.testwindow2.tclwindow2.testwindow3.tclwindow3.testwindow4.tclwindow4.testwindow5.testwindow6.testwindow7.tclwindow7.testwindow8.tclwindow8.testwindow9.testwindowA.testwindowB.testwindowC.testwindowerr.tclwindowerr.testwindowfault.testwindowpushd.testwith1.testwith2.testwith3.testwith4.testwith5.testwith6.testwithM.testwithout_rowid1.testwithout_rowid2.testwithout_rowid3.testwithout_rowid4.testwithout_rowid5.testwithout_rowid6.testwithout_rowid7.testwordcount.cwritecrash.testzeroblob.testzeroblobfault.testzerodamage.testzipfile.testzipfile2.testzipfilefault.test
@ -12181,13 +12181,13 @@ func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
|
||||
bp := tls.Alloc(24)
|
||||
defer tls.Free(24)
|
||||
|
||||
for (zMsg != 0) && (*(*int8)(unsafe.Pointer(zMsg)) != 0) {
|
||||
for zMsg != 0 && *(*int8)(unsafe.Pointer(zMsg)) != 0 {
|
||||
var i int32
|
||||
for i = 0; ((*(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n' && int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'; i++ {
|
||||
}
|
||||
libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
|
||||
zMsg += uintptr(i)
|
||||
for (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n') || (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r') {
|
||||
for int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n' || int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r' {
|
||||
zMsg++
|
||||
}
|
||||
}
|
||||
@ -12229,22 +12229,22 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
var invert int32
|
||||
var seen int32
|
||||
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) != 0 {
|
||||
if c == '*' {
|
||||
for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
|
||||
if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) == '*' || c == '?' {
|
||||
if c == '?' && int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
if c == 0 {
|
||||
return 1
|
||||
} else if c == '[' {
|
||||
for (*(*int8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
|
||||
for *(*int8)(unsafe.Pointer(z)) != 0 && strglob(tls, zGlob-uintptr(1), z) != 0 {
|
||||
z++
|
||||
}
|
||||
return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
|
||||
return libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) != 0)
|
||||
}
|
||||
for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) != 0 {
|
||||
for c2 != c {
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
|
||||
if c2 == 0 {
|
||||
@ -12257,7 +12257,7 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
return 0
|
||||
} else if c == '?' {
|
||||
if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
|
||||
if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '[' {
|
||||
@ -12279,10 +12279,10 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
for (c2 != 0) && (c2 != ']') {
|
||||
if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob))) != 0)) && (prior_c > 0) {
|
||||
for c2 != 0 && c2 != ']' {
|
||||
if c2 == '-' && int32(*(*int8)(unsafe.Pointer(zGlob))) != ']' && int32(*(*int8)(unsafe.Pointer(zGlob))) != 0 && prior_c > 0 {
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
if (c >= prior_c) && (c <= c2) {
|
||||
if c >= prior_c && c <= c2 {
|
||||
seen = 1
|
||||
}
|
||||
prior_c = 0
|
||||
@ -12294,11 +12294,11 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
if (c2 == 0) || ((seen ^ invert) == 0) {
|
||||
if c2 == 0 || seen^invert == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '#' {
|
||||
if ((int32(*(*int8)(unsafe.Pointer(z))) == '-') || (int32(*(*int8)(unsafe.Pointer(z))) == '+')) && (libc.Xisdigit(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + 1))))) != 0) {
|
||||
if (int32(*(*int8)(unsafe.Pointer(z))) == '-' || int32(*(*int8)(unsafe.Pointer(z))) == '+') && libc.Xisdigit(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + 1))))) != 0 {
|
||||
z++
|
||||
}
|
||||
if !(libc.Xisdigit(tls, int32(uint8(*(*int8)(unsafe.Pointer(z))))) != 0) {
|
||||
@ -12309,17 +12309,17 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
z++
|
||||
}
|
||||
} else {
|
||||
if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
|
||||
if c != int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
|
||||
return libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0)
|
||||
}
|
||||
|
||||
// Close output stream pOut if it is not stdout or stderr
|
||||
func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
|
||||
if (pOut != libc.X__stdoutp) && (pOut != libc.X__stderrp) {
|
||||
if pOut != libc.X__stdoutp && pOut != libc.X__stderrp {
|
||||
libc.Xfclose(tls, pOut)
|
||||
}
|
||||
}
|
||||
@ -12337,12 +12337,12 @@ func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
}
|
||||
@ -12363,13 +12363,13 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
maybeClose(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
maybeClose(tls, g.pErrLog)
|
||||
@ -12378,8 +12378,8 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
if g.db != 0 {
|
||||
var nTry int32 = 0
|
||||
g.iTimeout = 0
|
||||
for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == SQLITE_BUSY) &&
|
||||
((libc.PostIncInt32(&nTry, 1)) < 100) {
|
||||
for trySql(tls, ts+30, 0) == SQLITE_BUSY &&
|
||||
libc.PostIncInt32(&nTry, 1) < 100 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
}
|
||||
}
|
||||
@ -12400,7 +12400,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
@ -12411,7 +12411,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
// Return the length of a string omitting trailing whitespace
|
||||
func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
|
||||
var n int32 = int32(libc.Xstrlen(tls, z))
|
||||
for (n > 0) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1))))))) != 0) {
|
||||
for n > 0 && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-1)))))) != 0 {
|
||||
n--
|
||||
}
|
||||
return n
|
||||
@ -12427,7 +12427,7 @@ func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
|
||||
_ = argc
|
||||
_ = argv
|
||||
sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, SQLITE_FCNTL_VFSNAME, bp /* &zVfs */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
|
||||
sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
|
||||
}
|
||||
}
|
||||
@ -12438,7 +12438,7 @@ func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:32
|
||||
defer tls.Free(8)
|
||||
|
||||
_ = pCD
|
||||
if (count * 10) > g.iTimeout {
|
||||
if count*10 > g.iTimeout {
|
||||
if g.iTimeout > 0 {
|
||||
errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
|
||||
}
|
||||
@ -12463,16 +12463,16 @@ func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr)
|
||||
defer tls.Free(24)
|
||||
|
||||
_ = pArg
|
||||
if (iErrCode == SQLITE_ERROR) && (g.bIgnoreSqlErrors != 0) {
|
||||
if iErrCode == SQLITE_ERROR && g.bIgnoreSqlErrors != 0 {
|
||||
return
|
||||
}
|
||||
if ((iErrCode & 0xff) == SQLITE_SCHEMA) && (g.iTrace < 3) {
|
||||
if iErrCode&0xff == SQLITE_SCHEMA && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if ((g.iTimeout == 0) && ((iErrCode & 0xff) == SQLITE_BUSY)) && (g.iTrace < 3) {
|
||||
if g.iTimeout == 0 && iErrCode&0xff == SQLITE_BUSY && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if (iErrCode & 0xff) == SQLITE_NOTICE {
|
||||
if iErrCode&0xff == SQLITE_NOTICE {
|
||||
logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
|
||||
} else {
|
||||
errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
|
||||
@ -12557,8 +12557,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
if n < 0 {
|
||||
n = int32(libc.Xstrlen(tls, z))
|
||||
}
|
||||
if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
|
||||
if (*String)(unsafe.Pointer(p)).n+n >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = (*String)(unsafe.Pointer(p)).nAlloc*2 + n + 100
|
||||
var zNew uintptr = sqlite3.Xsqlite3_realloc(tls, (*String)(unsafe.Pointer(p)).z, nAlloc)
|
||||
if zNew == uintptr(0) {
|
||||
fatalError(tls, ts+129 /* "out of memory" */, 0)
|
||||
@ -12566,8 +12566,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
(*String)(unsafe.Pointer(p)).z = zNew
|
||||
(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
|
||||
}
|
||||
libc.X__builtin___memcpy_chk(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n), libc.X__builtin_object_size(tls, ((*String)(unsafe.Pointer(p)).z+uintptr((*String)(unsafe.Pointer(p)).n)), 0))
|
||||
*(*int32)(unsafe.Pointer(p + 8 /* &.n */)) += (n)
|
||||
libc.X__builtin___memcpy_chk(tls, (*String)(unsafe.Pointer(p)).z+uintptr((*String)(unsafe.Pointer(p)).n), z, uint64(n), libc.X__builtin_object_size(tls, (*String)(unsafe.Pointer(p)).z+uintptr((*String)(unsafe.Pointer(p)).n), 0))
|
||||
*(*int32)(unsafe.Pointer(p + 8)) += n
|
||||
*(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = int8(0)
|
||||
}
|
||||
|
||||
@ -12590,20 +12590,20 @@ func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
|
||||
stringAppend(tls, p, ts+145 /* "nil" */, 3)
|
||||
return
|
||||
}
|
||||
for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !(libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 && !(libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0 {
|
||||
stringAppend(tls, p, z, i)
|
||||
return
|
||||
}
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
for *(*int8)(unsafe.Pointer(z)) != 0 {
|
||||
for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''; i++ {
|
||||
}
|
||||
if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 {
|
||||
stringAppend(tls, p, z, (i + 1))
|
||||
stringAppend(tls, p, z, i+1)
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
z += (uintptr(i + 1))
|
||||
z += uintptr(i + 1)
|
||||
} else {
|
||||
stringAppend(tls, p, z, i)
|
||||
break
|
||||
@ -12647,7 +12647,7 @@ func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* m
|
||||
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
|
||||
stringAppendTerm(tls, p, bp+16 /* &zErr[0] */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
|
||||
stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
}
|
||||
@ -12671,7 +12671,7 @@ func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mpt
|
||||
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
|
||||
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
|
||||
}{evalCallback})), bp /* &res */, bp+16 /* &zErrMsg */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
|
||||
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)), -1)
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)))
|
||||
} else if rc != 0 {
|
||||
@ -12700,13 +12700,13 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0)
|
||||
if rc == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
continue
|
||||
}
|
||||
if rc != SQLITE_OK {
|
||||
fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
}
|
||||
if (g.nError != 0) || (g.nTest != 0) {
|
||||
if g.nError != 0 || g.nTest != 0 {
|
||||
runSql(tls, ts+196, /* "UPDATE counters ..." */
|
||||
libc.VaList(bp+8, g.nError, g.nTest))
|
||||
g.nError = 0
|
||||
@ -12727,7 +12727,7 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if rc == SQLITE_ROW {
|
||||
var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, n+1)
|
||||
libc.X__builtin___strcpy_chk(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0), libc.X__builtin_object_size(tls, *(*uintptr)(unsafe.Pointer(pzScript)), func() int32 {
|
||||
if X_USE_FORTIFY_LEVEL > 1 {
|
||||
return 1
|
||||
@ -12752,12 +12752,12 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
for trySql(tls, ts+613 /* "COMMIT" */, 0) == SQLITE_BUSY {
|
||||
for trySql(tls, ts+613, 0) == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
totalTime = totalTime + (100)
|
||||
totalTime = totalTime + 100
|
||||
continue
|
||||
}
|
||||
fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
@ -12829,7 +12829,7 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
libc.Xfseek(tls, in, int64(0), SEEK_END)
|
||||
sz = libc.Xftell(tls, in)
|
||||
libc.Xrewind(tls, in)
|
||||
z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + int64(1))))
|
||||
z = sqlite3.Xsqlite3_malloc(tls, int32(sz+int64(1)))
|
||||
sz = int64(libc.Xfread(tls, z, uint64(1), uint64(sz), in))
|
||||
*(*int8)(unsafe.Pointer(z + uintptr(sz))) = int8(0)
|
||||
libc.Xfclose(tls, in)
|
||||
@ -12839,24 +12839,24 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
// Return the length of the next token.
|
||||
func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
|
||||
var n int32 = 0
|
||||
if (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z))))) != 0) || ((int32(*(*int8)(unsafe.Pointer(z))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '*')) {
|
||||
if libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z))))) != 0 || int32(*(*int8)(unsafe.Pointer(z))) == '/' && int32(*(*int8)(unsafe.Pointer(z + 1))) == '*' {
|
||||
var inC int32 = 0
|
||||
var c int32
|
||||
if int32(*(*int8)(unsafe.Pointer(z))) == '/' {
|
||||
inC = 1
|
||||
n = 2
|
||||
}
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1)))))) != 0 {
|
||||
if c == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if libc.Xisspace(tls, int32(uint8(c))) != 0 {
|
||||
continue
|
||||
}
|
||||
if ((inC != 0) && (c == '*')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
|
||||
if inC != 0 && c == '*' && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/' {
|
||||
n++
|
||||
inC = 0
|
||||
} else if (!(inC != 0) && (c == '/')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*') {
|
||||
} else if !(inC != 0) && c == '/' && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*' {
|
||||
n++
|
||||
inC = 1
|
||||
} else if !(inC != 0) {
|
||||
@ -12864,29 +12864,29 @@ func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:7
|
||||
}
|
||||
}
|
||||
n--
|
||||
} else if (int32(*(*int8)(unsafe.Pointer(z))) == '-') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '-') {
|
||||
for n = 2; (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'); n++ {
|
||||
} else if int32(*(*int8)(unsafe.Pointer(z))) == '-' && int32(*(*int8)(unsafe.Pointer(z + 1))) == '-' {
|
||||
for n = 2; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'; n++ {
|
||||
}
|
||||
if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
n++
|
||||
}
|
||||
} else if (int32(*(*int8)(unsafe.Pointer(z))) == '"') || (int32(*(*int8)(unsafe.Pointer(z))) == '\'') {
|
||||
} else if int32(*(*int8)(unsafe.Pointer(z))) == '"' || int32(*(*int8)(unsafe.Pointer(z))) == '\'' {
|
||||
var delim int32 = int32(*(*int8)(unsafe.Pointer(z)))
|
||||
for n = 1; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0; n++ {
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == delim {
|
||||
n++
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr((n + 1))))) != delim {
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n+1)))) != delim {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var c int32
|
||||
for n = 1; (((((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !(libc.Xisspace(tls, int32(uint8(c))) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
|
||||
for n = 1; libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n))))) != 0 && !(libc.Xisspace(tls, int32(uint8(c))) != 0) && c != '"' && c != '\'' && c != ';'; n++ {
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -12899,7 +12899,7 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
*(*int8)(unsafe.Pointer(zOut)) = int8(0)
|
||||
return 0
|
||||
}
|
||||
for i = 0; ((i < nIn) && (i < (nOut - 1))) && !(libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))))) != 0); i++ {
|
||||
for i = 0; i < nIn && i < nOut-1 && !(libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))))) != 0); i++ {
|
||||
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = *(*int8)(unsafe.Pointer(zIn + uintptr(i)))
|
||||
}
|
||||
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0)
|
||||
@ -12909,8 +12909,8 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
// Find the number of characters up to the start of the next "--end" token.
|
||||
func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
|
||||
var n int32 = 0
|
||||
for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint64(5)) != 0) || !(libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5))))))) != 0)) {
|
||||
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
|
||||
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && (libc.Xstrncmp(tls, z+uintptr(n), ts+896, uint64(5)) != 0 || !(libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+5)))))) != 0)) {
|
||||
n = n + tokenLength(tls, z+uintptr(n), pnLine)
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -12921,16 +12921,16 @@ func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:1
|
||||
func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
|
||||
var n int32 = 0
|
||||
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
|
||||
if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint64(7)) == 0) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7))))))) != 0)) ||
|
||||
(((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint64(6)) == 0)) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6))))))) != 0)) {
|
||||
return (n + len)
|
||||
var len int32 = tokenLength(tls, z+uintptr(n), pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+902, uint64(7)) == 0 && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+7)))))) != 0 ||
|
||||
stopAtElse != 0 && libc.Xstrncmp(tls, z+uintptr(n), ts+910, uint64(6)) == 0 && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+6)))))) != 0 {
|
||||
return n + len
|
||||
}
|
||||
if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint64(4)) == 0) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4))))))) != 0) {
|
||||
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+917, uint64(4)) == 0 && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+4)))))) != 0 {
|
||||
var skip int32 = findEndif(tls, z+uintptr(n)+uintptr(len), 0, pnLine)
|
||||
n = n + (skip + len)
|
||||
} else {
|
||||
n = n + (len)
|
||||
n = n + len
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -12954,11 +12954,11 @@ func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uint
|
||||
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
|
||||
}
|
||||
g.iTimeout = 0
|
||||
for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) || (rc == SQLITE_ROW)) &&
|
||||
(iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY || rc == SQLITE_ROW) &&
|
||||
iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_reset(tls, pStmt)
|
||||
sqlite3.Xsqlite3_sleep(tls, 50)
|
||||
iTimeout = iTimeout - (50)
|
||||
iTimeout = iTimeout - 50
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
g.iTimeout = DEFAULT_TIMEOUT
|
||||
@ -12979,11 +12979,11 @@ func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
|
||||
var i int32
|
||||
var j int32
|
||||
for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
|
||||
j = (i + 1)
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == '/' {
|
||||
j = i + 1
|
||||
}
|
||||
}
|
||||
return (z + uintptr(j))
|
||||
return z + uintptr(j)
|
||||
}
|
||||
|
||||
// Interpret zArg as a boolean value. Return either 0 or 1.
|
||||
@ -12995,15 +12995,15 @@ func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
|
||||
if zArg == uintptr(0) {
|
||||
return 0
|
||||
}
|
||||
for i = 0; (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
|
||||
for i = 0; int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0' && int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'; i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0 {
|
||||
return libc.Xatoi(tls, zArg)
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169) == 0 {
|
||||
return 1
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177) == 0 {
|
||||
return 0
|
||||
}
|
||||
errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
|
||||
@ -13044,58 +13044,58 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
|
||||
libc.X__builtin___memset_chk(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})), libc.X__builtin_object_size(tls, bp+360 /* &sResult */, 0))
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii))))) != 0 {
|
||||
prevLine = *(*int32)(unsafe.Pointer(bp + 376 /* lineno */))
|
||||
len = tokenLength(tls, (zScript + uintptr(ii)), bp+376 /* &lineno */)
|
||||
if (libc.Xisspace(tls, int32(uint8(c))) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
|
||||
ii = ii + (len)
|
||||
len = tokenLength(tls, zScript+uintptr(ii), bp+376 /* &lineno */)
|
||||
if libc.Xisspace(tls, int32(uint8(c))) != 0 || c == '/' && int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+1)))) == '*' {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !(libc.Xisalpha(tls, int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2)))))) != 0) {
|
||||
ii = ii + (len)
|
||||
if c != '-' || int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+1)))) != '-' || !(libc.Xisalpha(tls, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+2))))) != 0) {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
|
||||
// Run any prior SQL before processing the new --command
|
||||
if ii > iBegin {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
iBegin = (ii + len)
|
||||
iBegin = ii + len
|
||||
}
|
||||
|
||||
// Parse the --command
|
||||
if g.iTrace >= 2 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, zScript+uintptr(ii)))
|
||||
}
|
||||
n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
|
||||
for nArg = 0; (n < (len - 2)) && (nArg < MX_ARG); nArg++ {
|
||||
for (n < (len - 2)) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n))))))) != 0) {
|
||||
n = extractToken(tls, zScript+uintptr(ii)+uintptr(2), len-2, bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
|
||||
for nArg = 0; n < len-2 && nArg < MX_ARG; nArg++ {
|
||||
for n < len-2 && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+2+n)))))) != 0 {
|
||||
n++
|
||||
}
|
||||
if n >= (len - 2) {
|
||||
if n >= len-2 {
|
||||
break
|
||||
}
|
||||
n = n + (extractToken(tls, (((zScript + uintptr(ii)) + uintptr(2)) + uintptr(n)), ((len - 2) - n),
|
||||
(bp + 410 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]int8{}))))
|
||||
n = n + extractToken(tls, zScript+uintptr(ii)+uintptr(2)+uintptr(n), len-2-n,
|
||||
bp+410+uintptr(nArg)*100, int32(unsafe.Sizeof([100]int8{})))
|
||||
}
|
||||
for j = nArg; j < MX_ARG; j++ {
|
||||
*(*int8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100))) = int8(0)
|
||||
*(*int8)(unsafe.Pointer(bp + 410 + uintptr(libc.PostIncInt32(&j, 1))*100)) = int8(0)
|
||||
}
|
||||
|
||||
// --sleep N
|
||||
//
|
||||
// Pause for N milliseconds
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1207) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, bp+410))
|
||||
} else
|
||||
|
||||
// --exit N
|
||||
//
|
||||
// Exit this process. If N>0 then exit without shutting down
|
||||
// SQLite. (In other words, simulate a crash.)
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1213) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, bp+410)
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
if rc == 0 {
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
@ -13107,9 +13107,9 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Begin a new test case. Announce in the log that the test case
|
||||
// has begun.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1218) == 0 {
|
||||
if g.iTrace == 1 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, len-1, zScript+uintptr(ii)))
|
||||
}
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
@ -13118,29 +13118,29 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Mark the current task as having finished, even if it is not.
|
||||
// This can be used in conjunction with --exit to simulate a crash.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1227) == 0 && iClient > 0 {
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
} else
|
||||
|
||||
// --reset
|
||||
//
|
||||
// Reset accumulated results back to an empty string
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1234) == 0 {
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
|
||||
// --match ANSWER...
|
||||
//
|
||||
// Check to see if output matches ANSWER. Report an error if not.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1240) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
for jj = 7; (jj < (len - 1)) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj)))))) != 0); jj++ {
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
for jj = 7; jj < len-1 && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj)))))) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint64((len-jj)-1))) != 0) {
|
||||
if len-jj-1 != (*String)(unsafe.Pointer(bp+360)).n || libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360)).z, zAns, uint64(len-jj-1)) != 0 {
|
||||
errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
libc.VaList(bp+48, prevLine, zFilename, len-jj-1, zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
g.nTest++
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
@ -13151,16 +13151,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Check to see if output does or does not match the glob pattern
|
||||
// ANSWER.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1291) == 0 || libc.Xstrcmp(tls, bp+380, ts+1296) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
var zCopy uintptr
|
||||
var isGlob int32 = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */))) == 'g'))
|
||||
for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj)))))) != 0); jj++ {
|
||||
var isGlob int32 = libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380))) == 'g')
|
||||
for jj = 9 - 3*isGlob; jj < len-1 && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj)))))) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
|
||||
if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, len-jj-1, zAns))
|
||||
if libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360)).z) == 0)^isGlob != 0 {
|
||||
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
@ -13172,21 +13172,21 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --output
|
||||
//
|
||||
// Output the result of the previous SQL.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1347) == 0 {
|
||||
logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
} else
|
||||
|
||||
// --source FILENAME
|
||||
//
|
||||
// Run a subscript from a separate file.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1354) == 0 {
|
||||
var zNewFile uintptr
|
||||
var zNewScript uintptr
|
||||
var zToDel uintptr = uintptr(0)
|
||||
zNewFile = (bp + 410 /* &azArg[0] */)
|
||||
if !((int32(*(*int8)(unsafe.Pointer(zNewFile)))) == '/') {
|
||||
zNewFile = bp + 410
|
||||
if !(int32(*(*int8)(unsafe.Pointer(zNewFile))) == '/') {
|
||||
var k int32
|
||||
for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
|
||||
for k = int32(libc.Xstrlen(tls, zFilename)) - 1; k >= 0 && !(int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k)))) == '/'); k-- {
|
||||
}
|
||||
if k > 0 {
|
||||
zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
|
||||
@ -13207,26 +13207,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --print MESSAGE....
|
||||
//
|
||||
// Output the remainder of the line to the log file
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1405) == 0 {
|
||||
var jj int32
|
||||
for jj = 7; (jj < len) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj))))))) != 0); jj++ {
|
||||
for jj = 7; jj < len && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+jj)))))) != 0; jj++ {
|
||||
}
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
} else
|
||||
|
||||
// --if EXPR
|
||||
//
|
||||
// Skip forward to the next matching --endif or --else if EXPR is false.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1411) == 0 {
|
||||
var jj int32
|
||||
var rc int32
|
||||
var pStmt uintptr
|
||||
for jj = 4; (jj < len) && (libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj))))))) != 0); jj++ {
|
||||
for jj = 4; jj < len && libc.Xisspace(tls, int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+jj)))))) != 0; jj++ {
|
||||
}
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if (rc != SQLITE_ROW) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+376 /* &lineno */))
|
||||
if rc != SQLITE_ROW || sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 1, bp+376)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
} else
|
||||
@ -13235,23 +13235,23 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true. Skip forward to the next matching --endif.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+376 /* &lineno */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1426) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 0, bp+376)
|
||||
} else
|
||||
|
||||
// --endif
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true or an --else of a false if. This is a no-op.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1431) == 0 {
|
||||
// no-op
|
||||
} else
|
||||
|
||||
// --start CLIENT
|
||||
//
|
||||
// Start up the given client.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
|
||||
var iNewClient int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1437) == 0 && iClient == 0 {
|
||||
var iNewClient int32 = libc.Xatoi(tls, bp+410)
|
||||
if iNewClient > 0 {
|
||||
startClient(tls, iNewClient)
|
||||
}
|
||||
@ -13262,16 +13262,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// Wait until all tasks complete for the given client. If CLIENT is
|
||||
// "all" then wait for all clients to complete. Wait no longer than
|
||||
// TIMEOUT milliseconds (default 10,000)
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1443) == 0 && iClient == 0 {
|
||||
var iTimeout int32
|
||||
if nArg >= 2 {
|
||||
iTimeout = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + 1*100))
|
||||
iTimeout = libc.Xatoi(tls, bp+410+1*100)
|
||||
} else {
|
||||
iTimeout = 10000
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+610 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
|
||||
libc.VaList(bp+216, prevLine, zFilename))
|
||||
waitForClient(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)), iTimeout, bp+610 /* &zError[0] */)
|
||||
waitForClient(tls, libc.Xatoi(tls, bp+410), iTimeout, bp+610 /* &zError[0] */)
|
||||
} else
|
||||
|
||||
// --task CLIENT
|
||||
@ -13280,19 +13280,19 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Assign work to a client. Start the client if it is not running
|
||||
// already.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
|
||||
var iTarget int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1463) == 0 && iClient == 0 {
|
||||
var iTarget int32 = libc.Xatoi(tls, bp+410)
|
||||
var iEnd int32
|
||||
var zTask uintptr
|
||||
var zTName uintptr
|
||||
iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+376 /* &lineno */)
|
||||
iEnd = findEnd(tls, zScript+uintptr(ii)+uintptr(len), bp+376 /* &lineno */)
|
||||
if iTarget < 0 {
|
||||
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
|
||||
libc.VaList(bp+232, prevLine, zFilename, iTarget))
|
||||
} else {
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, zScript+uintptr(ii)+uintptr(len)))
|
||||
if nArg > 1 {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+410 /* &azArg[0] */ +1*100)))
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, bp+410+1*100))
|
||||
} else {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
|
||||
}
|
||||
@ -13302,26 +13302,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
sqlite3.Xsqlite3_free(tls, zTask)
|
||||
sqlite3.Xsqlite3_free(tls, zTName)
|
||||
}
|
||||
iEnd = iEnd + (tokenLength(tls, (((zScript + uintptr(ii)) + uintptr(len)) + uintptr(iEnd)), bp+376 /* &lineno */))
|
||||
len = len + (iEnd)
|
||||
iBegin = (ii + len)
|
||||
iEnd = iEnd + tokenLength(tls, zScript+uintptr(ii)+uintptr(len)+uintptr(iEnd), bp+376)
|
||||
len = len + iEnd
|
||||
iBegin = ii + len
|
||||
} else
|
||||
|
||||
// --breakpoint
|
||||
//
|
||||
// This command calls "test_breakpoint()" which is a routine provided
|
||||
// as a convenient place to set a debugger breakpoint.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1567) == 0 {
|
||||
test_breakpoint(tls)
|
||||
} else
|
||||
|
||||
// --show-sql-errors BOOLEAN
|
||||
//
|
||||
// Turn display of SQL errors on and off.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1578) == 0 {
|
||||
g.bIgnoreSqlErrors = func() int32 {
|
||||
if nArg >= 1 {
|
||||
return libc.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */)) != 0))
|
||||
return libc.BoolInt32(!(booleanValue(tls, bp+410) != 0))
|
||||
}
|
||||
return 1
|
||||
}()
|
||||
@ -13329,10 +13329,10 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
|
||||
libc.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
|
||||
}
|
||||
ii = ii + (len)
|
||||
ii = ii + len
|
||||
}
|
||||
if iBegin < ii {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
runSql(tls, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
}
|
||||
@ -13356,7 +13356,7 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
|
||||
for i = 0; i < nArg; i++ {
|
||||
var z uintptr
|
||||
if (i + hasArg) >= nArg {
|
||||
if i+hasArg >= nArg {
|
||||
break
|
||||
}
|
||||
z = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
|
||||
@ -13371,15 +13371,15 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
z++
|
||||
}
|
||||
if libc.Xstrcmp(tls, z, zOption) == 0 {
|
||||
if (hasArg != 0) && (i == (nArg - 1)) {
|
||||
if hasArg != 0 && i == nArg-1 {
|
||||
fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
|
||||
}
|
||||
if hasArg != 0 {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*8))
|
||||
} else {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
|
||||
}
|
||||
j = ((i + 1) + (libc.Bool32(hasArg != 0)))
|
||||
j = i + 1 + libc.Bool32(hasArg != 0)
|
||||
for j < nArg {
|
||||
*(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*8))
|
||||
}
|
||||
@ -13398,8 +13398,8 @@ func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
|
||||
var i int32
|
||||
var zTail uintptr = argv0
|
||||
for i = 0; *(*int8)(unsafe.Pointer(argv0 + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i))))) == '/' {
|
||||
zTail = ((argv0 + uintptr(i)) + uintptr(1))
|
||||
if int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i)))) == '/' {
|
||||
zTail = argv0 + uintptr(i) + uintptr(1)
|
||||
}
|
||||
}
|
||||
libc.Xfprintf(tls, libc.X__stderrp, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
|
||||
@ -13453,43 +13453,43 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + 1*8))
|
||||
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
|
||||
if strglob(tls, ts+2323, g.zDbFile) != 0 {
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */) != 0 {
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330) != 0 {
|
||||
libc.Xfprintf(tls, libc.X__stderrp,
|
||||
|
||||
ts+2415, /* "SQLite library a..." */
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */))
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = argc - 2
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
if zNRep != 0 {
|
||||
nRep = libc.Xatoi(tls, zNRep)
|
||||
}
|
||||
if nRep < 1 {
|
||||
nRep = 1
|
||||
}
|
||||
g.zVfs = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
g.zVfs = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
if zTrace != 0 {
|
||||
g.iTrace = libc.Xatoi(tls, zTrace)
|
||||
}
|
||||
if findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
|
||||
if findOption(tls, argv+uintptr(2)*8, bp+232, ts+2534, 0) != uintptr(0) {
|
||||
g.iTrace = 0
|
||||
}
|
||||
zTmout = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
zTmout = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
if zTmout != 0 {
|
||||
iTmout = libc.Xatoi(tls, zTmout)
|
||||
}
|
||||
g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
|
||||
g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
|
||||
g.bSqlTrace = libc.Bool32(findOption(tls, argv+uintptr(2)*8, bp+232, ts+2548, 0) != uintptr(0))
|
||||
g.bSync = libc.Bool32(findOption(tls, argv+uintptr(2)*8, bp+232, ts+2557, 0) != uintptr(0))
|
||||
if g.zErrLog != 0 {
|
||||
g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
|
||||
} else {
|
||||
@ -13509,7 +13509,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
if iClient < 1 {
|
||||
fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2591, /* "%05d.client%02d" */
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64, ts+2591, /* "%05d.client%02d" */
|
||||
libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
|
||||
} else {
|
||||
var nTry int32 = 0
|
||||
@ -13520,14 +13520,14 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
libc.Xprintf(tls, ts+2617 /* "With SQLite 3.37..." */, 0)
|
||||
for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
|
||||
for i = 0; libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i)) != uintptr(0); i++ {
|
||||
libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
|
||||
}
|
||||
libc.Xfflush(tls, libc.X__stdoutp)
|
||||
}
|
||||
iClient = 0
|
||||
for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
|
||||
if (nTry % 5) == 4 {
|
||||
for ok := true; ok; ok = rc != 0 && libc.PreIncInt32(&nTry, 1) < 60 && sqlite3.Xsqlite3_sleep(tls, 1000) > 0 {
|
||||
if nTry%5 == 4 {
|
||||
libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
|
||||
libc.VaList(bp+88, func() uintptr {
|
||||
if nTry > 5 {
|
||||
@ -13537,7 +13537,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}(), g.zDbFile))
|
||||
}
|
||||
rc = libc.Xunlink(tls, g.zDbFile)
|
||||
if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__error(tls)))) == ENOENT) {
|
||||
if rc != 0 && *(*int32)(unsafe.Pointer(libc.X__error(tls))) == ENOENT {
|
||||
rc = 0
|
||||
}
|
||||
}
|
||||
@ -13545,9 +13545,9 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
fatalError(tls, ts+2771, /* "unable to unlink..." */
|
||||
libc.VaList(bp+104, g.zDbFile, nTry))
|
||||
}
|
||||
openFlags = openFlags | (SQLITE_OPEN_CREATE)
|
||||
openFlags = openFlags | SQLITE_OPEN_CREATE
|
||||
}
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 24 /* &.db */), openFlags, g.zVfs)
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, uintptr(unsafe.Pointer(&g))+24, openFlags, g.zVfs)
|
||||
if rc != 0 {
|
||||
fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
|
||||
}
|
||||
@ -13580,8 +13580,8 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}{sqlTraceCallback})), uintptr(0))
|
||||
}
|
||||
if iClient > 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*8)
|
||||
}
|
||||
if g.iTrace != 0 {
|
||||
logMessage(tls, ts+2889 /* "start-client" */, 0)
|
||||
@ -13609,11 +13609,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
} else {
|
||||
var pStmt uintptr
|
||||
var iTimeout int32
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) == 0 {
|
||||
fatalError(tls, ts+2939 /* "missing script f..." */, 0)
|
||||
}
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*8)
|
||||
}
|
||||
runSql(tls,
|
||||
|
||||
@ -13634,21 +13634,21 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
g.iTimeout = 0
|
||||
iTimeout = 1000
|
||||
for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == SQLITE_BUSY) ||
|
||||
(rc == SQLITE_ROW)) && (iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, trySql(tls, ts+3502, 0)) == SQLITE_BUSY ||
|
||||
rc == SQLITE_ROW) && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
|
||||
iTimeout = 1000
|
||||
for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) && (iTimeout > 0) {
|
||||
for libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
if rc == SQLITE_ROW {
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nError */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 116 /* &.nTest */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 0)
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 116)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 1)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
}
|
||||
@ -13663,7 +13663,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
}
|
||||
return (libc.Bool32(g.nError > 0))
|
||||
return libc.Bool32(g.nError > 0)
|
||||
}
|
||||
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5100,13 +5100,13 @@ func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
|
||||
bp := tls.Alloc(24)
|
||||
defer tls.Free(24)
|
||||
|
||||
for (zMsg != 0) && (*(*int8)(unsafe.Pointer(zMsg)) != 0) {
|
||||
for zMsg != 0 && *(*int8)(unsafe.Pointer(zMsg)) != 0 {
|
||||
var i int32
|
||||
for i = 0; ((*(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n' && int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'; i++ {
|
||||
}
|
||||
libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
|
||||
zMsg += uintptr(i)
|
||||
for (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n') || (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r') {
|
||||
for int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n' || int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r' {
|
||||
zMsg++
|
||||
}
|
||||
}
|
||||
@ -5148,22 +5148,22 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
var invert int32
|
||||
var seen int32
|
||||
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) != 0 {
|
||||
if c == '*' {
|
||||
for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
|
||||
if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) == '*' || c == '?' {
|
||||
if c == '?' && int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
if c == 0 {
|
||||
return 1
|
||||
} else if c == '[' {
|
||||
for (*(*int8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
|
||||
for *(*int8)(unsafe.Pointer(z)) != 0 && strglob(tls, zGlob-uintptr(1), z) != 0 {
|
||||
z++
|
||||
}
|
||||
return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
|
||||
return libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) != 0)
|
||||
}
|
||||
for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) != 0 {
|
||||
for c2 != c {
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
|
||||
if c2 == 0 {
|
||||
@ -5176,7 +5176,7 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
return 0
|
||||
} else if c == '?' {
|
||||
if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
|
||||
if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '[' {
|
||||
@ -5198,10 +5198,10 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
for (c2 != 0) && (c2 != ']') {
|
||||
if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob))) != 0)) && (prior_c > 0) {
|
||||
for c2 != 0 && c2 != ']' {
|
||||
if c2 == '-' && int32(*(*int8)(unsafe.Pointer(zGlob))) != ']' && int32(*(*int8)(unsafe.Pointer(zGlob))) != 0 && prior_c > 0 {
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
if (c >= prior_c) && (c <= c2) {
|
||||
if c >= prior_c && c <= c2 {
|
||||
seen = 1
|
||||
}
|
||||
prior_c = 0
|
||||
@ -5213,32 +5213,32 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
if (c2 == 0) || ((seen ^ invert) == 0) {
|
||||
if c2 == 0 || seen^invert == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '#' {
|
||||
if ((int32(*(*int8)(unsafe.Pointer(z))) == '-') || (int32(*(*int8)(unsafe.Pointer(z))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + 1)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if (int32(*(*int8)(unsafe.Pointer(z))) == '-' || int32(*(*int8)(unsafe.Pointer(z))) == '+') && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + 1)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0) {
|
||||
return 0
|
||||
}
|
||||
z++
|
||||
for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0 {
|
||||
for int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
} else {
|
||||
if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
|
||||
if c != int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
|
||||
return libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0)
|
||||
}
|
||||
|
||||
// Close output stream pOut if it is not stdout or stderr
|
||||
func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
|
||||
if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) {
|
||||
if pOut != libc.Xstdout && pOut != libc.Xstderr {
|
||||
libc.Xfclose(tls, pOut)
|
||||
}
|
||||
}
|
||||
@ -5256,12 +5256,12 @@ func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
}
|
||||
@ -5282,13 +5282,13 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
maybeClose(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
maybeClose(tls, g.pErrLog)
|
||||
@ -5297,8 +5297,8 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
if g.db != 0 {
|
||||
var nTry int32 = 0
|
||||
g.iTimeout = 0
|
||||
for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == SQLITE_BUSY) &&
|
||||
((libc.PostIncInt32(&nTry, 1)) < 100) {
|
||||
for trySql(tls, ts+30, 0) == SQLITE_BUSY &&
|
||||
libc.PostIncInt32(&nTry, 1) < 100 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
}
|
||||
}
|
||||
@ -5319,7 +5319,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
@ -5330,7 +5330,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
// Return the length of a string omitting trailing whitespace
|
||||
func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
|
||||
var n int32 = int32(libc.Xstrlen(tls, z))
|
||||
for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
for n > 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-1))))))*2)))&int32(_ISspace) != 0 {
|
||||
n--
|
||||
}
|
||||
return n
|
||||
@ -5346,7 +5346,7 @@ func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
|
||||
_ = argc
|
||||
_ = argv
|
||||
sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, SQLITE_FCNTL_VFSNAME, bp /* &zVfs */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
|
||||
sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
|
||||
}
|
||||
}
|
||||
@ -5357,7 +5357,7 @@ func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:32
|
||||
defer tls.Free(8)
|
||||
|
||||
_ = pCD
|
||||
if (count * 10) > g.iTimeout {
|
||||
if count*10 > g.iTimeout {
|
||||
if g.iTimeout > 0 {
|
||||
errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
|
||||
}
|
||||
@ -5382,16 +5382,16 @@ func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr)
|
||||
defer tls.Free(24)
|
||||
|
||||
_ = pArg
|
||||
if (iErrCode == SQLITE_ERROR) && (g.bIgnoreSqlErrors != 0) {
|
||||
if iErrCode == SQLITE_ERROR && g.bIgnoreSqlErrors != 0 {
|
||||
return
|
||||
}
|
||||
if ((iErrCode & 0xff) == SQLITE_SCHEMA) && (g.iTrace < 3) {
|
||||
if iErrCode&0xff == SQLITE_SCHEMA && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if ((g.iTimeout == 0) && ((iErrCode & 0xff) == SQLITE_BUSY)) && (g.iTrace < 3) {
|
||||
if g.iTimeout == 0 && iErrCode&0xff == SQLITE_BUSY && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if (iErrCode & 0xff) == SQLITE_NOTICE {
|
||||
if iErrCode&0xff == SQLITE_NOTICE {
|
||||
logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
|
||||
} else {
|
||||
errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
|
||||
@ -5476,8 +5476,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
if n < 0 {
|
||||
n = int32(libc.Xstrlen(tls, z))
|
||||
}
|
||||
if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
|
||||
if (*String)(unsafe.Pointer(p)).n+n >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = (*String)(unsafe.Pointer(p)).nAlloc*2 + n + 100
|
||||
var zNew uintptr = sqlite3.Xsqlite3_realloc(tls, (*String)(unsafe.Pointer(p)).z, nAlloc)
|
||||
if zNew == uintptr(0) {
|
||||
fatalError(tls, ts+129 /* "out of memory" */, 0)
|
||||
@ -5485,8 +5485,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
(*String)(unsafe.Pointer(p)).z = zNew
|
||||
(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
|
||||
}
|
||||
libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint32(n))
|
||||
*(*int32)(unsafe.Pointer(p + 4 /* &.n */)) += (n)
|
||||
libc.Xmemcpy(tls, (*String)(unsafe.Pointer(p)).z+uintptr((*String)(unsafe.Pointer(p)).n), z, uint32(n))
|
||||
*(*int32)(unsafe.Pointer(p + 4)) += n
|
||||
*(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = int8(0)
|
||||
}
|
||||
|
||||
@ -5509,20 +5509,20 @@ func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
|
||||
stringAppend(tls, p, ts+145 /* "nil" */, 3)
|
||||
return
|
||||
}
|
||||
for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0 {
|
||||
stringAppend(tls, p, z, i)
|
||||
return
|
||||
}
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
for *(*int8)(unsafe.Pointer(z)) != 0 {
|
||||
for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''; i++ {
|
||||
}
|
||||
if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 {
|
||||
stringAppend(tls, p, z, (i + 1))
|
||||
stringAppend(tls, p, z, i+1)
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
z += (uintptr(i + 1))
|
||||
z += uintptr(i + 1)
|
||||
} else {
|
||||
stringAppend(tls, p, z, i)
|
||||
break
|
||||
@ -5566,7 +5566,7 @@ func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* m
|
||||
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+12 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
|
||||
stringAppendTerm(tls, p, bp+12 /* &zErr[0] */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
|
||||
stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
}
|
||||
@ -5590,7 +5590,7 @@ func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mpt
|
||||
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
|
||||
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
|
||||
}{evalCallback})), bp /* &res */, bp+12 /* &zErrMsg */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 {
|
||||
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)), -1)
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)))
|
||||
} else if rc != 0 {
|
||||
@ -5619,13 +5619,13 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0)
|
||||
if rc == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
continue
|
||||
}
|
||||
if rc != SQLITE_OK {
|
||||
fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
}
|
||||
if (g.nError != 0) || (g.nTest != 0) {
|
||||
if g.nError != 0 || g.nTest != 0 {
|
||||
runSql(tls, ts+196, /* "UPDATE counters ..." */
|
||||
libc.VaList(bp+8, g.nError, g.nTest))
|
||||
g.nError = 0
|
||||
@ -5646,7 +5646,7 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if rc == SQLITE_ROW {
|
||||
var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, n+1)
|
||||
libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
|
||||
@ -5666,12 +5666,12 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
for trySql(tls, ts+613 /* "COMMIT" */, 0) == SQLITE_BUSY {
|
||||
for trySql(tls, ts+613, 0) == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
totalTime = totalTime + (100)
|
||||
totalTime = totalTime + 100
|
||||
continue
|
||||
}
|
||||
fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
@ -5743,7 +5743,7 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
libc.Xfseek(tls, in, 0, SEEK_END)
|
||||
sz = libc.Xftell(tls, in)
|
||||
libc.Xrewind(tls, in)
|
||||
z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + 1)))
|
||||
z = sqlite3.Xsqlite3_malloc(tls, int32(sz+1))
|
||||
sz = int32(libc.Xfread(tls, z, uint32(1), uint32(sz), in))
|
||||
*(*int8)(unsafe.Pointer(z + uintptr(sz))) = int8(0)
|
||||
libc.Xfclose(tls, in)
|
||||
@ -5753,24 +5753,24 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
// Return the length of the next token.
|
||||
func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
|
||||
var n int32 = 0
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '*')) {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2)))&int32(_ISspace) != 0 || int32(*(*int8)(unsafe.Pointer(z))) == '/' && int32(*(*int8)(unsafe.Pointer(z + 1))) == '*' {
|
||||
var inC int32 = 0
|
||||
var c int32
|
||||
if int32(*(*int8)(unsafe.Pointer(z))) == '/' {
|
||||
inC = 1
|
||||
n = 2
|
||||
}
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1)))))) != 0 {
|
||||
if c == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 {
|
||||
continue
|
||||
}
|
||||
if ((inC != 0) && (c == '*')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
|
||||
if inC != 0 && c == '*' && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/' {
|
||||
n++
|
||||
inC = 0
|
||||
} else if (!(inC != 0) && (c == '/')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*') {
|
||||
} else if !(inC != 0) && c == '/' && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*' {
|
||||
n++
|
||||
inC = 1
|
||||
} else if !(inC != 0) {
|
||||
@ -5778,29 +5778,29 @@ func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:7
|
||||
}
|
||||
}
|
||||
n--
|
||||
} else if (int32(*(*int8)(unsafe.Pointer(z))) == '-') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '-') {
|
||||
for n = 2; (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'); n++ {
|
||||
} else if int32(*(*int8)(unsafe.Pointer(z))) == '-' && int32(*(*int8)(unsafe.Pointer(z + 1))) == '-' {
|
||||
for n = 2; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'; n++ {
|
||||
}
|
||||
if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
n++
|
||||
}
|
||||
} else if (int32(*(*int8)(unsafe.Pointer(z))) == '"') || (int32(*(*int8)(unsafe.Pointer(z))) == '\'') {
|
||||
} else if int32(*(*int8)(unsafe.Pointer(z))) == '"' || int32(*(*int8)(unsafe.Pointer(z))) == '\'' {
|
||||
var delim int32 = int32(*(*int8)(unsafe.Pointer(z)))
|
||||
for n = 1; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0; n++ {
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == delim {
|
||||
n++
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr((n + 1))))) != delim {
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n+1)))) != delim {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var c int32
|
||||
for n = 1; (((((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
|
||||
for n = 1; libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n))))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0) && c != '"' && c != '\'' && c != ';'; n++ {
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5813,7 +5813,7 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
*(*int8)(unsafe.Pointer(zOut)) = int8(0)
|
||||
return 0
|
||||
}
|
||||
for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; i < nIn && i < nOut-1 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = *(*int8)(unsafe.Pointer(zIn + uintptr(i)))
|
||||
}
|
||||
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0)
|
||||
@ -5823,8 +5823,8 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
// Find the number of characters up to the start of the next "--end" token.
|
||||
func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
|
||||
var n int32 = 0
|
||||
for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint32(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
|
||||
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && (libc.Xstrncmp(tls, z+uintptr(n), ts+896, uint32(5)) != 0 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+5))))))*2)))&int32(_ISspace) != 0)) {
|
||||
n = n + tokenLength(tls, z+uintptr(n), pnLine)
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -5835,16 +5835,16 @@ func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:1
|
||||
func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
|
||||
var n int32 = 0
|
||||
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
|
||||
if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint32(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
|
||||
(((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint32(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
return (n + len)
|
||||
var len int32 = tokenLength(tls, z+uintptr(n), pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+902, uint32(7)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+7))))))*2)))&int32(_ISspace) != 0 ||
|
||||
stopAtElse != 0 && libc.Xstrncmp(tls, z+uintptr(n), ts+910, uint32(6)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+6))))))*2)))&int32(_ISspace) != 0 {
|
||||
return n + len
|
||||
}
|
||||
if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint32(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+917, uint32(4)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+4))))))*2)))&int32(_ISspace) != 0 {
|
||||
var skip int32 = findEndif(tls, z+uintptr(n)+uintptr(len), 0, pnLine)
|
||||
n = n + (skip + len)
|
||||
} else {
|
||||
n = n + (len)
|
||||
n = n + len
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5868,11 +5868,11 @@ func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uint
|
||||
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
|
||||
}
|
||||
g.iTimeout = 0
|
||||
for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) || (rc == SQLITE_ROW)) &&
|
||||
(iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY || rc == SQLITE_ROW) &&
|
||||
iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_reset(tls, pStmt)
|
||||
sqlite3.Xsqlite3_sleep(tls, 50)
|
||||
iTimeout = iTimeout - (50)
|
||||
iTimeout = iTimeout - 50
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
g.iTimeout = DEFAULT_TIMEOUT
|
||||
@ -5893,11 +5893,11 @@ func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
|
||||
var i int32
|
||||
var j int32
|
||||
for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
|
||||
j = (i + 1)
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == '/' {
|
||||
j = i + 1
|
||||
}
|
||||
}
|
||||
return (z + uintptr(j))
|
||||
return z + uintptr(j)
|
||||
}
|
||||
|
||||
// Interpret zArg as a boolean value. Return either 0 or 1.
|
||||
@ -5909,15 +5909,15 @@ func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
|
||||
if zArg == uintptr(0) {
|
||||
return 0
|
||||
}
|
||||
for i = 0; (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
|
||||
for i = 0; int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0' && int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'; i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0 {
|
||||
return libc.Xatoi(tls, zArg)
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169) == 0 {
|
||||
return 1
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177) == 0 {
|
||||
return 0
|
||||
}
|
||||
errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
|
||||
@ -5958,58 +5958,58 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
|
||||
libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint32(unsafe.Sizeof(String{})))
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii))))) != 0 {
|
||||
prevLine = *(*int32)(unsafe.Pointer(bp + 372 /* lineno */))
|
||||
len = tokenLength(tls, (zScript + uintptr(ii)), bp+372 /* &lineno */)
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
|
||||
ii = ii + (len)
|
||||
len = tokenLength(tls, zScript+uintptr(ii), bp+372 /* &lineno */)
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 || c == '/' && int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+1)))) == '*' {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
|
||||
ii = ii + (len)
|
||||
if c != '-' || int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+1)))) != '-' || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+2)))))*2)))&int32(_ISalpha) != 0) {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
|
||||
// Run any prior SQL before processing the new --command
|
||||
if ii > iBegin {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
iBegin = (ii + len)
|
||||
iBegin = ii + len
|
||||
}
|
||||
|
||||
// Parse the --command
|
||||
if g.iTrace >= 2 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, zScript+uintptr(ii)))
|
||||
}
|
||||
n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+376 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
|
||||
for nArg = 0; (n < (len - 2)) && (nArg < MX_ARG); nArg++ {
|
||||
for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
n = extractToken(tls, zScript+uintptr(ii)+uintptr(2), len-2, bp+376 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
|
||||
for nArg = 0; n < len-2 && nArg < MX_ARG; nArg++ {
|
||||
for n < len-2 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+2+n))))))*2)))&int32(_ISspace) != 0 {
|
||||
n++
|
||||
}
|
||||
if n >= (len - 2) {
|
||||
if n >= len-2 {
|
||||
break
|
||||
}
|
||||
n = n + (extractToken(tls, (((zScript + uintptr(ii)) + uintptr(2)) + uintptr(n)), ((len - 2) - n),
|
||||
(bp + 406 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]int8{}))))
|
||||
n = n + extractToken(tls, zScript+uintptr(ii)+uintptr(2)+uintptr(n), len-2-n,
|
||||
bp+406+uintptr(nArg)*100, int32(unsafe.Sizeof([100]int8{})))
|
||||
}
|
||||
for j = nArg; j < MX_ARG; j++ {
|
||||
*(*int8)(unsafe.Pointer((bp + 406 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100))) = int8(0)
|
||||
*(*int8)(unsafe.Pointer(bp + 406 + uintptr(libc.PostIncInt32(&j, 1))*100)) = int8(0)
|
||||
}
|
||||
|
||||
// --sleep N
|
||||
//
|
||||
// Pause for N milliseconds
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+406 /* &azArg[0] */)))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1207) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, bp+406))
|
||||
} else
|
||||
|
||||
// --exit N
|
||||
//
|
||||
// Exit this process. If N>0 then exit without shutting down
|
||||
// SQLite. (In other words, simulate a crash.)
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1213) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, bp+406)
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
if rc == 0 {
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
@ -6021,9 +6021,9 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Begin a new test case. Announce in the log that the test case
|
||||
// has begun.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1218) == 0 {
|
||||
if g.iTrace == 1 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, len-1, zScript+uintptr(ii)))
|
||||
}
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
@ -6032,29 +6032,29 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Mark the current task as having finished, even if it is not.
|
||||
// This can be used in conjunction with --exit to simulate a crash.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1227) == 0 && iClient > 0 {
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
} else
|
||||
|
||||
// --reset
|
||||
//
|
||||
// Reset accumulated results back to an empty string
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1234) == 0 {
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
|
||||
// --match ANSWER...
|
||||
//
|
||||
// Check to see if output matches ANSWER. Report an error if not.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1240) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
for jj = 7; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint32((len-jj)-1))) != 0) {
|
||||
if len-jj-1 != (*String)(unsafe.Pointer(bp+360)).n || libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360)).z, zAns, uint32(len-jj-1)) != 0 {
|
||||
errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
libc.VaList(bp+48, prevLine, zFilename, len-jj-1, zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
g.nTest++
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
@ -6065,16 +6065,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Check to see if output does or does not match the glob pattern
|
||||
// ANSWER.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1291) == 0 || libc.Xstrcmp(tls, bp+376, ts+1296) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
var zCopy uintptr
|
||||
var isGlob int32 = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 376 /* &zCmd[0] */))) == 'g'))
|
||||
for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var isGlob int32 = libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 376))) == 'g')
|
||||
for jj = 9 - 3*isGlob; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
|
||||
if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, len-jj-1, zAns))
|
||||
if libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360)).z) == 0)^isGlob != 0 {
|
||||
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
@ -6086,21 +6086,21 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --output
|
||||
//
|
||||
// Output the result of the previous SQL.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1347) == 0 {
|
||||
logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
} else
|
||||
|
||||
// --source FILENAME
|
||||
//
|
||||
// Run a subscript from a separate file.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1354) == 0 {
|
||||
var zNewFile uintptr
|
||||
var zNewScript uintptr
|
||||
var zToDel uintptr = uintptr(0)
|
||||
zNewFile = (bp + 406 /* &azArg[0] */)
|
||||
if !((int32(*(*int8)(unsafe.Pointer(zNewFile)))) == '/') {
|
||||
zNewFile = bp + 406
|
||||
if !(int32(*(*int8)(unsafe.Pointer(zNewFile))) == '/') {
|
||||
var k int32
|
||||
for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
|
||||
for k = int32(libc.Xstrlen(tls, zFilename)) - 1; k >= 0 && !(int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k)))) == '/'); k-- {
|
||||
}
|
||||
if k > 0 {
|
||||
zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
|
||||
@ -6121,26 +6121,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --print MESSAGE....
|
||||
//
|
||||
// Output the remainder of the line to the log file
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1405) == 0 {
|
||||
var jj int32
|
||||
for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 7; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
} else
|
||||
|
||||
// --if EXPR
|
||||
//
|
||||
// Skip forward to the next matching --endif or --else if EXPR is false.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1411) == 0 {
|
||||
var jj int32
|
||||
var rc int32
|
||||
var pStmt uintptr
|
||||
for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 4; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if (rc != SQLITE_ROW) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+372 /* &lineno */))
|
||||
if rc != SQLITE_ROW || sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 1, bp+372)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
} else
|
||||
@ -6149,23 +6149,23 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true. Skip forward to the next matching --endif.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+372 /* &lineno */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1426) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 0, bp+372)
|
||||
} else
|
||||
|
||||
// --endif
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true or an --else of a false if. This is a no-op.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1431) == 0 {
|
||||
// no-op
|
||||
} else
|
||||
|
||||
// --start CLIENT
|
||||
//
|
||||
// Start up the given client.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
|
||||
var iNewClient int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1437) == 0 && iClient == 0 {
|
||||
var iNewClient int32 = libc.Xatoi(tls, bp+406)
|
||||
if iNewClient > 0 {
|
||||
startClient(tls, iNewClient)
|
||||
}
|
||||
@ -6176,16 +6176,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// Wait until all tasks complete for the given client. If CLIENT is
|
||||
// "all" then wait for all clients to complete. Wait no longer than
|
||||
// TIMEOUT milliseconds (default 10,000)
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1443) == 0 && iClient == 0 {
|
||||
var iTimeout int32
|
||||
if nArg >= 2 {
|
||||
iTimeout = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */ + 1*100))
|
||||
iTimeout = libc.Xatoi(tls, bp+406+1*100)
|
||||
} else {
|
||||
iTimeout = 10000
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+606 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
|
||||
libc.VaList(bp+216, prevLine, zFilename))
|
||||
waitForClient(tls, libc.Xatoi(tls, (bp+406 /* &azArg[0] */)), iTimeout, bp+606 /* &zError[0] */)
|
||||
waitForClient(tls, libc.Xatoi(tls, bp+406), iTimeout, bp+606 /* &zError[0] */)
|
||||
} else
|
||||
|
||||
// --task CLIENT
|
||||
@ -6194,19 +6194,19 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Assign work to a client. Start the client if it is not running
|
||||
// already.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
|
||||
var iTarget int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1463) == 0 && iClient == 0 {
|
||||
var iTarget int32 = libc.Xatoi(tls, bp+406)
|
||||
var iEnd int32
|
||||
var zTask uintptr
|
||||
var zTName uintptr
|
||||
iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+372 /* &lineno */)
|
||||
iEnd = findEnd(tls, zScript+uintptr(ii)+uintptr(len), bp+372 /* &lineno */)
|
||||
if iTarget < 0 {
|
||||
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
|
||||
libc.VaList(bp+232, prevLine, zFilename, iTarget))
|
||||
} else {
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, zScript+uintptr(ii)+uintptr(len)))
|
||||
if nArg > 1 {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+406 /* &azArg[0] */ +1*100)))
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, bp+406+1*100))
|
||||
} else {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
|
||||
}
|
||||
@ -6216,26 +6216,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
sqlite3.Xsqlite3_free(tls, zTask)
|
||||
sqlite3.Xsqlite3_free(tls, zTName)
|
||||
}
|
||||
iEnd = iEnd + (tokenLength(tls, (((zScript + uintptr(ii)) + uintptr(len)) + uintptr(iEnd)), bp+372 /* &lineno */))
|
||||
len = len + (iEnd)
|
||||
iBegin = (ii + len)
|
||||
iEnd = iEnd + tokenLength(tls, zScript+uintptr(ii)+uintptr(len)+uintptr(iEnd), bp+372)
|
||||
len = len + iEnd
|
||||
iBegin = ii + len
|
||||
} else
|
||||
|
||||
// --breakpoint
|
||||
//
|
||||
// This command calls "test_breakpoint()" which is a routine provided
|
||||
// as a convenient place to set a debugger breakpoint.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1567) == 0 {
|
||||
test_breakpoint(tls)
|
||||
} else
|
||||
|
||||
// --show-sql-errors BOOLEAN
|
||||
//
|
||||
// Turn display of SQL errors on and off.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1578) == 0 {
|
||||
g.bIgnoreSqlErrors = func() int32 {
|
||||
if nArg >= 1 {
|
||||
return libc.BoolInt32(!(booleanValue(tls, (bp+406 /* &azArg[0] */)) != 0))
|
||||
return libc.BoolInt32(!(booleanValue(tls, bp+406) != 0))
|
||||
}
|
||||
return 1
|
||||
}()
|
||||
@ -6243,10 +6243,10 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
|
||||
libc.VaList(bp+320, prevLine, zFilename, bp+376 /* &zCmd[0] */))
|
||||
}
|
||||
ii = ii + (len)
|
||||
ii = ii + len
|
||||
}
|
||||
if iBegin < ii {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
runSql(tls, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
}
|
||||
@ -6270,7 +6270,7 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
|
||||
for i = 0; i < nArg; i++ {
|
||||
var z uintptr
|
||||
if (i + hasArg) >= nArg {
|
||||
if i+hasArg >= nArg {
|
||||
break
|
||||
}
|
||||
z = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4))
|
||||
@ -6285,15 +6285,15 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
z++
|
||||
}
|
||||
if libc.Xstrcmp(tls, z, zOption) == 0 {
|
||||
if (hasArg != 0) && (i == (nArg - 1)) {
|
||||
if hasArg != 0 && i == nArg-1 {
|
||||
fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
|
||||
}
|
||||
if hasArg != 0 {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*4))
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*4))
|
||||
} else {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4))
|
||||
}
|
||||
j = ((i + 1) + (libc.Bool32(hasArg != 0)))
|
||||
j = i + 1 + libc.Bool32(hasArg != 0)
|
||||
for j < nArg {
|
||||
*(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*4)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*4))
|
||||
}
|
||||
@ -6312,8 +6312,8 @@ func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
|
||||
var i int32
|
||||
var zTail uintptr = argv0
|
||||
for i = 0; *(*int8)(unsafe.Pointer(argv0 + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i))))) == '/' {
|
||||
zTail = ((argv0 + uintptr(i)) + uintptr(1))
|
||||
if int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i)))) == '/' {
|
||||
zTail = argv0 + uintptr(i) + uintptr(1)
|
||||
}
|
||||
}
|
||||
libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
|
||||
@ -6367,43 +6367,43 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + 1*4))
|
||||
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
|
||||
if strglob(tls, ts+2323, g.zDbFile) != 0 {
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */) != 0 {
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330) != 0 {
|
||||
libc.Xfprintf(tls, libc.Xstderr,
|
||||
|
||||
ts+2415, /* "SQLite library a..." */
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */))
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+32 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = argc - 2
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+32, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
if zNRep != 0 {
|
||||
nRep = libc.Xatoi(tls, zNRep)
|
||||
}
|
||||
if nRep < 1 {
|
||||
nRep = 1
|
||||
}
|
||||
g.zVfs = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
g.zVfs = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
if zTrace != 0 {
|
||||
g.iTrace = libc.Xatoi(tls, zTrace)
|
||||
}
|
||||
if findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
|
||||
if findOption(tls, argv+uintptr(2)*4, bp+232, ts+2534, 0) != uintptr(0) {
|
||||
g.iTrace = 0
|
||||
}
|
||||
zTmout = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
zTmout = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
if zTmout != 0 {
|
||||
iTmout = libc.Xatoi(tls, zTmout)
|
||||
}
|
||||
g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
|
||||
g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
|
||||
g.bSqlTrace = libc.Bool32(findOption(tls, argv+uintptr(2)*4, bp+232, ts+2548, 0) != uintptr(0))
|
||||
g.bSync = libc.Bool32(findOption(tls, argv+uintptr(2)*4, bp+232, ts+2557, 0) != uintptr(0))
|
||||
if g.zErrLog != 0 {
|
||||
g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
|
||||
} else {
|
||||
@ -6423,7 +6423,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
if iClient < 1 {
|
||||
fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+32 /* &.zName */, ts+2591, /* "%05d.client%02d" */
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+32, ts+2591, /* "%05d.client%02d" */
|
||||
libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
|
||||
} else {
|
||||
var nTry int32 = 0
|
||||
@ -6434,14 +6434,14 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
libc.Xprintf(tls, ts+2617 /* "With SQLite 3.37..." */, 0)
|
||||
for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
|
||||
for i = 0; libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i)) != uintptr(0); i++ {
|
||||
libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
|
||||
}
|
||||
libc.Xfflush(tls, libc.Xstdout)
|
||||
}
|
||||
iClient = 0
|
||||
for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
|
||||
if (nTry % 5) == 4 {
|
||||
for ok := true; ok; ok = rc != 0 && libc.PreIncInt32(&nTry, 1) < 60 && sqlite3.Xsqlite3_sleep(tls, 1000) > 0 {
|
||||
if nTry%5 == 4 {
|
||||
libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
|
||||
libc.VaList(bp+88, func() uintptr {
|
||||
if nTry > 5 {
|
||||
@ -6451,7 +6451,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}(), g.zDbFile))
|
||||
}
|
||||
rc = libc.Xunlink(tls, g.zDbFile)
|
||||
if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT) {
|
||||
if rc != 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOENT {
|
||||
rc = 0
|
||||
}
|
||||
}
|
||||
@ -6459,9 +6459,9 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
fatalError(tls, ts+2771, /* "unable to unlink..." */
|
||||
libc.VaList(bp+104, g.zDbFile, nTry))
|
||||
}
|
||||
openFlags = openFlags | (SQLITE_OPEN_CREATE)
|
||||
openFlags = openFlags | SQLITE_OPEN_CREATE
|
||||
}
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 12 /* &.db */), openFlags, g.zVfs)
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, uintptr(unsafe.Pointer(&g))+12, openFlags, g.zVfs)
|
||||
if rc != 0 {
|
||||
fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
|
||||
}
|
||||
@ -6494,8 +6494,8 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}{sqlTraceCallback})), uintptr(0))
|
||||
}
|
||||
if iClient > 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*4))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*4)
|
||||
}
|
||||
if g.iTrace != 0 {
|
||||
logMessage(tls, ts+2889 /* "start-client" */, 0)
|
||||
@ -6523,11 +6523,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
} else {
|
||||
var pStmt uintptr
|
||||
var iTimeout int32
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) == 0 {
|
||||
fatalError(tls, ts+2939 /* "missing script f..." */, 0)
|
||||
}
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*4))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*4)
|
||||
}
|
||||
runSql(tls,
|
||||
|
||||
@ -6548,21 +6548,21 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
g.iTimeout = 0
|
||||
iTimeout = 1000
|
||||
for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == SQLITE_BUSY) ||
|
||||
(rc == SQLITE_ROW)) && (iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, trySql(tls, ts+3502, 0)) == SQLITE_BUSY ||
|
||||
rc == SQLITE_ROW) && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
|
||||
iTimeout = 1000
|
||||
for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) && (iTimeout > 0) {
|
||||
for libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
if rc == SQLITE_ROW {
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 80 /* &.nError */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 84 /* &.nTest */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 80)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 0)
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 84)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 1)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
}
|
||||
@ -6577,7 +6577,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
}
|
||||
return (libc.Bool32(g.nError > 0))
|
||||
return libc.Bool32(g.nError > 0)
|
||||
}
|
||||
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
|
@ -5116,13 +5116,13 @@ func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
|
||||
bp := tls.Alloc(24)
|
||||
defer tls.Free(24)
|
||||
|
||||
for (zMsg != 0) && (*(*int8)(unsafe.Pointer(zMsg)) != 0) {
|
||||
for zMsg != 0 && *(*int8)(unsafe.Pointer(zMsg)) != 0 {
|
||||
var i int32
|
||||
for i = 0; ((*(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n' && int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'; i++ {
|
||||
}
|
||||
libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
|
||||
zMsg += uintptr(i)
|
||||
for (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n') || (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r') {
|
||||
for int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n' || int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r' {
|
||||
zMsg++
|
||||
}
|
||||
}
|
||||
@ -5164,22 +5164,22 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
var invert int32
|
||||
var seen int32
|
||||
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) != 0 {
|
||||
if c == '*' {
|
||||
for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
|
||||
if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) == '*' || c == '?' {
|
||||
if c == '?' && int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
if c == 0 {
|
||||
return 1
|
||||
} else if c == '[' {
|
||||
for (*(*int8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
|
||||
for *(*int8)(unsafe.Pointer(z)) != 0 && strglob(tls, zGlob-uintptr(1), z) != 0 {
|
||||
z++
|
||||
}
|
||||
return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
|
||||
return libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) != 0)
|
||||
}
|
||||
for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) != 0 {
|
||||
for c2 != c {
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
|
||||
if c2 == 0 {
|
||||
@ -5192,7 +5192,7 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
return 0
|
||||
} else if c == '?' {
|
||||
if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
|
||||
if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '[' {
|
||||
@ -5214,10 +5214,10 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
for (c2 != 0) && (c2 != ']') {
|
||||
if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob))) != 0)) && (prior_c > 0) {
|
||||
for c2 != 0 && c2 != ']' {
|
||||
if c2 == '-' && int32(*(*int8)(unsafe.Pointer(zGlob))) != ']' && int32(*(*int8)(unsafe.Pointer(zGlob))) != 0 && prior_c > 0 {
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
if (c >= prior_c) && (c <= c2) {
|
||||
if c >= prior_c && c <= c2 {
|
||||
seen = 1
|
||||
}
|
||||
prior_c = 0
|
||||
@ -5229,32 +5229,32 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
if (c2 == 0) || ((seen ^ invert) == 0) {
|
||||
if c2 == 0 || seen^invert == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '#' {
|
||||
if ((int32(*(*int8)(unsafe.Pointer(z))) == '-') || (int32(*(*int8)(unsafe.Pointer(z))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + 1)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if (int32(*(*int8)(unsafe.Pointer(z))) == '-' || int32(*(*int8)(unsafe.Pointer(z))) == '+') && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + 1)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0) {
|
||||
return 0
|
||||
}
|
||||
z++
|
||||
for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0 {
|
||||
for int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
} else {
|
||||
if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
|
||||
if c != int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
|
||||
return libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0)
|
||||
}
|
||||
|
||||
// Close output stream pOut if it is not stdout or stderr
|
||||
func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
|
||||
if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) {
|
||||
if pOut != libc.Xstdout && pOut != libc.Xstderr {
|
||||
libc.Xfclose(tls, pOut)
|
||||
}
|
||||
}
|
||||
@ -5272,12 +5272,12 @@ func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
}
|
||||
@ -5298,13 +5298,13 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
maybeClose(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
maybeClose(tls, g.pErrLog)
|
||||
@ -5313,8 +5313,8 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
if g.db != 0 {
|
||||
var nTry int32 = 0
|
||||
g.iTimeout = 0
|
||||
for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == SQLITE_BUSY) &&
|
||||
((libc.PostIncInt32(&nTry, 1)) < 100) {
|
||||
for trySql(tls, ts+30, 0) == SQLITE_BUSY &&
|
||||
libc.PostIncInt32(&nTry, 1) < 100 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
}
|
||||
}
|
||||
@ -5335,7 +5335,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
@ -5346,7 +5346,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
// Return the length of a string omitting trailing whitespace
|
||||
func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
|
||||
var n int32 = int32(libc.Xstrlen(tls, z))
|
||||
for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
for n > 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-1))))))*2)))&int32(_ISspace) != 0 {
|
||||
n--
|
||||
}
|
||||
return n
|
||||
@ -5362,7 +5362,7 @@ func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
|
||||
_ = argc
|
||||
_ = argv
|
||||
sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, SQLITE_FCNTL_VFSNAME, bp /* &zVfs */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
|
||||
sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
|
||||
}
|
||||
}
|
||||
@ -5373,7 +5373,7 @@ func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:32
|
||||
defer tls.Free(8)
|
||||
|
||||
_ = pCD
|
||||
if (count * 10) > g.iTimeout {
|
||||
if count*10 > g.iTimeout {
|
||||
if g.iTimeout > 0 {
|
||||
errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
|
||||
}
|
||||
@ -5398,16 +5398,16 @@ func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr)
|
||||
defer tls.Free(24)
|
||||
|
||||
_ = pArg
|
||||
if (iErrCode == SQLITE_ERROR) && (g.bIgnoreSqlErrors != 0) {
|
||||
if iErrCode == SQLITE_ERROR && g.bIgnoreSqlErrors != 0 {
|
||||
return
|
||||
}
|
||||
if ((iErrCode & 0xff) == SQLITE_SCHEMA) && (g.iTrace < 3) {
|
||||
if iErrCode&0xff == SQLITE_SCHEMA && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if ((g.iTimeout == 0) && ((iErrCode & 0xff) == SQLITE_BUSY)) && (g.iTrace < 3) {
|
||||
if g.iTimeout == 0 && iErrCode&0xff == SQLITE_BUSY && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if (iErrCode & 0xff) == SQLITE_NOTICE {
|
||||
if iErrCode&0xff == SQLITE_NOTICE {
|
||||
logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
|
||||
} else {
|
||||
errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
|
||||
@ -5492,8 +5492,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
if n < 0 {
|
||||
n = int32(libc.Xstrlen(tls, z))
|
||||
}
|
||||
if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
|
||||
if (*String)(unsafe.Pointer(p)).n+n >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = (*String)(unsafe.Pointer(p)).nAlloc*2 + n + 100
|
||||
var zNew uintptr = sqlite3.Xsqlite3_realloc(tls, (*String)(unsafe.Pointer(p)).z, nAlloc)
|
||||
if zNew == uintptr(0) {
|
||||
fatalError(tls, ts+129 /* "out of memory" */, 0)
|
||||
@ -5501,8 +5501,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
(*String)(unsafe.Pointer(p)).z = zNew
|
||||
(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
|
||||
}
|
||||
libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n))
|
||||
*(*int32)(unsafe.Pointer(p + 8 /* &.n */)) += (n)
|
||||
libc.Xmemcpy(tls, (*String)(unsafe.Pointer(p)).z+uintptr((*String)(unsafe.Pointer(p)).n), z, uint64(n))
|
||||
*(*int32)(unsafe.Pointer(p + 8)) += n
|
||||
*(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = int8(0)
|
||||
}
|
||||
|
||||
@ -5525,20 +5525,20 @@ func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
|
||||
stringAppend(tls, p, ts+145 /* "nil" */, 3)
|
||||
return
|
||||
}
|
||||
for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0 {
|
||||
stringAppend(tls, p, z, i)
|
||||
return
|
||||
}
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
for *(*int8)(unsafe.Pointer(z)) != 0 {
|
||||
for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''); i++ {
|
||||
for i = 0; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''; i++ {
|
||||
}
|
||||
if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 {
|
||||
stringAppend(tls, p, z, (i + 1))
|
||||
stringAppend(tls, p, z, i+1)
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
z += (uintptr(i + 1))
|
||||
z += uintptr(i + 1)
|
||||
} else {
|
||||
stringAppend(tls, p, z, i)
|
||||
break
|
||||
@ -5582,7 +5582,7 @@ func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* m
|
||||
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
|
||||
stringAppendTerm(tls, p, bp+16 /* &zErr[0] */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
|
||||
stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
}
|
||||
@ -5606,7 +5606,7 @@ func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mpt
|
||||
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
|
||||
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
|
||||
}{evalCallback})), bp /* &res */, bp+16 /* &zErrMsg */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
|
||||
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)), -1)
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)))
|
||||
} else if rc != 0 {
|
||||
@ -5635,13 +5635,13 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0)
|
||||
if rc == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
continue
|
||||
}
|
||||
if rc != SQLITE_OK {
|
||||
fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
}
|
||||
if (g.nError != 0) || (g.nTest != 0) {
|
||||
if g.nError != 0 || g.nTest != 0 {
|
||||
runSql(tls, ts+196, /* "UPDATE counters ..." */
|
||||
libc.VaList(bp+8, g.nError, g.nTest))
|
||||
g.nError = 0
|
||||
@ -5662,7 +5662,7 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if rc == SQLITE_ROW {
|
||||
var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, n+1)
|
||||
libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
|
||||
@ -5682,12 +5682,12 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
for trySql(tls, ts+613 /* "COMMIT" */, 0) == SQLITE_BUSY {
|
||||
for trySql(tls, ts+613, 0) == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
totalTime = totalTime + (100)
|
||||
totalTime = totalTime + 100
|
||||
continue
|
||||
}
|
||||
fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
@ -5759,7 +5759,7 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
libc.Xfseek(tls, in, int64(0), SEEK_END)
|
||||
sz = libc.Xftell(tls, in)
|
||||
libc.Xrewind(tls, in)
|
||||
z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + int64(1))))
|
||||
z = sqlite3.Xsqlite3_malloc(tls, int32(sz+int64(1)))
|
||||
sz = int64(libc.Xfread(tls, z, uint64(1), uint64(sz), in))
|
||||
*(*int8)(unsafe.Pointer(z + uintptr(sz))) = int8(0)
|
||||
libc.Xfclose(tls, in)
|
||||
@ -5769,24 +5769,24 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
// Return the length of the next token.
|
||||
func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
|
||||
var n int32 = 0
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '*')) {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2)))&int32(_ISspace) != 0 || int32(*(*int8)(unsafe.Pointer(z))) == '/' && int32(*(*int8)(unsafe.Pointer(z + 1))) == '*' {
|
||||
var inC int32 = 0
|
||||
var c int32
|
||||
if int32(*(*int8)(unsafe.Pointer(z))) == '/' {
|
||||
inC = 1
|
||||
n = 2
|
||||
}
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1)))))) != 0 {
|
||||
if c == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 {
|
||||
continue
|
||||
}
|
||||
if ((inC != 0) && (c == '*')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
|
||||
if inC != 0 && c == '*' && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/' {
|
||||
n++
|
||||
inC = 0
|
||||
} else if (!(inC != 0) && (c == '/')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*') {
|
||||
} else if !(inC != 0) && c == '/' && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*' {
|
||||
n++
|
||||
inC = 1
|
||||
} else if !(inC != 0) {
|
||||
@ -5794,29 +5794,29 @@ func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:7
|
||||
}
|
||||
}
|
||||
n--
|
||||
} else if (int32(*(*int8)(unsafe.Pointer(z))) == '-') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '-') {
|
||||
for n = 2; (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'); n++ {
|
||||
} else if int32(*(*int8)(unsafe.Pointer(z))) == '-' && int32(*(*int8)(unsafe.Pointer(z + 1))) == '-' {
|
||||
for n = 2; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'; n++ {
|
||||
}
|
||||
if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
n++
|
||||
}
|
||||
} else if (int32(*(*int8)(unsafe.Pointer(z))) == '"') || (int32(*(*int8)(unsafe.Pointer(z))) == '\'') {
|
||||
} else if int32(*(*int8)(unsafe.Pointer(z))) == '"' || int32(*(*int8)(unsafe.Pointer(z))) == '\'' {
|
||||
var delim int32 = int32(*(*int8)(unsafe.Pointer(z)))
|
||||
for n = 1; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0; n++ {
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == delim {
|
||||
n++
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr((n + 1))))) != delim {
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(n+1)))) != delim {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var c int32
|
||||
for n = 1; (((((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
|
||||
for n = 1; libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n))))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0) && c != '"' && c != '\'' && c != ';'; n++ {
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5829,7 +5829,7 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
*(*int8)(unsafe.Pointer(zOut)) = int8(0)
|
||||
return 0
|
||||
}
|
||||
for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; i < nIn && i < nOut-1 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = *(*int8)(unsafe.Pointer(zIn + uintptr(i)))
|
||||
}
|
||||
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0)
|
||||
@ -5839,8 +5839,8 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
// Find the number of characters up to the start of the next "--end" token.
|
||||
func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
|
||||
var n int32 = 0
|
||||
for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint64(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
|
||||
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && (libc.Xstrncmp(tls, z+uintptr(n), ts+896, uint64(5)) != 0 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+5))))))*2)))&int32(_ISspace) != 0)) {
|
||||
n = n + tokenLength(tls, z+uintptr(n), pnLine)
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -5851,16 +5851,16 @@ func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:1
|
||||
func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
|
||||
var n int32 = 0
|
||||
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
|
||||
if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint64(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
|
||||
(((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint64(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
return (n + len)
|
||||
var len int32 = tokenLength(tls, z+uintptr(n), pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+902, uint64(7)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+7))))))*2)))&int32(_ISspace) != 0 ||
|
||||
stopAtElse != 0 && libc.Xstrncmp(tls, z+uintptr(n), ts+910, uint64(6)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+6))))))*2)))&int32(_ISspace) != 0 {
|
||||
return n + len
|
||||
}
|
||||
if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint64(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+917, uint64(4)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n+4))))))*2)))&int32(_ISspace) != 0 {
|
||||
var skip int32 = findEndif(tls, z+uintptr(n)+uintptr(len), 0, pnLine)
|
||||
n = n + (skip + len)
|
||||
} else {
|
||||
n = n + (len)
|
||||
n = n + len
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5884,11 +5884,11 @@ func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uint
|
||||
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
|
||||
}
|
||||
g.iTimeout = 0
|
||||
for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) || (rc == SQLITE_ROW)) &&
|
||||
(iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY || rc == SQLITE_ROW) &&
|
||||
iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_reset(tls, pStmt)
|
||||
sqlite3.Xsqlite3_sleep(tls, 50)
|
||||
iTimeout = iTimeout - (50)
|
||||
iTimeout = iTimeout - 50
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
g.iTimeout = DEFAULT_TIMEOUT
|
||||
@ -5909,11 +5909,11 @@ func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
|
||||
var i int32
|
||||
var j int32
|
||||
for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
|
||||
j = (i + 1)
|
||||
if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == '/' {
|
||||
j = i + 1
|
||||
}
|
||||
}
|
||||
return (z + uintptr(j))
|
||||
return z + uintptr(j)
|
||||
}
|
||||
|
||||
// Interpret zArg as a boolean value. Return either 0 or 1.
|
||||
@ -5925,15 +5925,15 @@ func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
|
||||
if zArg == uintptr(0) {
|
||||
return 0
|
||||
}
|
||||
for i = 0; (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
|
||||
for i = 0; int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0' && int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'; i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0 {
|
||||
return libc.Xatoi(tls, zArg)
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169) == 0 {
|
||||
return 1
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177) == 0 {
|
||||
return 0
|
||||
}
|
||||
errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
|
||||
@ -5974,58 +5974,58 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
|
||||
libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})))
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii))))) != 0 {
|
||||
prevLine = *(*int32)(unsafe.Pointer(bp + 376 /* lineno */))
|
||||
len = tokenLength(tls, (zScript + uintptr(ii)), bp+376 /* &lineno */)
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
|
||||
ii = ii + (len)
|
||||
len = tokenLength(tls, zScript+uintptr(ii), bp+376 /* &lineno */)
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 || c == '/' && int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+1)))) == '*' {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
|
||||
ii = ii + (len)
|
||||
if c != '-' || int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+1)))) != '-' || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+2)))))*2)))&int32(_ISalpha) != 0) {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
|
||||
// Run any prior SQL before processing the new --command
|
||||
if ii > iBegin {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
iBegin = (ii + len)
|
||||
iBegin = ii + len
|
||||
}
|
||||
|
||||
// Parse the --command
|
||||
if g.iTrace >= 2 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, zScript+uintptr(ii)))
|
||||
}
|
||||
n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
|
||||
for nArg = 0; (n < (len - 2)) && (nArg < MX_ARG); nArg++ {
|
||||
for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
n = extractToken(tls, zScript+uintptr(ii)+uintptr(2), len-2, bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
|
||||
for nArg = 0; n < len-2 && nArg < MX_ARG; nArg++ {
|
||||
for n < len-2 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+2+n))))))*2)))&int32(_ISspace) != 0 {
|
||||
n++
|
||||
}
|
||||
if n >= (len - 2) {
|
||||
if n >= len-2 {
|
||||
break
|
||||
}
|
||||
n = n + (extractToken(tls, (((zScript + uintptr(ii)) + uintptr(2)) + uintptr(n)), ((len - 2) - n),
|
||||
(bp + 410 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]int8{}))))
|
||||
n = n + extractToken(tls, zScript+uintptr(ii)+uintptr(2)+uintptr(n), len-2-n,
|
||||
bp+410+uintptr(nArg)*100, int32(unsafe.Sizeof([100]int8{})))
|
||||
}
|
||||
for j = nArg; j < MX_ARG; j++ {
|
||||
*(*int8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100))) = int8(0)
|
||||
*(*int8)(unsafe.Pointer(bp + 410 + uintptr(libc.PostIncInt32(&j, 1))*100)) = int8(0)
|
||||
}
|
||||
|
||||
// --sleep N
|
||||
//
|
||||
// Pause for N milliseconds
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1207) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, bp+410))
|
||||
} else
|
||||
|
||||
// --exit N
|
||||
//
|
||||
// Exit this process. If N>0 then exit without shutting down
|
||||
// SQLite. (In other words, simulate a crash.)
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1213) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, bp+410)
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
if rc == 0 {
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
@ -6037,9 +6037,9 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Begin a new test case. Announce in the log that the test case
|
||||
// has begun.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1218) == 0 {
|
||||
if g.iTrace == 1 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, len-1, zScript+uintptr(ii)))
|
||||
}
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
@ -6048,29 +6048,29 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Mark the current task as having finished, even if it is not.
|
||||
// This can be used in conjunction with --exit to simulate a crash.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1227) == 0 && iClient > 0 {
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
} else
|
||||
|
||||
// --reset
|
||||
//
|
||||
// Reset accumulated results back to an empty string
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1234) == 0 {
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
|
||||
// --match ANSWER...
|
||||
//
|
||||
// Check to see if output matches ANSWER. Report an error if not.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1240) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
for jj = 7; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint64((len-jj)-1))) != 0) {
|
||||
if len-jj-1 != (*String)(unsafe.Pointer(bp+360)).n || libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360)).z, zAns, uint64(len-jj-1)) != 0 {
|
||||
errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
libc.VaList(bp+48, prevLine, zFilename, len-jj-1, zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
g.nTest++
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
@ -6081,16 +6081,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Check to see if output does or does not match the glob pattern
|
||||
// ANSWER.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1291) == 0 || libc.Xstrcmp(tls, bp+380, ts+1296) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
var zCopy uintptr
|
||||
var isGlob int32 = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */))) == 'g'))
|
||||
for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var isGlob int32 = libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380))) == 'g')
|
||||
for jj = 9 - 3*isGlob; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
|
||||
if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, len-jj-1, zAns))
|
||||
if libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360)).z) == 0)^isGlob != 0 {
|
||||
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
@ -6102,21 +6102,21 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --output
|
||||
//
|
||||
// Output the result of the previous SQL.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1347) == 0 {
|
||||
logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
} else
|
||||
|
||||
// --source FILENAME
|
||||
//
|
||||
// Run a subscript from a separate file.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1354) == 0 {
|
||||
var zNewFile uintptr
|
||||
var zNewScript uintptr
|
||||
var zToDel uintptr = uintptr(0)
|
||||
zNewFile = (bp + 410 /* &azArg[0] */)
|
||||
if !((int32(*(*int8)(unsafe.Pointer(zNewFile)))) == '/') {
|
||||
zNewFile = bp + 410
|
||||
if !(int32(*(*int8)(unsafe.Pointer(zNewFile))) == '/') {
|
||||
var k int32
|
||||
for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
|
||||
for k = int32(libc.Xstrlen(tls, zFilename)) - 1; k >= 0 && !(int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k)))) == '/'); k-- {
|
||||
}
|
||||
if k > 0 {
|
||||
zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
|
||||
@ -6137,26 +6137,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --print MESSAGE....
|
||||
//
|
||||
// Output the remainder of the line to the log file
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1405) == 0 {
|
||||
var jj int32
|
||||
for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 7; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
} else
|
||||
|
||||
// --if EXPR
|
||||
//
|
||||
// Skip forward to the next matching --endif or --else if EXPR is false.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1411) == 0 {
|
||||
var jj int32
|
||||
var rc int32
|
||||
var pStmt uintptr
|
||||
for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 4; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if (rc != SQLITE_ROW) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+376 /* &lineno */))
|
||||
if rc != SQLITE_ROW || sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 1, bp+376)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
} else
|
||||
@ -6165,23 +6165,23 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true. Skip forward to the next matching --endif.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+376 /* &lineno */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1426) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 0, bp+376)
|
||||
} else
|
||||
|
||||
// --endif
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true or an --else of a false if. This is a no-op.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1431) == 0 {
|
||||
// no-op
|
||||
} else
|
||||
|
||||
// --start CLIENT
|
||||
//
|
||||
// Start up the given client.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
|
||||
var iNewClient int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1437) == 0 && iClient == 0 {
|
||||
var iNewClient int32 = libc.Xatoi(tls, bp+410)
|
||||
if iNewClient > 0 {
|
||||
startClient(tls, iNewClient)
|
||||
}
|
||||
@ -6192,16 +6192,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// Wait until all tasks complete for the given client. If CLIENT is
|
||||
// "all" then wait for all clients to complete. Wait no longer than
|
||||
// TIMEOUT milliseconds (default 10,000)
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1443) == 0 && iClient == 0 {
|
||||
var iTimeout int32
|
||||
if nArg >= 2 {
|
||||
iTimeout = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + 1*100))
|
||||
iTimeout = libc.Xatoi(tls, bp+410+1*100)
|
||||
} else {
|
||||
iTimeout = 10000
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+610 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
|
||||
libc.VaList(bp+216, prevLine, zFilename))
|
||||
waitForClient(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)), iTimeout, bp+610 /* &zError[0] */)
|
||||
waitForClient(tls, libc.Xatoi(tls, bp+410), iTimeout, bp+610 /* &zError[0] */)
|
||||
} else
|
||||
|
||||
// --task CLIENT
|
||||
@ -6210,19 +6210,19 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Assign work to a client. Start the client if it is not running
|
||||
// already.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
|
||||
var iTarget int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1463) == 0 && iClient == 0 {
|
||||
var iTarget int32 = libc.Xatoi(tls, bp+410)
|
||||
var iEnd int32
|
||||
var zTask uintptr
|
||||
var zTName uintptr
|
||||
iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+376 /* &lineno */)
|
||||
iEnd = findEnd(tls, zScript+uintptr(ii)+uintptr(len), bp+376 /* &lineno */)
|
||||
if iTarget < 0 {
|
||||
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
|
||||
libc.VaList(bp+232, prevLine, zFilename, iTarget))
|
||||
} else {
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, zScript+uintptr(ii)+uintptr(len)))
|
||||
if nArg > 1 {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+410 /* &azArg[0] */ +1*100)))
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, bp+410+1*100))
|
||||
} else {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
|
||||
}
|
||||
@ -6232,26 +6232,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
sqlite3.Xsqlite3_free(tls, zTask)
|
||||
sqlite3.Xsqlite3_free(tls, zTName)
|
||||
}
|
||||
iEnd = iEnd + (tokenLength(tls, (((zScript + uintptr(ii)) + uintptr(len)) + uintptr(iEnd)), bp+376 /* &lineno */))
|
||||
len = len + (iEnd)
|
||||
iBegin = (ii + len)
|
||||
iEnd = iEnd + tokenLength(tls, zScript+uintptr(ii)+uintptr(len)+uintptr(iEnd), bp+376)
|
||||
len = len + iEnd
|
||||
iBegin = ii + len
|
||||
} else
|
||||
|
||||
// --breakpoint
|
||||
//
|
||||
// This command calls "test_breakpoint()" which is a routine provided
|
||||
// as a convenient place to set a debugger breakpoint.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1567) == 0 {
|
||||
test_breakpoint(tls)
|
||||
} else
|
||||
|
||||
// --show-sql-errors BOOLEAN
|
||||
//
|
||||
// Turn display of SQL errors on and off.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1578) == 0 {
|
||||
g.bIgnoreSqlErrors = func() int32 {
|
||||
if nArg >= 1 {
|
||||
return libc.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */)) != 0))
|
||||
return libc.BoolInt32(!(booleanValue(tls, bp+410) != 0))
|
||||
}
|
||||
return 1
|
||||
}()
|
||||
@ -6259,10 +6259,10 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
|
||||
libc.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
|
||||
}
|
||||
ii = ii + (len)
|
||||
ii = ii + len
|
||||
}
|
||||
if iBegin < ii {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
runSql(tls, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
}
|
||||
@ -6286,7 +6286,7 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
|
||||
for i = 0; i < nArg; i++ {
|
||||
var z uintptr
|
||||
if (i + hasArg) >= nArg {
|
||||
if i+hasArg >= nArg {
|
||||
break
|
||||
}
|
||||
z = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
|
||||
@ -6301,15 +6301,15 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
z++
|
||||
}
|
||||
if libc.Xstrcmp(tls, z, zOption) == 0 {
|
||||
if (hasArg != 0) && (i == (nArg - 1)) {
|
||||
if hasArg != 0 && i == nArg-1 {
|
||||
fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
|
||||
}
|
||||
if hasArg != 0 {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*8))
|
||||
} else {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
|
||||
}
|
||||
j = ((i + 1) + (libc.Bool32(hasArg != 0)))
|
||||
j = i + 1 + libc.Bool32(hasArg != 0)
|
||||
for j < nArg {
|
||||
*(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*8))
|
||||
}
|
||||
@ -6328,8 +6328,8 @@ func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
|
||||
var i int32
|
||||
var zTail uintptr = argv0
|
||||
for i = 0; *(*int8)(unsafe.Pointer(argv0 + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i))))) == '/' {
|
||||
zTail = ((argv0 + uintptr(i)) + uintptr(1))
|
||||
if int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i)))) == '/' {
|
||||
zTail = argv0 + uintptr(i) + uintptr(1)
|
||||
}
|
||||
}
|
||||
libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
|
||||
@ -6383,43 +6383,43 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + 1*8))
|
||||
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
|
||||
if strglob(tls, ts+2323, g.zDbFile) != 0 {
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */) != 0 {
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330) != 0 {
|
||||
libc.Xfprintf(tls, libc.Xstderr,
|
||||
|
||||
ts+2415, /* "SQLite library a..." */
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */))
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = argc - 2
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
if zNRep != 0 {
|
||||
nRep = libc.Xatoi(tls, zNRep)
|
||||
}
|
||||
if nRep < 1 {
|
||||
nRep = 1
|
||||
}
|
||||
g.zVfs = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
g.zVfs = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
if zTrace != 0 {
|
||||
g.iTrace = libc.Xatoi(tls, zTrace)
|
||||
}
|
||||
if findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
|
||||
if findOption(tls, argv+uintptr(2)*8, bp+232, ts+2534, 0) != uintptr(0) {
|
||||
g.iTrace = 0
|
||||
}
|
||||
zTmout = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
zTmout = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
if zTmout != 0 {
|
||||
iTmout = libc.Xatoi(tls, zTmout)
|
||||
}
|
||||
g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
|
||||
g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
|
||||
g.bSqlTrace = libc.Bool32(findOption(tls, argv+uintptr(2)*8, bp+232, ts+2548, 0) != uintptr(0))
|
||||
g.bSync = libc.Bool32(findOption(tls, argv+uintptr(2)*8, bp+232, ts+2557, 0) != uintptr(0))
|
||||
if g.zErrLog != 0 {
|
||||
g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
|
||||
} else {
|
||||
@ -6439,7 +6439,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
if iClient < 1 {
|
||||
fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2591, /* "%05d.client%02d" */
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64, ts+2591, /* "%05d.client%02d" */
|
||||
libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
|
||||
} else {
|
||||
var nTry int32 = 0
|
||||
@ -6450,14 +6450,14 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
libc.Xprintf(tls, ts+2617 /* "With SQLite 3.37..." */, 0)
|
||||
for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
|
||||
for i = 0; libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i)) != uintptr(0); i++ {
|
||||
libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
|
||||
}
|
||||
libc.Xfflush(tls, libc.Xstdout)
|
||||
}
|
||||
iClient = 0
|
||||
for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
|
||||
if (nTry % 5) == 4 {
|
||||
for ok := true; ok; ok = rc != 0 && libc.PreIncInt32(&nTry, 1) < 60 && sqlite3.Xsqlite3_sleep(tls, 1000) > 0 {
|
||||
if nTry%5 == 4 {
|
||||
libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
|
||||
libc.VaList(bp+88, func() uintptr {
|
||||
if nTry > 5 {
|
||||
@ -6467,7 +6467,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}(), g.zDbFile))
|
||||
}
|
||||
rc = libc.Xunlink(tls, g.zDbFile)
|
||||
if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT) {
|
||||
if rc != 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOENT {
|
||||
rc = 0
|
||||
}
|
||||
}
|
||||
@ -6475,9 +6475,9 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
fatalError(tls, ts+2771, /* "unable to unlink..." */
|
||||
libc.VaList(bp+104, g.zDbFile, nTry))
|
||||
}
|
||||
openFlags = openFlags | (SQLITE_OPEN_CREATE)
|
||||
openFlags = openFlags | SQLITE_OPEN_CREATE
|
||||
}
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 24 /* &.db */), openFlags, g.zVfs)
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, uintptr(unsafe.Pointer(&g))+24, openFlags, g.zVfs)
|
||||
if rc != 0 {
|
||||
fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
|
||||
}
|
||||
@ -6510,8 +6510,8 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}{sqlTraceCallback})), uintptr(0))
|
||||
}
|
||||
if iClient > 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*8)
|
||||
}
|
||||
if g.iTrace != 0 {
|
||||
logMessage(tls, ts+2889 /* "start-client" */, 0)
|
||||
@ -6539,11 +6539,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
} else {
|
||||
var pStmt uintptr
|
||||
var iTimeout int32
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) == 0 {
|
||||
fatalError(tls, ts+2939 /* "missing script f..." */, 0)
|
||||
}
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*8)
|
||||
}
|
||||
runSql(tls,
|
||||
|
||||
@ -6564,21 +6564,21 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
g.iTimeout = 0
|
||||
iTimeout = 1000
|
||||
for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == SQLITE_BUSY) ||
|
||||
(rc == SQLITE_ROW)) && (iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, trySql(tls, ts+3502, 0)) == SQLITE_BUSY ||
|
||||
rc == SQLITE_ROW) && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
|
||||
iTimeout = 1000
|
||||
for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) && (iTimeout > 0) {
|
||||
for libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
if rc == SQLITE_ROW {
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nError */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 116 /* &.nTest */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 0)
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 116)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 1)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
}
|
||||
@ -6593,7 +6593,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
}
|
||||
return (libc.Bool32(g.nError > 0))
|
||||
return libc.Bool32(g.nError > 0)
|
||||
}
|
||||
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
|
@ -5131,13 +5131,13 @@ func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
|
||||
bp := tls.Alloc(24)
|
||||
defer tls.Free(24)
|
||||
|
||||
for (zMsg != 0) && (*(*uint8)(unsafe.Pointer(zMsg)) != 0) {
|
||||
for zMsg != 0 && *(*uint8)(unsafe.Pointer(zMsg)) != 0 {
|
||||
var i int32
|
||||
for i = 0; ((*(*uint8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ {
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(zMsg + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n' && int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'; i++ {
|
||||
}
|
||||
libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
|
||||
zMsg += uintptr(i)
|
||||
for (int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\n') || (int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\r') {
|
||||
for int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\n' || int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\r' {
|
||||
zMsg++
|
||||
}
|
||||
}
|
||||
@ -5179,22 +5179,22 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
var invert int32
|
||||
var seen int32
|
||||
|
||||
for (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) != 0 {
|
||||
if c == '*' {
|
||||
for ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
|
||||
if (c == '?') && ((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) == '*' || c == '?' {
|
||||
if c == '?' && int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
if c == 0 {
|
||||
return 1
|
||||
} else if c == '[' {
|
||||
for (*(*uint8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
|
||||
for *(*uint8)(unsafe.Pointer(z)) != 0 && strglob(tls, zGlob-uintptr(1), z) != 0 {
|
||||
z++
|
||||
}
|
||||
return (libc.Bool32((int32(*(*uint8)(unsafe.Pointer(z)))) != 0))
|
||||
return libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z))) != 0)
|
||||
}
|
||||
for (libc.AssignInt32(&c2, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c2, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) != 0 {
|
||||
for c2 != c {
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
|
||||
if c2 == 0 {
|
||||
@ -5207,7 +5207,7 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
return 0
|
||||
} else if c == '?' {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
|
||||
if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '[' {
|
||||
@ -5229,10 +5229,10 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
for (c2 != 0) && (c2 != ']') {
|
||||
if (((c2 == '-') && (int32(*(*uint8)(unsafe.Pointer(zGlob))) != ']')) && (int32(*(*uint8)(unsafe.Pointer(zGlob))) != 0)) && (prior_c > 0) {
|
||||
for c2 != 0 && c2 != ']' {
|
||||
if c2 == '-' && int32(*(*uint8)(unsafe.Pointer(zGlob))) != ']' && int32(*(*uint8)(unsafe.Pointer(zGlob))) != 0 && prior_c > 0 {
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
if (c >= prior_c) && (c <= c2) {
|
||||
if c >= prior_c && c <= c2 {
|
||||
seen = 1
|
||||
}
|
||||
prior_c = 0
|
||||
@ -5244,32 +5244,32 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
if (c2 == 0) || ((seen ^ invert) == 0) {
|
||||
if c2 == 0 || seen^invert == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '#' {
|
||||
if ((int32(*(*uint8)(unsafe.Pointer(z))) == '-') || (int32(*(*uint8)(unsafe.Pointer(z))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + 1)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(z))) == '-' || int32(*(*uint8)(unsafe.Pointer(z))) == '+') && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + 1)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0) {
|
||||
return 0
|
||||
}
|
||||
z++
|
||||
for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0 {
|
||||
for int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
} else {
|
||||
if c != (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
|
||||
if c != int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
return (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z))) == 0))
|
||||
return libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z))) == 0)
|
||||
}
|
||||
|
||||
// Close output stream pOut if it is not stdout or stderr
|
||||
func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
|
||||
if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) {
|
||||
if pOut != libc.Xstdout && pOut != libc.Xstderr {
|
||||
libc.Xfclose(tls, pOut)
|
||||
}
|
||||
}
|
||||
@ -5287,12 +5287,12 @@ func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
}
|
||||
@ -5313,13 +5313,13 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
maybeClose(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
maybeClose(tls, g.pErrLog)
|
||||
@ -5328,8 +5328,8 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
if g.db != 0 {
|
||||
var nTry int32 = 0
|
||||
g.iTimeout = 0
|
||||
for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == SQLITE_BUSY) &&
|
||||
((libc.PostIncInt32(&nTry, 1)) < 100) {
|
||||
for trySql(tls, ts+30, 0) == SQLITE_BUSY &&
|
||||
libc.PostIncInt32(&nTry, 1) < 100 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
}
|
||||
}
|
||||
@ -5350,7 +5350,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
@ -5361,7 +5361,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
// Return the length of a string omitting trailing whitespace
|
||||
func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
|
||||
var n int32 = int32(libc.Xstrlen(tls, z))
|
||||
for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
for n > 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n-1))))))*2)))&int32(_ISspace) != 0 {
|
||||
n--
|
||||
}
|
||||
return n
|
||||
@ -5377,7 +5377,7 @@ func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
|
||||
_ = argc
|
||||
_ = argv
|
||||
sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, SQLITE_FCNTL_VFSNAME, bp /* &zVfs */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
|
||||
sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
|
||||
}
|
||||
}
|
||||
@ -5388,7 +5388,7 @@ func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:32
|
||||
defer tls.Free(8)
|
||||
|
||||
_ = pCD
|
||||
if (count * 10) > g.iTimeout {
|
||||
if count*10 > g.iTimeout {
|
||||
if g.iTimeout > 0 {
|
||||
errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
|
||||
}
|
||||
@ -5413,16 +5413,16 @@ func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr)
|
||||
defer tls.Free(24)
|
||||
|
||||
_ = pArg
|
||||
if (iErrCode == SQLITE_ERROR) && (g.bIgnoreSqlErrors != 0) {
|
||||
if iErrCode == SQLITE_ERROR && g.bIgnoreSqlErrors != 0 {
|
||||
return
|
||||
}
|
||||
if ((iErrCode & 0xff) == SQLITE_SCHEMA) && (g.iTrace < 3) {
|
||||
if iErrCode&0xff == SQLITE_SCHEMA && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if ((g.iTimeout == 0) && ((iErrCode & 0xff) == SQLITE_BUSY)) && (g.iTrace < 3) {
|
||||
if g.iTimeout == 0 && iErrCode&0xff == SQLITE_BUSY && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if (iErrCode & 0xff) == SQLITE_NOTICE {
|
||||
if iErrCode&0xff == SQLITE_NOTICE {
|
||||
logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
|
||||
} else {
|
||||
errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
|
||||
@ -5507,8 +5507,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
if n < 0 {
|
||||
n = int32(libc.Xstrlen(tls, z))
|
||||
}
|
||||
if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
|
||||
if (*String)(unsafe.Pointer(p)).n+n >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = (*String)(unsafe.Pointer(p)).nAlloc*2 + n + 100
|
||||
var zNew uintptr = sqlite3.Xsqlite3_realloc(tls, (*String)(unsafe.Pointer(p)).z, nAlloc)
|
||||
if zNew == uintptr(0) {
|
||||
fatalError(tls, ts+129 /* "out of memory" */, 0)
|
||||
@ -5516,8 +5516,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
(*String)(unsafe.Pointer(p)).z = zNew
|
||||
(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
|
||||
}
|
||||
libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint32(n))
|
||||
*(*int32)(unsafe.Pointer(p + 4 /* &.n */)) += (n)
|
||||
libc.Xmemcpy(tls, (*String)(unsafe.Pointer(p)).z+uintptr((*String)(unsafe.Pointer(p)).n), z, uint32(n))
|
||||
*(*int32)(unsafe.Pointer(p + 4)) += n
|
||||
*(*uint8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = uint8(0)
|
||||
}
|
||||
|
||||
@ -5540,20 +5540,20 @@ func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
|
||||
stringAppend(tls, p, ts+145 /* "nil" */, 3)
|
||||
return
|
||||
}
|
||||
for i = 0; (*(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 0 {
|
||||
stringAppend(tls, p, z, i)
|
||||
return
|
||||
}
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
for *(*uint8)(unsafe.Pointer(z)) != 0 {
|
||||
for i = 0; (*(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\''); i++ {
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\''; i++ {
|
||||
}
|
||||
if *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 {
|
||||
stringAppend(tls, p, z, (i + 1))
|
||||
stringAppend(tls, p, z, i+1)
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
z += (uintptr(i + 1))
|
||||
z += uintptr(i + 1)
|
||||
} else {
|
||||
stringAppend(tls, p, z, i)
|
||||
break
|
||||
@ -5597,7 +5597,7 @@ func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* m
|
||||
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+12 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
|
||||
stringAppendTerm(tls, p, bp+12 /* &zErr[0] */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
|
||||
stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
}
|
||||
@ -5621,7 +5621,7 @@ func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mpt
|
||||
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
|
||||
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
|
||||
}{evalCallback})), bp /* &res */, bp+12 /* &zErrMsg */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 {
|
||||
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)), -1)
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)))
|
||||
} else if rc != 0 {
|
||||
@ -5650,13 +5650,13 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0)
|
||||
if rc == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
continue
|
||||
}
|
||||
if rc != SQLITE_OK {
|
||||
fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
}
|
||||
if (g.nError != 0) || (g.nTest != 0) {
|
||||
if g.nError != 0 || g.nTest != 0 {
|
||||
runSql(tls, ts+196, /* "UPDATE counters ..." */
|
||||
libc.VaList(bp+8, g.nError, g.nTest))
|
||||
g.nError = 0
|
||||
@ -5677,7 +5677,7 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if rc == SQLITE_ROW {
|
||||
var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, n+1)
|
||||
libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
|
||||
@ -5697,12 +5697,12 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
for trySql(tls, ts+613 /* "COMMIT" */, 0) == SQLITE_BUSY {
|
||||
for trySql(tls, ts+613, 0) == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
totalTime = totalTime + (100)
|
||||
totalTime = totalTime + 100
|
||||
continue
|
||||
}
|
||||
fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
@ -5774,7 +5774,7 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
libc.Xfseek(tls, in, 0, SEEK_END)
|
||||
sz = libc.Xftell(tls, in)
|
||||
libc.Xrewind(tls, in)
|
||||
z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + 1)))
|
||||
z = sqlite3.Xsqlite3_malloc(tls, int32(sz+1))
|
||||
sz = int32(libc.Xfread(tls, z, uint32(1), uint32(sz), in))
|
||||
*(*uint8)(unsafe.Pointer(z + uintptr(sz))) = uint8(0)
|
||||
libc.Xfclose(tls, in)
|
||||
@ -5784,24 +5784,24 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
// Return the length of the next token.
|
||||
func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
|
||||
var n int32 = 0
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*uint8)(unsafe.Pointer(z))) == '/') && (int32(*(*uint8)(unsafe.Pointer(z + 1))) == '*')) {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2)))&int32(_ISspace) != 0 || int32(*(*uint8)(unsafe.Pointer(z))) == '/' && int32(*(*uint8)(unsafe.Pointer(z + 1))) == '*' {
|
||||
var inC int32 = 0
|
||||
var c int32
|
||||
if int32(*(*uint8)(unsafe.Pointer(z))) == '/' {
|
||||
inC = 1
|
||||
n = 2
|
||||
}
|
||||
for (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1)))))) != 0 {
|
||||
if c == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 {
|
||||
continue
|
||||
}
|
||||
if ((inC != 0) && (c == '*')) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
|
||||
if inC != 0 && c == '*' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '/' {
|
||||
n++
|
||||
inC = 0
|
||||
} else if (!(inC != 0) && (c == '/')) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '*') {
|
||||
} else if !(inC != 0) && c == '/' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '*' {
|
||||
n++
|
||||
inC = 1
|
||||
} else if !(inC != 0) {
|
||||
@ -5809,29 +5809,29 @@ func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:7
|
||||
}
|
||||
}
|
||||
n--
|
||||
} else if (int32(*(*uint8)(unsafe.Pointer(z))) == '-') && (int32(*(*uint8)(unsafe.Pointer(z + 1))) == '-') {
|
||||
for n = 2; (*(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != '\n'); n++ {
|
||||
} else if int32(*(*uint8)(unsafe.Pointer(z))) == '-' && int32(*(*uint8)(unsafe.Pointer(z + 1))) == '-' {
|
||||
for n = 2; *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != '\n'; n++ {
|
||||
}
|
||||
if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
n++
|
||||
}
|
||||
} else if (int32(*(*uint8)(unsafe.Pointer(z))) == '"') || (int32(*(*uint8)(unsafe.Pointer(z))) == '\'') {
|
||||
} else if int32(*(*uint8)(unsafe.Pointer(z))) == '"' || int32(*(*uint8)(unsafe.Pointer(z))) == '\'' {
|
||||
var delim int32 = int32(*(*uint8)(unsafe.Pointer(z)))
|
||||
for n = 1; *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0; n++ {
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == delim {
|
||||
n++
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr((n + 1))))) != delim {
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(n+1)))) != delim {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var c int32
|
||||
for n = 1; (((((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
|
||||
for n = 1; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(n))))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0) && c != '"' && c != '\'' && c != ';'; n++ {
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5844,7 +5844,7 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
*(*uint8)(unsafe.Pointer(zOut)) = uint8(0)
|
||||
return 0
|
||||
}
|
||||
for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; i < nIn && i < nOut-1 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
*(*uint8)(unsafe.Pointer(zOut + uintptr(i))) = *(*uint8)(unsafe.Pointer(zIn + uintptr(i)))
|
||||
}
|
||||
*(*uint8)(unsafe.Pointer(zOut + uintptr(i))) = uint8(0)
|
||||
@ -5854,8 +5854,8 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
// Find the number of characters up to the start of the next "--end" token.
|
||||
func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
|
||||
var n int32 = 0
|
||||
for (*(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint32(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
|
||||
for *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 && (libc.Xstrncmp(tls, z+uintptr(n), ts+896, uint32(5)) != 0 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+5))))))*2)))&int32(_ISspace) != 0)) {
|
||||
n = n + tokenLength(tls, z+uintptr(n), pnLine)
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -5866,16 +5866,16 @@ func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:1
|
||||
func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
|
||||
var n int32 = 0
|
||||
for *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
|
||||
if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint32(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
|
||||
(((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint32(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
return (n + len)
|
||||
var len int32 = tokenLength(tls, z+uintptr(n), pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+902, uint32(7)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+7))))))*2)))&int32(_ISspace) != 0 ||
|
||||
stopAtElse != 0 && libc.Xstrncmp(tls, z+uintptr(n), ts+910, uint32(6)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+6))))))*2)))&int32(_ISspace) != 0 {
|
||||
return n + len
|
||||
}
|
||||
if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint32(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+917, uint32(4)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+4))))))*2)))&int32(_ISspace) != 0 {
|
||||
var skip int32 = findEndif(tls, z+uintptr(n)+uintptr(len), 0, pnLine)
|
||||
n = n + (skip + len)
|
||||
} else {
|
||||
n = n + (len)
|
||||
n = n + len
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5899,11 +5899,11 @@ func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uint
|
||||
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
|
||||
}
|
||||
g.iTimeout = 0
|
||||
for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) || (rc == SQLITE_ROW)) &&
|
||||
(iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY || rc == SQLITE_ROW) &&
|
||||
iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_reset(tls, pStmt)
|
||||
sqlite3.Xsqlite3_sleep(tls, 50)
|
||||
iTimeout = iTimeout - (50)
|
||||
iTimeout = iTimeout - 50
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
g.iTimeout = DEFAULT_TIMEOUT
|
||||
@ -5924,11 +5924,11 @@ func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
|
||||
var i int32
|
||||
var j int32
|
||||
for i = libc.AssignInt32(&j, 0); *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
|
||||
j = (i + 1)
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == '/' {
|
||||
j = i + 1
|
||||
}
|
||||
}
|
||||
return (z + uintptr(j))
|
||||
return z + uintptr(j)
|
||||
}
|
||||
|
||||
// Interpret zArg as a boolean value. Return either 0 or 1.
|
||||
@ -5940,15 +5940,15 @@ func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
|
||||
if zArg == uintptr(0) {
|
||||
return 0
|
||||
}
|
||||
for i = 0; (int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
|
||||
for i = 0; int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0' && int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'; i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) == 0 {
|
||||
return libc.Xatoi(tls, zArg)
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169) == 0 {
|
||||
return 1
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177) == 0 {
|
||||
return 0
|
||||
}
|
||||
errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
|
||||
@ -5989,58 +5989,58 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
|
||||
libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint32(unsafe.Sizeof(String{})))
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
for (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii))))) != 0 {
|
||||
prevLine = *(*int32)(unsafe.Pointer(bp + 372 /* lineno */))
|
||||
len = tokenLength(tls, (zScript + uintptr(ii)), bp+372 /* &lineno */)
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
|
||||
ii = ii + (len)
|
||||
len = tokenLength(tls, zScript+uintptr(ii), bp+372 /* &lineno */)
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 || c == '/' && int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+1)))) == '*' {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
if ((c != '-') || (int32(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
|
||||
ii = ii + (len)
|
||||
if c != '-' || int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+1)))) != '-' || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+2)))))*2)))&int32(_ISalpha) != 0) {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
|
||||
// Run any prior SQL before processing the new --command
|
||||
if ii > iBegin {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
iBegin = (ii + len)
|
||||
iBegin = ii + len
|
||||
}
|
||||
|
||||
// Parse the --command
|
||||
if g.iTrace >= 2 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, zScript+uintptr(ii)))
|
||||
}
|
||||
n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+376 /* &zCmd[0] */, int32(unsafe.Sizeof([30]uint8{})))
|
||||
for nArg = 0; (n < (len - 2)) && (nArg < MX_ARG); nArg++ {
|
||||
for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
n = extractToken(tls, zScript+uintptr(ii)+uintptr(2), len-2, bp+376 /* &zCmd[0] */, int32(unsafe.Sizeof([30]uint8{})))
|
||||
for nArg = 0; n < len-2 && nArg < MX_ARG; nArg++ {
|
||||
for n < len-2 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+2+n))))))*2)))&int32(_ISspace) != 0 {
|
||||
n++
|
||||
}
|
||||
if n >= (len - 2) {
|
||||
if n >= len-2 {
|
||||
break
|
||||
}
|
||||
n = n + (extractToken(tls, (((zScript + uintptr(ii)) + uintptr(2)) + uintptr(n)), ((len - 2) - n),
|
||||
(bp + 406 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]uint8{}))))
|
||||
n = n + extractToken(tls, zScript+uintptr(ii)+uintptr(2)+uintptr(n), len-2-n,
|
||||
bp+406+uintptr(nArg)*100, int32(unsafe.Sizeof([100]uint8{})))
|
||||
}
|
||||
for j = nArg; j < MX_ARG; j++ {
|
||||
*(*uint8)(unsafe.Pointer((bp + 406 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100))) = uint8(0)
|
||||
*(*uint8)(unsafe.Pointer(bp + 406 + uintptr(libc.PostIncInt32(&j, 1))*100)) = uint8(0)
|
||||
}
|
||||
|
||||
// --sleep N
|
||||
//
|
||||
// Pause for N milliseconds
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+406 /* &azArg[0] */)))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1207) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, bp+406))
|
||||
} else
|
||||
|
||||
// --exit N
|
||||
//
|
||||
// Exit this process. If N>0 then exit without shutting down
|
||||
// SQLite. (In other words, simulate a crash.)
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1213) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, bp+406)
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
if rc == 0 {
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
@ -6052,9 +6052,9 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Begin a new test case. Announce in the log that the test case
|
||||
// has begun.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1218) == 0 {
|
||||
if g.iTrace == 1 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, len-1, zScript+uintptr(ii)))
|
||||
}
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
@ -6063,29 +6063,29 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Mark the current task as having finished, even if it is not.
|
||||
// This can be used in conjunction with --exit to simulate a crash.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1227) == 0 && iClient > 0 {
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
} else
|
||||
|
||||
// --reset
|
||||
//
|
||||
// Reset accumulated results back to an empty string
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1234) == 0 {
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
|
||||
// --match ANSWER...
|
||||
//
|
||||
// Check to see if output matches ANSWER. Report an error if not.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1240) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
for jj = 7; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint32((len-jj)-1))) != 0) {
|
||||
if len-jj-1 != (*String)(unsafe.Pointer(bp+360)).n || libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360)).z, zAns, uint32(len-jj-1)) != 0 {
|
||||
errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
libc.VaList(bp+48, prevLine, zFilename, len-jj-1, zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
g.nTest++
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
@ -6096,16 +6096,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Check to see if output does or does not match the glob pattern
|
||||
// ANSWER.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1291) == 0 || libc.Xstrcmp(tls, bp+376, ts+1296) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
var zCopy uintptr
|
||||
var isGlob int32 = (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(bp + 376 /* &zCmd[0] */))) == 'g'))
|
||||
for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var isGlob int32 = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(bp + 376))) == 'g')
|
||||
for jj = 9 - 3*isGlob; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
|
||||
if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, len-jj-1, zAns))
|
||||
if libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360)).z) == 0)^isGlob != 0 {
|
||||
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
@ -6117,21 +6117,21 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --output
|
||||
//
|
||||
// Output the result of the previous SQL.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1347) == 0 {
|
||||
logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
} else
|
||||
|
||||
// --source FILENAME
|
||||
//
|
||||
// Run a subscript from a separate file.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1354) == 0 {
|
||||
var zNewFile uintptr
|
||||
var zNewScript uintptr
|
||||
var zToDel uintptr = uintptr(0)
|
||||
zNewFile = (bp + 406 /* &azArg[0] */)
|
||||
if !((int32(*(*uint8)(unsafe.Pointer(zNewFile)))) == '/') {
|
||||
zNewFile = bp + 406
|
||||
if !(int32(*(*uint8)(unsafe.Pointer(zNewFile))) == '/') {
|
||||
var k int32
|
||||
for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*uint8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
|
||||
for k = int32(libc.Xstrlen(tls, zFilename)) - 1; k >= 0 && !(int32(*(*uint8)(unsafe.Pointer(zFilename + uintptr(k)))) == '/'); k-- {
|
||||
}
|
||||
if k > 0 {
|
||||
zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
|
||||
@ -6152,26 +6152,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --print MESSAGE....
|
||||
//
|
||||
// Output the remainder of the line to the log file
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1405) == 0 {
|
||||
var jj int32
|
||||
for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 7; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
} else
|
||||
|
||||
// --if EXPR
|
||||
//
|
||||
// Skip forward to the next matching --endif or --else if EXPR is false.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1411) == 0 {
|
||||
var jj int32
|
||||
var rc int32
|
||||
var pStmt uintptr
|
||||
for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 4; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if (rc != SQLITE_ROW) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+372 /* &lineno */))
|
||||
if rc != SQLITE_ROW || sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 1, bp+372)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
} else
|
||||
@ -6180,23 +6180,23 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true. Skip forward to the next matching --endif.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+372 /* &lineno */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1426) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 0, bp+372)
|
||||
} else
|
||||
|
||||
// --endif
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true or an --else of a false if. This is a no-op.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1431) == 0 {
|
||||
// no-op
|
||||
} else
|
||||
|
||||
// --start CLIENT
|
||||
//
|
||||
// Start up the given client.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
|
||||
var iNewClient int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1437) == 0 && iClient == 0 {
|
||||
var iNewClient int32 = libc.Xatoi(tls, bp+406)
|
||||
if iNewClient > 0 {
|
||||
startClient(tls, iNewClient)
|
||||
}
|
||||
@ -6207,16 +6207,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// Wait until all tasks complete for the given client. If CLIENT is
|
||||
// "all" then wait for all clients to complete. Wait no longer than
|
||||
// TIMEOUT milliseconds (default 10,000)
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1443) == 0 && iClient == 0 {
|
||||
var iTimeout int32
|
||||
if nArg >= 2 {
|
||||
iTimeout = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */ + 1*100))
|
||||
iTimeout = libc.Xatoi(tls, bp+406+1*100)
|
||||
} else {
|
||||
iTimeout = 10000
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]uint8{})), bp+606 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
|
||||
libc.VaList(bp+216, prevLine, zFilename))
|
||||
waitForClient(tls, libc.Xatoi(tls, (bp+406 /* &azArg[0] */)), iTimeout, bp+606 /* &zError[0] */)
|
||||
waitForClient(tls, libc.Xatoi(tls, bp+406), iTimeout, bp+606 /* &zError[0] */)
|
||||
} else
|
||||
|
||||
// --task CLIENT
|
||||
@ -6225,19 +6225,19 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Assign work to a client. Start the client if it is not running
|
||||
// already.
|
||||
if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
|
||||
var iTarget int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1463) == 0 && iClient == 0 {
|
||||
var iTarget int32 = libc.Xatoi(tls, bp+406)
|
||||
var iEnd int32
|
||||
var zTask uintptr
|
||||
var zTName uintptr
|
||||
iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+372 /* &lineno */)
|
||||
iEnd = findEnd(tls, zScript+uintptr(ii)+uintptr(len), bp+372 /* &lineno */)
|
||||
if iTarget < 0 {
|
||||
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
|
||||
libc.VaList(bp+232, prevLine, zFilename, iTarget))
|
||||
} else {
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, zScript+uintptr(ii)+uintptr(len)))
|
||||
if nArg > 1 {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+406 /* &azArg[0] */ +1*100)))
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, bp+406+1*100))
|
||||
} else {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
|
||||
}
|
||||
@ -6247,26 +6247,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
sqlite3.Xsqlite3_free(tls, zTask)
|
||||
sqlite3.Xsqlite3_free(tls, zTName)
|
||||
}
|
||||
iEnd = iEnd + (tokenLength(tls, (((zScript + uintptr(ii)) + uintptr(len)) + uintptr(iEnd)), bp+372 /* &lineno */))
|
||||
len = len + (iEnd)
|
||||
iBegin = (ii + len)
|
||||
iEnd = iEnd + tokenLength(tls, zScript+uintptr(ii)+uintptr(len)+uintptr(iEnd), bp+372)
|
||||
len = len + iEnd
|
||||
iBegin = ii + len
|
||||
} else
|
||||
|
||||
// --breakpoint
|
||||
//
|
||||
// This command calls "test_breakpoint()" which is a routine provided
|
||||
// as a convenient place to set a debugger breakpoint.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1567) == 0 {
|
||||
test_breakpoint(tls)
|
||||
} else
|
||||
|
||||
// --show-sql-errors BOOLEAN
|
||||
//
|
||||
// Turn display of SQL errors on and off.
|
||||
if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+376, ts+1578) == 0 {
|
||||
g.bIgnoreSqlErrors = func() int32 {
|
||||
if nArg >= 1 {
|
||||
return libc.BoolInt32(!(booleanValue(tls, (bp+406 /* &azArg[0] */)) != 0))
|
||||
return libc.BoolInt32(!(booleanValue(tls, bp+406) != 0))
|
||||
}
|
||||
return 1
|
||||
}()
|
||||
@ -6274,10 +6274,10 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
|
||||
libc.VaList(bp+320, prevLine, zFilename, bp+376 /* &zCmd[0] */))
|
||||
}
|
||||
ii = ii + (len)
|
||||
ii = ii + len
|
||||
}
|
||||
if iBegin < ii {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
runSql(tls, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
}
|
||||
@ -6301,7 +6301,7 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
|
||||
for i = 0; i < nArg; i++ {
|
||||
var z uintptr
|
||||
if (i + hasArg) >= nArg {
|
||||
if i+hasArg >= nArg {
|
||||
break
|
||||
}
|
||||
z = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4))
|
||||
@ -6316,15 +6316,15 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
z++
|
||||
}
|
||||
if libc.Xstrcmp(tls, z, zOption) == 0 {
|
||||
if (hasArg != 0) && (i == (nArg - 1)) {
|
||||
if hasArg != 0 && i == nArg-1 {
|
||||
fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
|
||||
}
|
||||
if hasArg != 0 {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*4))
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*4))
|
||||
} else {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4))
|
||||
}
|
||||
j = ((i + 1) + (libc.Bool32(hasArg != 0)))
|
||||
j = i + 1 + libc.Bool32(hasArg != 0)
|
||||
for j < nArg {
|
||||
*(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*4)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*4))
|
||||
}
|
||||
@ -6343,8 +6343,8 @@ func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
|
||||
var i int32
|
||||
var zTail uintptr = argv0
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(argv0 + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(argv0 + uintptr(i))))) == '/' {
|
||||
zTail = ((argv0 + uintptr(i)) + uintptr(1))
|
||||
if int32(*(*uint8)(unsafe.Pointer(argv0 + uintptr(i)))) == '/' {
|
||||
zTail = argv0 + uintptr(i) + uintptr(1)
|
||||
}
|
||||
}
|
||||
libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
|
||||
@ -6398,43 +6398,43 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + 1*4))
|
||||
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
|
||||
if strglob(tls, ts+2323, g.zDbFile) != 0 {
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */) != 0 {
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330) != 0 {
|
||||
libc.Xfprintf(tls, libc.Xstderr,
|
||||
|
||||
ts+2415, /* "SQLite library a..." */
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */))
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+32 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = argc - 2
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+32, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
if zNRep != 0 {
|
||||
nRep = libc.Xatoi(tls, zNRep)
|
||||
}
|
||||
if nRep < 1 {
|
||||
nRep = 1
|
||||
}
|
||||
g.zVfs = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
g.zVfs = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
if zTrace != 0 {
|
||||
g.iTrace = libc.Xatoi(tls, zTrace)
|
||||
}
|
||||
if findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
|
||||
if findOption(tls, argv+uintptr(2)*4, bp+232, ts+2534, 0) != uintptr(0) {
|
||||
g.iTrace = 0
|
||||
}
|
||||
zTmout = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
zTmout = findOption(tls, argv+uintptr(2)*4, bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
if zTmout != 0 {
|
||||
iTmout = libc.Xatoi(tls, zTmout)
|
||||
}
|
||||
g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
|
||||
g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
|
||||
g.bSqlTrace = libc.Bool32(findOption(tls, argv+uintptr(2)*4, bp+232, ts+2548, 0) != uintptr(0))
|
||||
g.bSync = libc.Bool32(findOption(tls, argv+uintptr(2)*4, bp+232, ts+2557, 0) != uintptr(0))
|
||||
if g.zErrLog != 0 {
|
||||
g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
|
||||
} else {
|
||||
@ -6454,7 +6454,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
if iClient < 1 {
|
||||
fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+32 /* &.zName */, ts+2591, /* "%05d.client%02d" */
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+32, ts+2591, /* "%05d.client%02d" */
|
||||
libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
|
||||
} else {
|
||||
var nTry int32 = 0
|
||||
@ -6465,14 +6465,14 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
libc.Xprintf(tls, ts+2617 /* "With SQLite 3.37..." */, 0)
|
||||
for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
|
||||
for i = 0; libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i)) != uintptr(0); i++ {
|
||||
libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
|
||||
}
|
||||
libc.Xfflush(tls, libc.Xstdout)
|
||||
}
|
||||
iClient = 0
|
||||
for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
|
||||
if (nTry % 5) == 4 {
|
||||
for ok := true; ok; ok = rc != 0 && libc.PreIncInt32(&nTry, 1) < 60 && sqlite3.Xsqlite3_sleep(tls, 1000) > 0 {
|
||||
if nTry%5 == 4 {
|
||||
libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
|
||||
libc.VaList(bp+88, func() uintptr {
|
||||
if nTry > 5 {
|
||||
@ -6482,7 +6482,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}(), g.zDbFile))
|
||||
}
|
||||
rc = libc.Xunlink(tls, g.zDbFile)
|
||||
if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT) {
|
||||
if rc != 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOENT {
|
||||
rc = 0
|
||||
}
|
||||
}
|
||||
@ -6490,9 +6490,9 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
fatalError(tls, ts+2771, /* "unable to unlink..." */
|
||||
libc.VaList(bp+104, g.zDbFile, nTry))
|
||||
}
|
||||
openFlags = openFlags | (SQLITE_OPEN_CREATE)
|
||||
openFlags = openFlags | SQLITE_OPEN_CREATE
|
||||
}
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 12 /* &.db */), openFlags, g.zVfs)
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, uintptr(unsafe.Pointer(&g))+12, openFlags, g.zVfs)
|
||||
if rc != 0 {
|
||||
fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
|
||||
}
|
||||
@ -6525,8 +6525,8 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}{sqlTraceCallback})), uintptr(0))
|
||||
}
|
||||
if iClient > 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*4))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*4)
|
||||
}
|
||||
if g.iTrace != 0 {
|
||||
logMessage(tls, ts+2889 /* "start-client" */, 0)
|
||||
@ -6554,11 +6554,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
} else {
|
||||
var pStmt uintptr
|
||||
var iTimeout int32
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) == 0 {
|
||||
fatalError(tls, ts+2939 /* "missing script f..." */, 0)
|
||||
}
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*4))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*4)
|
||||
}
|
||||
runSql(tls,
|
||||
|
||||
@ -6579,21 +6579,21 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
g.iTimeout = 0
|
||||
iTimeout = 1000
|
||||
for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == SQLITE_BUSY) ||
|
||||
(rc == SQLITE_ROW)) && (iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, trySql(tls, ts+3502, 0)) == SQLITE_BUSY ||
|
||||
rc == SQLITE_ROW) && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
|
||||
iTimeout = 1000
|
||||
for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) && (iTimeout > 0) {
|
||||
for libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
if rc == SQLITE_ROW {
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 80 /* &.nError */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 84 /* &.nTest */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 80)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 0)
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 84)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 1)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
}
|
||||
@ -6608,7 +6608,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
}
|
||||
return (libc.Bool32(g.nError > 0))
|
||||
return libc.Bool32(g.nError > 0)
|
||||
}
|
||||
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
|
@ -5157,13 +5157,13 @@ func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
|
||||
bp := tls.Alloc(24)
|
||||
defer tls.Free(24)
|
||||
|
||||
for (zMsg != 0) && (*(*uint8)(unsafe.Pointer(zMsg)) != 0) {
|
||||
for zMsg != 0 && *(*uint8)(unsafe.Pointer(zMsg)) != 0 {
|
||||
var i int32
|
||||
for i = 0; ((*(*uint8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ {
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(zMsg + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n' && int32(*(*uint8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'; i++ {
|
||||
}
|
||||
libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
|
||||
zMsg += uintptr(i)
|
||||
for (int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\n') || (int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\r') {
|
||||
for int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\n' || int32(*(*uint8)(unsafe.Pointer(zMsg))) == '\r' {
|
||||
zMsg++
|
||||
}
|
||||
}
|
||||
@ -5205,22 +5205,22 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
var invert int32
|
||||
var seen int32
|
||||
|
||||
for (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) != 0 {
|
||||
if c == '*' {
|
||||
for ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
|
||||
if (c == '?') && ((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))) == '*' || c == '?' {
|
||||
if c == '?' && int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
if c == 0 {
|
||||
return 1
|
||||
} else if c == '[' {
|
||||
for (*(*uint8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
|
||||
for *(*uint8)(unsafe.Pointer(z)) != 0 && strglob(tls, zGlob-uintptr(1), z) != 0 {
|
||||
z++
|
||||
}
|
||||
return (libc.Bool32((int32(*(*uint8)(unsafe.Pointer(z)))) != 0))
|
||||
return libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z))) != 0)
|
||||
}
|
||||
for (libc.AssignInt32(&c2, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
|
||||
for libc.AssignInt32(&c2, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) != 0 {
|
||||
for c2 != c {
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
|
||||
if c2 == 0 {
|
||||
@ -5233,7 +5233,7 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
return 0
|
||||
} else if c == '?' {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
|
||||
if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '[' {
|
||||
@ -5255,10 +5255,10 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
for (c2 != 0) && (c2 != ']') {
|
||||
if (((c2 == '-') && (int32(*(*uint8)(unsafe.Pointer(zGlob))) != ']')) && (int32(*(*uint8)(unsafe.Pointer(zGlob))) != 0)) && (prior_c > 0) {
|
||||
for c2 != 0 && c2 != ']' {
|
||||
if c2 == '-' && int32(*(*uint8)(unsafe.Pointer(zGlob))) != ']' && int32(*(*uint8)(unsafe.Pointer(zGlob))) != 0 && prior_c > 0 {
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
if (c >= prior_c) && (c <= c2) {
|
||||
if c >= prior_c && c <= c2 {
|
||||
seen = 1
|
||||
}
|
||||
prior_c = 0
|
||||
@ -5270,32 +5270,32 @@ func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
|
||||
}
|
||||
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
|
||||
}
|
||||
if (c2 == 0) || ((seen ^ invert) == 0) {
|
||||
if c2 == 0 || seen^invert == 0 {
|
||||
return 0
|
||||
}
|
||||
} else if c == '#' {
|
||||
if ((int32(*(*uint8)(unsafe.Pointer(z))) == '-') || (int32(*(*uint8)(unsafe.Pointer(z))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + 1)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(z))) == '-' || int32(*(*uint8)(unsafe.Pointer(z))) == '+') && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + 1)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0) {
|
||||
if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0) {
|
||||
return 0
|
||||
}
|
||||
z++
|
||||
for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0 {
|
||||
for int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2)))&int32(_ISdigit) != 0 {
|
||||
z++
|
||||
}
|
||||
} else {
|
||||
if c != (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
|
||||
if c != int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
return (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z))) == 0))
|
||||
return libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z))) == 0)
|
||||
}
|
||||
|
||||
// Close output stream pOut if it is not stdout or stderr
|
||||
func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
|
||||
if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) {
|
||||
if pOut != libc.Xstdout && pOut != libc.Xstderr {
|
||||
libc.Xfclose(tls, pOut)
|
||||
}
|
||||
}
|
||||
@ -5313,12 +5313,12 @@ func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
}
|
||||
@ -5339,13 +5339,13 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
maybeClose(tls, g.pLog)
|
||||
}
|
||||
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
|
||||
if g.pErrLog != 0 && safe_strcmp(tls, g.zErrLog, g.zLog) != 0 {
|
||||
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pErrLog)
|
||||
maybeClose(tls, g.pErrLog)
|
||||
@ -5354,8 +5354,8 @@ func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13
|
||||
if g.db != 0 {
|
||||
var nTry int32 = 0
|
||||
g.iTimeout = 0
|
||||
for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == SQLITE_BUSY) &&
|
||||
((libc.PostIncInt32(&nTry, 1)) < 100) {
|
||||
for trySql(tls, ts+30, 0) == SQLITE_BUSY &&
|
||||
libc.PostIncInt32(&nTry, 1) < 100 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
}
|
||||
}
|
||||
@ -5376,7 +5376,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
ap = va
|
||||
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
|
||||
_ = ap
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64))
|
||||
if g.pLog != 0 {
|
||||
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
|
||||
libc.Xfflush(tls, g.pLog)
|
||||
@ -5387,7 +5387,7 @@ func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13
|
||||
// Return the length of a string omitting trailing whitespace
|
||||
func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
|
||||
var n int32 = int32(libc.Xstrlen(tls, z))
|
||||
for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
for n > 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n-1))))))*2)))&int32(_ISspace) != 0 {
|
||||
n--
|
||||
}
|
||||
return n
|
||||
@ -5403,7 +5403,7 @@ func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
|
||||
_ = argc
|
||||
_ = argv
|
||||
sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, SQLITE_FCNTL_VFSNAME, bp /* &zVfs */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
|
||||
sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
|
||||
}
|
||||
}
|
||||
@ -5414,7 +5414,7 @@ func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:32
|
||||
defer tls.Free(8)
|
||||
|
||||
_ = pCD
|
||||
if (count * 10) > g.iTimeout {
|
||||
if count*10 > g.iTimeout {
|
||||
if g.iTimeout > 0 {
|
||||
errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
|
||||
}
|
||||
@ -5439,16 +5439,16 @@ func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr)
|
||||
defer tls.Free(24)
|
||||
|
||||
_ = pArg
|
||||
if (iErrCode == SQLITE_ERROR) && (g.bIgnoreSqlErrors != 0) {
|
||||
if iErrCode == SQLITE_ERROR && g.bIgnoreSqlErrors != 0 {
|
||||
return
|
||||
}
|
||||
if ((iErrCode & 0xff) == SQLITE_SCHEMA) && (g.iTrace < 3) {
|
||||
if iErrCode&0xff == SQLITE_SCHEMA && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if ((g.iTimeout == 0) && ((iErrCode & 0xff) == SQLITE_BUSY)) && (g.iTrace < 3) {
|
||||
if g.iTimeout == 0 && iErrCode&0xff == SQLITE_BUSY && g.iTrace < 3 {
|
||||
return
|
||||
}
|
||||
if (iErrCode & 0xff) == SQLITE_NOTICE {
|
||||
if iErrCode&0xff == SQLITE_NOTICE {
|
||||
logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
|
||||
} else {
|
||||
errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
|
||||
@ -5533,8 +5533,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
if n < 0 {
|
||||
n = int32(libc.Xstrlen(tls, z))
|
||||
}
|
||||
if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
|
||||
if (*String)(unsafe.Pointer(p)).n+n >= (*String)(unsafe.Pointer(p)).nAlloc {
|
||||
var nAlloc int32 = (*String)(unsafe.Pointer(p)).nAlloc*2 + n + 100
|
||||
var zNew uintptr = sqlite3.Xsqlite3_realloc(tls, (*String)(unsafe.Pointer(p)).z, nAlloc)
|
||||
if zNew == uintptr(0) {
|
||||
fatalError(tls, ts+129 /* "out of memory" */, 0)
|
||||
@ -5542,8 +5542,8 @@ func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:42
|
||||
(*String)(unsafe.Pointer(p)).z = zNew
|
||||
(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
|
||||
}
|
||||
libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n))
|
||||
*(*int32)(unsafe.Pointer(p + 8 /* &.n */)) += (n)
|
||||
libc.Xmemcpy(tls, (*String)(unsafe.Pointer(p)).z+uintptr((*String)(unsafe.Pointer(p)).n), z, uint64(n))
|
||||
*(*int32)(unsafe.Pointer(p + 8)) += n
|
||||
*(*uint8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = uint8(0)
|
||||
}
|
||||
|
||||
@ -5566,20 +5566,20 @@ func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
|
||||
stringAppend(tls, p, ts+145 /* "nil" */, 3)
|
||||
return
|
||||
}
|
||||
for i = 0; (*(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 0 {
|
||||
stringAppend(tls, p, z, i)
|
||||
return
|
||||
}
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
for *(*uint8)(unsafe.Pointer(z)) != 0 {
|
||||
for i = 0; (*(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\''); i++ {
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\''; i++ {
|
||||
}
|
||||
if *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 {
|
||||
stringAppend(tls, p, z, (i + 1))
|
||||
stringAppend(tls, p, z, i+1)
|
||||
stringAppend(tls, p, ts+149 /* "'" */, 1)
|
||||
z += (uintptr(i + 1))
|
||||
z += uintptr(i + 1)
|
||||
} else {
|
||||
stringAppend(tls, p, z, i)
|
||||
break
|
||||
@ -5623,7 +5623,7 @@ func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* m
|
||||
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]uint8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
|
||||
stringAppendTerm(tls, p, bp+16 /* &zErr[0] */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
|
||||
stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
|
||||
}
|
||||
@ -5647,7 +5647,7 @@ func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mpt
|
||||
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
|
||||
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
|
||||
}{evalCallback})), bp /* &res */, bp+16 /* &zErrMsg */)
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) != 0 {
|
||||
if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
|
||||
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)), -1)
|
||||
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)))
|
||||
} else if rc != 0 {
|
||||
@ -5676,13 +5676,13 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0)
|
||||
if rc == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
continue
|
||||
}
|
||||
if rc != SQLITE_OK {
|
||||
fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
}
|
||||
if (g.nError != 0) || (g.nTest != 0) {
|
||||
if g.nError != 0 || g.nTest != 0 {
|
||||
runSql(tls, ts+196, /* "UPDATE counters ..." */
|
||||
libc.VaList(bp+8, g.nError, g.nTest))
|
||||
g.nError = 0
|
||||
@ -5703,7 +5703,7 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if rc == SQLITE_ROW {
|
||||
var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, n+1)
|
||||
libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
|
||||
@ -5723,12 +5723,12 @@ func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
for trySql(tls, ts+613 /* "COMMIT" */, 0) == SQLITE_BUSY {
|
||||
for trySql(tls, ts+613, 0) == SQLITE_BUSY {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
totalTime = totalTime + (10)
|
||||
totalTime = totalTime + 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
totalTime = totalTime + (100)
|
||||
totalTime = totalTime + 100
|
||||
continue
|
||||
}
|
||||
fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
|
||||
@ -5800,7 +5800,7 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
libc.Xfseek(tls, in, int64(0), SEEK_END)
|
||||
sz = libc.Xftell(tls, in)
|
||||
libc.Xrewind(tls, in)
|
||||
z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + int64(1))))
|
||||
z = sqlite3.Xsqlite3_malloc(tls, int32(sz+int64(1)))
|
||||
sz = int64(libc.Xfread(tls, z, uint64(1), uint64(sz), in))
|
||||
*(*uint8)(unsafe.Pointer(z + uintptr(sz))) = uint8(0)
|
||||
libc.Xfclose(tls, in)
|
||||
@ -5810,24 +5810,24 @@ func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
|
||||
// Return the length of the next token.
|
||||
func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
|
||||
var n int32 = 0
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*uint8)(unsafe.Pointer(z))) == '/') && (int32(*(*uint8)(unsafe.Pointer(z + 1))) == '*')) {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z)))))*2)))&int32(_ISspace) != 0 || int32(*(*uint8)(unsafe.Pointer(z))) == '/' && int32(*(*uint8)(unsafe.Pointer(z + 1))) == '*' {
|
||||
var inC int32 = 0
|
||||
var c int32
|
||||
if int32(*(*uint8)(unsafe.Pointer(z))) == '/' {
|
||||
inC = 1
|
||||
n = 2
|
||||
}
|
||||
for (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1)))))) != 0 {
|
||||
if c == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 {
|
||||
continue
|
||||
}
|
||||
if ((inC != 0) && (c == '*')) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
|
||||
if inC != 0 && c == '*' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '/' {
|
||||
n++
|
||||
inC = 0
|
||||
} else if (!(inC != 0) && (c == '/')) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '*') {
|
||||
} else if !(inC != 0) && c == '/' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '*' {
|
||||
n++
|
||||
inC = 1
|
||||
} else if !(inC != 0) {
|
||||
@ -5835,29 +5835,29 @@ func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:7
|
||||
}
|
||||
}
|
||||
n--
|
||||
} else if (int32(*(*uint8)(unsafe.Pointer(z))) == '-') && (int32(*(*uint8)(unsafe.Pointer(z + 1))) == '-') {
|
||||
for n = 2; (*(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != '\n'); n++ {
|
||||
} else if int32(*(*uint8)(unsafe.Pointer(z))) == '-' && int32(*(*uint8)(unsafe.Pointer(z + 1))) == '-' {
|
||||
for n = 2; *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != '\n'; n++ {
|
||||
}
|
||||
if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
n++
|
||||
}
|
||||
} else if (int32(*(*uint8)(unsafe.Pointer(z))) == '"') || (int32(*(*uint8)(unsafe.Pointer(z))) == '\'') {
|
||||
} else if int32(*(*uint8)(unsafe.Pointer(z))) == '"' || int32(*(*uint8)(unsafe.Pointer(z))) == '\'' {
|
||||
var delim int32 = int32(*(*uint8)(unsafe.Pointer(z)))
|
||||
for n = 1; *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0; n++ {
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == '\n' {
|
||||
(*(*int32)(unsafe.Pointer(pnLine)))++
|
||||
*(*int32)(unsafe.Pointer(pnLine))++
|
||||
}
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == delim {
|
||||
n++
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr((n + 1))))) != delim {
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(n+1)))) != delim {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var c int32
|
||||
for n = 1; (((((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
|
||||
for n = 1; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(n))))) != 0 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0) && c != '"' && c != '\'' && c != ';'; n++ {
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5870,7 +5870,7 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
*(*uint8)(unsafe.Pointer(zOut)) = uint8(0)
|
||||
return 0
|
||||
}
|
||||
for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
|
||||
for i = 0; i < nIn && i < nOut-1 && !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i))))))*2)))&int32(_ISspace) != 0); i++ {
|
||||
*(*uint8)(unsafe.Pointer(zOut + uintptr(i))) = *(*uint8)(unsafe.Pointer(zIn + uintptr(i)))
|
||||
}
|
||||
*(*uint8)(unsafe.Pointer(zOut + uintptr(i))) = uint8(0)
|
||||
@ -5880,8 +5880,8 @@ func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int3
|
||||
// Find the number of characters up to the start of the next "--end" token.
|
||||
func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
|
||||
var n int32 = 0
|
||||
for (*(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint64(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
|
||||
for *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 && (libc.Xstrncmp(tls, z+uintptr(n), ts+896, uint64(5)) != 0 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+5))))))*2)))&int32(_ISspace) != 0)) {
|
||||
n = n + tokenLength(tls, z+uintptr(n), pnLine)
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -5892,16 +5892,16 @@ func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:1
|
||||
func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
|
||||
var n int32 = 0
|
||||
for *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 {
|
||||
var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
|
||||
if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint64(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
|
||||
(((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint64(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
|
||||
return (n + len)
|
||||
var len int32 = tokenLength(tls, z+uintptr(n), pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+902, uint64(7)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+7))))))*2)))&int32(_ISspace) != 0 ||
|
||||
stopAtElse != 0 && libc.Xstrncmp(tls, z+uintptr(n), ts+910, uint64(6)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+6))))))*2)))&int32(_ISspace) != 0 {
|
||||
return n + len
|
||||
}
|
||||
if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint64(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
|
||||
if libc.Xstrncmp(tls, z+uintptr(n), ts+917, uint64(4)) == 0 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n+4))))))*2)))&int32(_ISspace) != 0 {
|
||||
var skip int32 = findEndif(tls, z+uintptr(n)+uintptr(len), 0, pnLine)
|
||||
n = n + (skip + len)
|
||||
} else {
|
||||
n = n + (len)
|
||||
n = n + len
|
||||
}
|
||||
}
|
||||
return n
|
||||
@ -5925,11 +5925,11 @@ func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uint
|
||||
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
|
||||
}
|
||||
g.iTimeout = 0
|
||||
for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) || (rc == SQLITE_ROW)) &&
|
||||
(iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY || rc == SQLITE_ROW) &&
|
||||
iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_reset(tls, pStmt)
|
||||
sqlite3.Xsqlite3_sleep(tls, 50)
|
||||
iTimeout = iTimeout - (50)
|
||||
iTimeout = iTimeout - 50
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
g.iTimeout = DEFAULT_TIMEOUT
|
||||
@ -5950,11 +5950,11 @@ func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
|
||||
var i int32
|
||||
var j int32
|
||||
for i = libc.AssignInt32(&j, 0); *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
|
||||
j = (i + 1)
|
||||
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == '/' {
|
||||
j = i + 1
|
||||
}
|
||||
}
|
||||
return (z + uintptr(j))
|
||||
return z + uintptr(j)
|
||||
}
|
||||
|
||||
// Interpret zArg as a boolean value. Return either 0 or 1.
|
||||
@ -5966,15 +5966,15 @@ func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
|
||||
if zArg == uintptr(0) {
|
||||
return 0
|
||||
}
|
||||
for i = 0; (int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
|
||||
for i = 0; int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0' && int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'; i++ {
|
||||
}
|
||||
if (i > 0) && (int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
|
||||
if i > 0 && int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) == 0 {
|
||||
return libc.Xatoi(tls, zArg)
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169) == 0 {
|
||||
return 1
|
||||
}
|
||||
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
|
||||
if sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173) == 0 || sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177) == 0 {
|
||||
return 0
|
||||
}
|
||||
errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
|
||||
@ -6015,58 +6015,58 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
|
||||
libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})))
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
for (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
|
||||
for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii))))) != 0 {
|
||||
prevLine = *(*int32)(unsafe.Pointer(bp + 376 /* lineno */))
|
||||
len = tokenLength(tls, (zScript + uintptr(ii)), bp+376 /* &lineno */)
|
||||
if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
|
||||
ii = ii + (len)
|
||||
len = tokenLength(tls, zScript+uintptr(ii), bp+376 /* &lineno */)
|
||||
if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(_ISspace) != 0 || c == '/' && int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+1)))) == '*' {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
if ((c != '-') || (int32(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
|
||||
ii = ii + (len)
|
||||
if c != '-' || int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+1)))) != '-' || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+2)))))*2)))&int32(_ISalpha) != 0) {
|
||||
ii = ii + len
|
||||
continue
|
||||
}
|
||||
|
||||
// Run any prior SQL before processing the new --command
|
||||
if ii > iBegin {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
iBegin = (ii + len)
|
||||
iBegin = ii + len
|
||||
}
|
||||
|
||||
// Parse the --command
|
||||
if g.iTrace >= 2 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, zScript+uintptr(ii)))
|
||||
}
|
||||
n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]uint8{})))
|
||||
for nArg = 0; (n < (len - 2)) && (nArg < MX_ARG); nArg++ {
|
||||
for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
|
||||
n = extractToken(tls, zScript+uintptr(ii)+uintptr(2), len-2, bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]uint8{})))
|
||||
for nArg = 0; n < len-2 && nArg < MX_ARG; nArg++ {
|
||||
for n < len-2 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+2+n))))))*2)))&int32(_ISspace) != 0 {
|
||||
n++
|
||||
}
|
||||
if n >= (len - 2) {
|
||||
if n >= len-2 {
|
||||
break
|
||||
}
|
||||
n = n + (extractToken(tls, (((zScript + uintptr(ii)) + uintptr(2)) + uintptr(n)), ((len - 2) - n),
|
||||
(bp + 410 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]uint8{}))))
|
||||
n = n + extractToken(tls, zScript+uintptr(ii)+uintptr(2)+uintptr(n), len-2-n,
|
||||
bp+410+uintptr(nArg)*100, int32(unsafe.Sizeof([100]uint8{})))
|
||||
}
|
||||
for j = nArg; j < MX_ARG; j++ {
|
||||
*(*uint8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100))) = uint8(0)
|
||||
*(*uint8)(unsafe.Pointer(bp + 410 + uintptr(libc.PostIncInt32(&j, 1))*100)) = uint8(0)
|
||||
}
|
||||
|
||||
// --sleep N
|
||||
//
|
||||
// Pause for N milliseconds
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1207) == 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, bp+410))
|
||||
} else
|
||||
|
||||
// --exit N
|
||||
//
|
||||
// Exit this process. If N>0 then exit without shutting down
|
||||
// SQLite. (In other words, simulate a crash.)
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1213) == 0 {
|
||||
var rc int32 = libc.Xatoi(tls, bp+410)
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
if rc == 0 {
|
||||
sqlite3.Xsqlite3_close(tls, g.db)
|
||||
@ -6078,9 +6078,9 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Begin a new test case. Announce in the log that the test case
|
||||
// has begun.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1218) == 0 {
|
||||
if g.iTrace == 1 {
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, len-1, zScript+uintptr(ii)))
|
||||
}
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
@ -6089,29 +6089,29 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Mark the current task as having finished, even if it is not.
|
||||
// This can be used in conjunction with --exit to simulate a crash.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1227) == 0 && iClient > 0 {
|
||||
finishScript(tls, iClient, taskId, 1)
|
||||
} else
|
||||
|
||||
// --reset
|
||||
//
|
||||
// Reset accumulated results back to an empty string
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1234) == 0 {
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
} else
|
||||
|
||||
// --match ANSWER...
|
||||
//
|
||||
// Check to see if output matches ANSWER. Report an error if not.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1240) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
for jj = 7; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint64((len-jj)-1))) != 0) {
|
||||
if len-jj-1 != (*String)(unsafe.Pointer(bp+360)).n || libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360)).z, zAns, uint64(len-jj-1)) != 0 {
|
||||
errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
libc.VaList(bp+48, prevLine, zFilename, len-jj-1, zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
g.nTest++
|
||||
stringReset(tls, bp+360 /* &sResult */)
|
||||
@ -6122,16 +6122,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Check to see if output does or does not match the glob pattern
|
||||
// ANSWER.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1291) == 0 || libc.Xstrcmp(tls, bp+380, ts+1296) == 0 {
|
||||
var jj int32
|
||||
var zAns uintptr = (zScript + uintptr(ii))
|
||||
var zAns uintptr = zScript + uintptr(ii)
|
||||
var zCopy uintptr
|
||||
var isGlob int32 = (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */))) == 'g'))
|
||||
for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
var isGlob int32 = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(bp + 380))) == 'g')
|
||||
for jj = 9 - 3*isGlob; jj < len-1 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zAns + uintptr(jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
zAns += uintptr(jj)
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
|
||||
if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
|
||||
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, len-jj-1, zAns))
|
||||
if libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360)).z) == 0)^isGlob != 0 {
|
||||
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
|
||||
libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
}
|
||||
@ -6143,21 +6143,21 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --output
|
||||
//
|
||||
// Output the result of the previous SQL.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1347) == 0 {
|
||||
logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
|
||||
} else
|
||||
|
||||
// --source FILENAME
|
||||
//
|
||||
// Run a subscript from a separate file.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1354) == 0 {
|
||||
var zNewFile uintptr
|
||||
var zNewScript uintptr
|
||||
var zToDel uintptr = uintptr(0)
|
||||
zNewFile = (bp + 410 /* &azArg[0] */)
|
||||
if !((int32(*(*uint8)(unsafe.Pointer(zNewFile)))) == '/') {
|
||||
zNewFile = bp + 410
|
||||
if !(int32(*(*uint8)(unsafe.Pointer(zNewFile))) == '/') {
|
||||
var k int32
|
||||
for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*uint8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
|
||||
for k = int32(libc.Xstrlen(tls, zFilename)) - 1; k >= 0 && !(int32(*(*uint8)(unsafe.Pointer(zFilename + uintptr(k)))) == '/'); k-- {
|
||||
}
|
||||
if k > 0 {
|
||||
zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
|
||||
@ -6178,26 +6178,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// --print MESSAGE....
|
||||
//
|
||||
// Output the remainder of the line to the log file
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1405) == 0 {
|
||||
var jj int32
|
||||
for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 7; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
} else
|
||||
|
||||
// --if EXPR
|
||||
//
|
||||
// Skip forward to the next matching --endif or --else if EXPR is false.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1411) == 0 {
|
||||
var jj int32
|
||||
var rc int32
|
||||
var pStmt uintptr
|
||||
for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
|
||||
for jj = 4; jj < len && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*uint8)(unsafe.Pointer(zScript + uintptr(ii+jj))))))*2)))&int32(_ISspace) != 0; jj++ {
|
||||
}
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
|
||||
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, len-jj, zScript+uintptr(ii)+uintptr(jj)))
|
||||
rc = sqlite3.Xsqlite3_step(tls, pStmt)
|
||||
if (rc != SQLITE_ROW) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+376 /* &lineno */))
|
||||
if rc != SQLITE_ROW || sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 1, bp+376)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
} else
|
||||
@ -6206,23 +6206,23 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true. Skip forward to the next matching --endif.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
|
||||
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+376 /* &lineno */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1426) == 0 {
|
||||
ii = ii + findEndif(tls, zScript+uintptr(ii)+uintptr(len), 0, bp+376)
|
||||
} else
|
||||
|
||||
// --endif
|
||||
//
|
||||
// This command can only be encountered if currently inside an --if that
|
||||
// is true or an --else of a false if. This is a no-op.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1431) == 0 {
|
||||
// no-op
|
||||
} else
|
||||
|
||||
// --start CLIENT
|
||||
//
|
||||
// Start up the given client.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
|
||||
var iNewClient int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1437) == 0 && iClient == 0 {
|
||||
var iNewClient int32 = libc.Xatoi(tls, bp+410)
|
||||
if iNewClient > 0 {
|
||||
startClient(tls, iNewClient)
|
||||
}
|
||||
@ -6233,16 +6233,16 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
// Wait until all tasks complete for the given client. If CLIENT is
|
||||
// "all" then wait for all clients to complete. Wait no longer than
|
||||
// TIMEOUT milliseconds (default 10,000)
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1443) == 0 && iClient == 0 {
|
||||
var iTimeout int32
|
||||
if nArg >= 2 {
|
||||
iTimeout = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + 1*100))
|
||||
iTimeout = libc.Xatoi(tls, bp+410+1*100)
|
||||
} else {
|
||||
iTimeout = 10000
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]uint8{})), bp+610 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
|
||||
libc.VaList(bp+216, prevLine, zFilename))
|
||||
waitForClient(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */)), iTimeout, bp+610 /* &zError[0] */)
|
||||
waitForClient(tls, libc.Xatoi(tls, bp+410), iTimeout, bp+610 /* &zError[0] */)
|
||||
} else
|
||||
|
||||
// --task CLIENT
|
||||
@ -6251,19 +6251,19 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
//
|
||||
// Assign work to a client. Start the client if it is not running
|
||||
// already.
|
||||
if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
|
||||
var iTarget int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */))
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1463) == 0 && iClient == 0 {
|
||||
var iTarget int32 = libc.Xatoi(tls, bp+410)
|
||||
var iEnd int32
|
||||
var zTask uintptr
|
||||
var zTName uintptr
|
||||
iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+376 /* &lineno */)
|
||||
iEnd = findEnd(tls, zScript+uintptr(ii)+uintptr(len), bp+376 /* &lineno */)
|
||||
if iTarget < 0 {
|
||||
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
|
||||
libc.VaList(bp+232, prevLine, zFilename, iTarget))
|
||||
} else {
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
|
||||
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, zScript+uintptr(ii)+uintptr(len)))
|
||||
if nArg > 1 {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+410 /* &azArg[0] */ +1*100)))
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, bp+410+1*100))
|
||||
} else {
|
||||
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
|
||||
}
|
||||
@ -6273,26 +6273,26 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
sqlite3.Xsqlite3_free(tls, zTask)
|
||||
sqlite3.Xsqlite3_free(tls, zTName)
|
||||
}
|
||||
iEnd = iEnd + (tokenLength(tls, (((zScript + uintptr(ii)) + uintptr(len)) + uintptr(iEnd)), bp+376 /* &lineno */))
|
||||
len = len + (iEnd)
|
||||
iBegin = (ii + len)
|
||||
iEnd = iEnd + tokenLength(tls, zScript+uintptr(ii)+uintptr(len)+uintptr(iEnd), bp+376)
|
||||
len = len + iEnd
|
||||
iBegin = ii + len
|
||||
} else
|
||||
|
||||
// --breakpoint
|
||||
//
|
||||
// This command calls "test_breakpoint()" which is a routine provided
|
||||
// as a convenient place to set a debugger breakpoint.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1567) == 0 {
|
||||
test_breakpoint(tls)
|
||||
} else
|
||||
|
||||
// --show-sql-errors BOOLEAN
|
||||
//
|
||||
// Turn display of SQL errors on and off.
|
||||
if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
|
||||
if libc.Xstrcmp(tls, bp+380, ts+1578) == 0 {
|
||||
g.bIgnoreSqlErrors = func() int32 {
|
||||
if nArg >= 1 {
|
||||
return libc.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */)) != 0))
|
||||
return libc.BoolInt32(!(booleanValue(tls, bp+410) != 0))
|
||||
}
|
||||
return 1
|
||||
}()
|
||||
@ -6300,10 +6300,10 @@ func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFil
|
||||
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
|
||||
libc.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
|
||||
}
|
||||
ii = ii + (len)
|
||||
ii = ii + len
|
||||
}
|
||||
if iBegin < ii {
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
|
||||
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, ii-iBegin, zScript+uintptr(iBegin)))
|
||||
runSql(tls, zSql, 0)
|
||||
sqlite3.Xsqlite3_free(tls, zSql)
|
||||
}
|
||||
@ -6327,7 +6327,7 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
|
||||
for i = 0; i < nArg; i++ {
|
||||
var z uintptr
|
||||
if (i + hasArg) >= nArg {
|
||||
if i+hasArg >= nArg {
|
||||
break
|
||||
}
|
||||
z = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
|
||||
@ -6342,15 +6342,15 @@ func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, ha
|
||||
z++
|
||||
}
|
||||
if libc.Xstrcmp(tls, z, zOption) == 0 {
|
||||
if (hasArg != 0) && (i == (nArg - 1)) {
|
||||
if hasArg != 0 && i == nArg-1 {
|
||||
fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
|
||||
}
|
||||
if hasArg != 0 {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*8))
|
||||
} else {
|
||||
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
|
||||
}
|
||||
j = ((i + 1) + (libc.Bool32(hasArg != 0)))
|
||||
j = i + 1 + libc.Bool32(hasArg != 0)
|
||||
for j < nArg {
|
||||
*(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*8))
|
||||
}
|
||||
@ -6369,8 +6369,8 @@ func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
|
||||
var i int32
|
||||
var zTail uintptr = argv0
|
||||
for i = 0; *(*uint8)(unsafe.Pointer(argv0 + uintptr(i))) != 0; i++ {
|
||||
if (int32(*(*uint8)(unsafe.Pointer(argv0 + uintptr(i))))) == '/' {
|
||||
zTail = ((argv0 + uintptr(i)) + uintptr(1))
|
||||
if int32(*(*uint8)(unsafe.Pointer(argv0 + uintptr(i)))) == '/' {
|
||||
zTail = argv0 + uintptr(i) + uintptr(1)
|
||||
}
|
||||
}
|
||||
libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
|
||||
@ -6424,43 +6424,43 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + 1*8))
|
||||
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
|
||||
if strglob(tls, ts+2323, g.zDbFile) != 0 {
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */) != 0 {
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330) != 0 {
|
||||
libc.Xfprintf(tls, libc.Xstderr,
|
||||
|
||||
ts+2415, /* "SQLite library a..." */
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */))
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = argc - 2
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+64, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
|
||||
zJMode = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
|
||||
zNRep = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
|
||||
if zNRep != 0 {
|
||||
nRep = libc.Xatoi(tls, zNRep)
|
||||
}
|
||||
if nRep < 1 {
|
||||
nRep = 1
|
||||
}
|
||||
g.zVfs = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
g.zVfs = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
|
||||
zClient = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2510 /* "client" */, 1)
|
||||
g.zErrLog = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
|
||||
g.zLog = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2524 /* "log" */, 1)
|
||||
zTrace = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2528 /* "trace" */, 1)
|
||||
if zTrace != 0 {
|
||||
g.iTrace = libc.Xatoi(tls, zTrace)
|
||||
}
|
||||
if findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
|
||||
if findOption(tls, argv+uintptr(2)*8, bp+232, ts+2534, 0) != uintptr(0) {
|
||||
g.iTrace = 0
|
||||
}
|
||||
zTmout = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
zTmout = findOption(tls, argv+uintptr(2)*8, bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
|
||||
if zTmout != 0 {
|
||||
iTmout = libc.Xatoi(tls, zTmout)
|
||||
}
|
||||
g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
|
||||
g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
|
||||
g.bSqlTrace = libc.Bool32(findOption(tls, argv+uintptr(2)*8, bp+232, ts+2548, 0) != uintptr(0))
|
||||
g.bSync = libc.Bool32(findOption(tls, argv+uintptr(2)*8, bp+232, ts+2557, 0) != uintptr(0))
|
||||
if g.zErrLog != 0 {
|
||||
g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
|
||||
} else {
|
||||
@ -6480,7 +6480,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
if iClient < 1 {
|
||||
fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
|
||||
}
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2591, /* "%05d.client%02d" */
|
||||
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]uint8{})), uintptr(unsafe.Pointer(&g))+64, ts+2591, /* "%05d.client%02d" */
|
||||
libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
|
||||
} else {
|
||||
var nTry int32 = 0
|
||||
@ -6491,14 +6491,14 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
libc.Xprintf(tls, ts+2617 /* "With SQLite 3.37..." */, 0)
|
||||
for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
|
||||
for i = 0; libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i)) != uintptr(0); i++ {
|
||||
libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
|
||||
}
|
||||
libc.Xfflush(tls, libc.Xstdout)
|
||||
}
|
||||
iClient = 0
|
||||
for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
|
||||
if (nTry % 5) == 4 {
|
||||
for ok := true; ok; ok = rc != 0 && libc.PreIncInt32(&nTry, 1) < 60 && sqlite3.Xsqlite3_sleep(tls, 1000) > 0 {
|
||||
if nTry%5 == 4 {
|
||||
libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
|
||||
libc.VaList(bp+88, func() uintptr {
|
||||
if nTry > 5 {
|
||||
@ -6508,7 +6508,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}(), g.zDbFile))
|
||||
}
|
||||
rc = libc.Xunlink(tls, g.zDbFile)
|
||||
if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT) {
|
||||
if rc != 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOENT {
|
||||
rc = 0
|
||||
}
|
||||
}
|
||||
@ -6516,9 +6516,9 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
fatalError(tls, ts+2771, /* "unable to unlink..." */
|
||||
libc.VaList(bp+104, g.zDbFile, nTry))
|
||||
}
|
||||
openFlags = openFlags | (SQLITE_OPEN_CREATE)
|
||||
openFlags = openFlags | SQLITE_OPEN_CREATE
|
||||
}
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 24 /* &.db */), openFlags, g.zVfs)
|
||||
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, uintptr(unsafe.Pointer(&g))+24, openFlags, g.zVfs)
|
||||
if rc != 0 {
|
||||
fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
|
||||
}
|
||||
@ -6551,8 +6551,8 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}{sqlTraceCallback})), uintptr(0))
|
||||
}
|
||||
if iClient > 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 0 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*8)
|
||||
}
|
||||
if g.iTrace != 0 {
|
||||
logMessage(tls, ts+2889 /* "start-client" */, 0)
|
||||
@ -6580,11 +6580,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
} else {
|
||||
var pStmt uintptr
|
||||
var iTimeout int32
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 {
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) == 0 {
|
||||
fatalError(tls, ts+2939 /* "missing script f..." */, 0)
|
||||
}
|
||||
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
|
||||
if *(*int32)(unsafe.Pointer(bp + 232)) > 1 {
|
||||
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), argv+uintptr(2)*8)
|
||||
}
|
||||
runSql(tls,
|
||||
|
||||
@ -6605,21 +6605,21 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
g.iTimeout = 0
|
||||
iTimeout = 1000
|
||||
for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == SQLITE_BUSY) ||
|
||||
(rc == SQLITE_ROW)) && (iTimeout > 0) {
|
||||
for (libc.AssignInt32(&rc, trySql(tls, ts+3502, 0)) == SQLITE_BUSY ||
|
||||
rc == SQLITE_ROW) && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
sqlite3.Xsqlite3_sleep(tls, 100)
|
||||
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
|
||||
iTimeout = 1000
|
||||
for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) && (iTimeout > 0) {
|
||||
for libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt)) == SQLITE_BUSY && iTimeout > 0 {
|
||||
sqlite3.Xsqlite3_sleep(tls, 10)
|
||||
iTimeout = iTimeout - (10)
|
||||
iTimeout = iTimeout - 10
|
||||
}
|
||||
if rc == SQLITE_ROW {
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nError */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 0))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 116 /* &.nTest */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 0)
|
||||
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 116)) += sqlite3.Xsqlite3_column_int(tls, pStmt, 1)
|
||||
}
|
||||
sqlite3.Xsqlite3_finalize(tls, pStmt)
|
||||
}
|
||||
@ -6634,7 +6634,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
}
|
||||
return (libc.Bool32(g.nError > 0))
|
||||
return libc.Bool32(g.nError > 0)
|
||||
}
|
||||
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Code generated by 'ccgo -export-defines "" -o internal/mptest/main_linux_s390x.go -trace-translation-units testdata/sqlite-src-3370000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3370000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT.
|
||||
// Code generated by 'ccgo -export-defines "" -o internal/mptest/main_linux_s390x.go -trace-translation-units testdata/sqlite-src-3360000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3360000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1', DO NOT EDIT.
|
||||
|
||||
package main
|
||||
|
||||
@ -17,7 +17,6 @@ var _ = math.Pi
|
||||
var _ reflect.Kind
|
||||
var _ atomic.Value
|
||||
var _ unsafe.Pointer
|
||||
var _ *libc.TLS
|
||||
var _ types.Size_t
|
||||
|
||||
func main() { libc.Start(main1) }
|
||||
@ -271,7 +270,6 @@ const (
|
||||
SQLITE_CONSTRAINT = 19
|
||||
SQLITE_CONSTRAINT_CHECK = 275
|
||||
SQLITE_CONSTRAINT_COMMITHOOK = 531
|
||||
SQLITE_CONSTRAINT_DATATYPE = 3091
|
||||
SQLITE_CONSTRAINT_FOREIGNKEY = 787
|
||||
SQLITE_CONSTRAINT_FUNCTION = 1043
|
||||
SQLITE_CONSTRAINT_NOTNULL = 1299
|
||||
@ -542,7 +540,6 @@ const (
|
||||
SQLITE_OPEN_CREATE = 0x00000004
|
||||
SQLITE_OPEN_DELETEONCLOSE = 0x00000008
|
||||
SQLITE_OPEN_EXCLUSIVE = 0x00000010
|
||||
SQLITE_OPEN_EXRESCODE = 0x02000000
|
||||
SQLITE_OPEN_FULLMUTEX = 0x00010000
|
||||
SQLITE_OPEN_MAIN_DB = 0x00000100
|
||||
SQLITE_OPEN_MAIN_JOURNAL = 0x00000800
|
||||
@ -601,7 +598,7 @@ const (
|
||||
SQLITE_SHM_SHARED = 4
|
||||
SQLITE_SHM_UNLOCK = 1
|
||||
SQLITE_SOUNDEX = 1
|
||||
SQLITE_SOURCE_ID = "2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a"
|
||||
SQLITE_SOURCE_ID = "2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5"
|
||||
SQLITE_STATUS_MALLOC_COUNT = 9
|
||||
SQLITE_STATUS_MALLOC_SIZE = 5
|
||||
SQLITE_STATUS_MEMORY_USED = 0
|
||||
@ -674,8 +671,8 @@ const (
|
||||
SQLITE_UTF16LE = 2
|
||||
SQLITE_UTF16_ALIGNED = 8
|
||||
SQLITE_UTF8 = 1
|
||||
SQLITE_VERSION = "3.37.0"
|
||||
SQLITE_VERSION_NUMBER = 3037000
|
||||
SQLITE_VERSION = "3.36.0"
|
||||
SQLITE_VERSION_NUMBER = 3036000
|
||||
SQLITE_VTAB_CONSTRAINT_SUPPORT = 1
|
||||
SQLITE_VTAB_DIRECTONLY = 3
|
||||
SQLITE_VTAB_INNOCUOUS = 2
|
||||
@ -862,6 +859,150 @@ const (
|
||||
Unix = 1
|
||||
)
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// ISO C99 Standard: 7.2 Diagnostics <assert.h>
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// void assert (int expression);
|
||||
//
|
||||
// If NDEBUG is defined, do nothing.
|
||||
// If not, and EXPRESSION is zero, print an error message and abort.
|
||||
|
||||
// void assert_perror (int errnum);
|
||||
//
|
||||
// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
|
||||
// error message with the error text for ERRNUM and abort.
|
||||
// (This is a GNU extension.)
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// ISO C99 Standard 7.4: Character handling <ctype.h>
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// bits/types.h -- definitions of __*_t types underlying *_t types.
|
||||
// Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Never include this file directly; use <sys/types.h> instead.
|
||||
|
||||
// These are all the characteristics of characters.
|
||||
// If there get to be more than 16 distinct characteristics,
|
||||
// many things must be changed that use `unsigned short int's.
|
||||
//
|
||||
// The characteristics are stored always in network byte order (big
|
||||
// endian). We define the bit value interpretations here dependent on the
|
||||
// machine's byte order.
|
||||
|
||||
// Endian macros for string.h functions
|
||||
// Copyright (C) 1992-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
const ( /* ctype.h:46:1: */
|
||||
_ISupper = 1 // UPPERCASE.
|
||||
_ISlower = 2 // lowercase.
|
||||
_ISalpha = 4 // Alphabetic.
|
||||
_ISdigit = 8 // Numeric.
|
||||
_ISxdigit = 16 // Hexadecimal numeric.
|
||||
_ISspace = 32 // Whitespace.
|
||||
_ISprint = 64 // Printing.
|
||||
_ISgraph = 128 // Graphical.
|
||||
_ISblank = 256 // Blank (usually SPC and TAB).
|
||||
_IScntrl = 512 // Control character.
|
||||
_ISpunct = 1024 // Punctuation.
|
||||
_ISalnum = 2048
|
||||
)
|
||||
|
||||
// Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
|
||||
// the `_SC_*' symbols for the NAME argument to `sysconf';
|
||||
// and the `_CS_*' symbols for the NAME argument to `confstr'.
|
||||
@ -1266,150 +1407,6 @@ const ( /* waitflags.h:52:1: */
|
||||
P_PGID = 2
|
||||
)
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// ISO C99 Standard: 7.2 Diagnostics <assert.h>
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// void assert (int expression);
|
||||
//
|
||||
// If NDEBUG is defined, do nothing.
|
||||
// If not, and EXPRESSION is zero, print an error message and abort.
|
||||
|
||||
// void assert_perror (int errnum);
|
||||
//
|
||||
// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
|
||||
// error message with the error text for ERRNUM and abort.
|
||||
// (This is a GNU extension.)
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// ISO C99 Standard 7.4: Character handling <ctype.h>
|
||||
|
||||
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// bits/types.h -- definitions of __*_t types underlying *_t types.
|
||||
// Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Never include this file directly; use <sys/types.h> instead.
|
||||
|
||||
// These are all the characteristics of characters.
|
||||
// If there get to be more than 16 distinct characteristics,
|
||||
// many things must be changed that use `unsigned short int's.
|
||||
//
|
||||
// The characteristics are stored always in network byte order (big
|
||||
// endian). We define the bit value interpretations here dependent on the
|
||||
// machine's byte order.
|
||||
|
||||
// Endian macros for string.h functions
|
||||
// Copyright (C) 1992-2020 Free Software Foundation, Inc.
|
||||
// This file is part of the GNU C Library.
|
||||
//
|
||||
// The GNU C Library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// The GNU C Library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with the GNU C Library; if not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
const ( /* ctype.h:46:1: */
|
||||
_ISupper = 1 // UPPERCASE.
|
||||
_ISlower = 2 // lowercase.
|
||||
_ISalpha = 4 // Alphabetic.
|
||||
_ISdigit = 8 // Numeric.
|
||||
_ISxdigit = 16 // Hexadecimal numeric.
|
||||
_ISspace = 32 // Whitespace.
|
||||
_ISprint = 64 // Printing.
|
||||
_ISgraph = 128 // Graphical.
|
||||
_ISblank = 256 // Blank (usually SPC and TAB).
|
||||
_IScntrl = 512 // Control character.
|
||||
_ISpunct = 1024 // Punctuation.
|
||||
_ISalnum = 2048
|
||||
)
|
||||
|
||||
type ptrdiff_t = int64 /* <builtin>:3:26 */
|
||||
|
||||
type size_t = uint64 /* <builtin>:9:23 */
|
||||
@ -1450,15 +1447,15 @@ type va_list = uintptr /* stdarg.h:99:24 */
|
||||
// between -9223372036854775808 and +9223372036854775807 inclusive. ^The
|
||||
// sqlite3_uint64 and sqlite_uint64 types can store integer values
|
||||
// between 0 and +18446744073709551615 inclusive.
|
||||
type sqlite_int64 = int64 /* sqlite3.h:301:25 */
|
||||
type sqlite_uint64 = uint64 /* sqlite3.h:302:34 */
|
||||
type sqlite3_int64 = sqlite_int64 /* sqlite3.h:304:22 */
|
||||
type sqlite3_uint64 = sqlite_uint64 /* sqlite3.h:305:23 */
|
||||
type sqlite_int64 = int64 /* sqlite3.h:278:25 */
|
||||
type sqlite_uint64 = uint64 /* sqlite3.h:279:34 */
|
||||
type sqlite3_int64 = sqlite_int64 /* sqlite3.h:281:22 */
|
||||
type sqlite3_uint64 = sqlite_uint64 /* sqlite3.h:282:23 */
|
||||
|
||||
// The type for a callback function.
|
||||
// This is legacy and deprecated. It is included for historical
|
||||
// compatibility and is not documented.
|
||||
type sqlite3_callback = uintptr /* sqlite3.h:361:13 */
|
||||
type sqlite3_callback = uintptr /* sqlite3.h:338:13 */
|
||||
|
||||
// CAPI3REF: Result Codes
|
||||
// KEYWORDS: {result code definitions}
|
||||
@ -1493,19 +1490,6 @@ type sqlite3_callback = uintptr /* sqlite3.h:361:13 */
|
||||
// These bit values are intended for use in the
|
||||
// 3rd parameter to the [sqlite3_open_v2()] interface and
|
||||
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
|
||||
//
|
||||
// Only those flags marked as "Ok for sqlite3_open_v2()" may be
|
||||
// used as the third argument to the [sqlite3_open_v2()] interface.
|
||||
// The other flags have historically been ignored by sqlite3_open_v2(),
|
||||
// though future versions of SQLite might change so that an error is
|
||||
// raised if any of the disallowed bits are passed into sqlite3_open_v2().
|
||||
// Applications should not depend on the historical behavior.
|
||||
//
|
||||
// Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
|
||||
// [sqlite3_open_v2()] does *not* cause the underlying database file
|
||||
// to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
|
||||
// [sqlite3_open_v2()] has historically be a no-op and might become an
|
||||
// error in future versions of SQLite.
|
||||
|
||||
// Reserved: 0x00F00000
|
||||
// Legacy compatibility:
|
||||
@ -1582,7 +1566,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:361:13 */
|
||||
// for their own use. The pMethods entry is a pointer to an
|
||||
// [sqlite3_io_methods] object that defines methods for performing
|
||||
// I/O operations on the open file.
|
||||
type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:722:9 */
|
||||
type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:684:9 */
|
||||
|
||||
// CAPI3REF: Result Codes
|
||||
// KEYWORDS: {result code definitions}
|
||||
@ -1617,19 +1601,6 @@ type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:722:9 */
|
||||
// These bit values are intended for use in the
|
||||
// 3rd parameter to the [sqlite3_open_v2()] interface and
|
||||
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
|
||||
//
|
||||
// Only those flags marked as "Ok for sqlite3_open_v2()" may be
|
||||
// used as the third argument to the [sqlite3_open_v2()] interface.
|
||||
// The other flags have historically been ignored by sqlite3_open_v2(),
|
||||
// though future versions of SQLite might change so that an error is
|
||||
// raised if any of the disallowed bits are passed into sqlite3_open_v2().
|
||||
// Applications should not depend on the historical behavior.
|
||||
//
|
||||
// Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
|
||||
// [sqlite3_open_v2()] does *not* cause the underlying database file
|
||||
// to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
|
||||
// [sqlite3_open_v2()] has historically be a no-op and might become an
|
||||
// error in future versions of SQLite.
|
||||
|
||||
// Reserved: 0x00F00000
|
||||
// Legacy compatibility:
|
||||
@ -1706,7 +1677,7 @@ type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:722:9 */
|
||||
// for their own use. The pMethods entry is a pointer to an
|
||||
// [sqlite3_io_methods] object that defines methods for performing
|
||||
// I/O operations on the open file.
|
||||
type sqlite3_file = sqlite3_file1 /* sqlite3.h:722:29 */
|
||||
type sqlite3_file = sqlite3_file1 /* sqlite3.h:684:29 */
|
||||
type sqlite3_io_methods1 = struct {
|
||||
iVersion int32
|
||||
_ [4]byte
|
||||
@ -1728,7 +1699,7 @@ type sqlite3_io_methods1 = struct {
|
||||
xShmUnmap uintptr
|
||||
xFetch uintptr
|
||||
xUnfetch uintptr
|
||||
} /* sqlite3.h:722:9 */
|
||||
} /* sqlite3.h:684:9 */
|
||||
|
||||
// CAPI3REF: OS Interface File Virtual Methods Object
|
||||
//
|
||||
@ -1822,7 +1793,7 @@ type sqlite3_io_methods1 = struct {
|
||||
// fails to zero-fill short reads might seem to work. However,
|
||||
// failure to zero-fill short reads will eventually lead to
|
||||
// database corruption.
|
||||
type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:821:35 */
|
||||
type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:783:35 */
|
||||
|
||||
// CAPI3REF: OS Interface Object
|
||||
//
|
||||
@ -2015,7 +1986,7 @@ type sqlite3_vfs1 = struct {
|
||||
xSetSystemCall uintptr
|
||||
xGetSystemCall uintptr
|
||||
xNextSystemCall uintptr
|
||||
} /* sqlite3.h:1425:9 */
|
||||
} /* sqlite3.h:1387:9 */
|
||||
|
||||
// CAPI3REF: OS Interface Object
|
||||
//
|
||||
@ -2184,8 +2155,8 @@ type sqlite3_vfs1 = struct {
|
||||
// or all of these interfaces to be NULL or for their behavior to change
|
||||
// from one release to the next. Applications must not attempt to access
|
||||
// any of these methods if the iVersion of the VFS is less than 3.
|
||||
type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1425:28 */
|
||||
type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1426:14 */
|
||||
type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1387:28 */
|
||||
type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1388:14 */
|
||||
|
||||
// CAPI3REF: Memory Allocation Routines
|
||||
//
|
||||
@ -2257,7 +2228,7 @@ type sqlite3_mem_methods1 = struct {
|
||||
xInit uintptr
|
||||
xShutdown uintptr
|
||||
pAppData uintptr
|
||||
} /* sqlite3.h:1723:9 */
|
||||
} /* sqlite3.h:1685:9 */
|
||||
|
||||
// CAPI3REF: Memory Allocation Routines
|
||||
//
|
||||
@ -2320,7 +2291,7 @@ type sqlite3_mem_methods1 = struct {
|
||||
//
|
||||
// SQLite will never invoke xInit() more than once without an intervening
|
||||
// call to xShutdown().
|
||||
type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1723:36 */
|
||||
type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1685:36 */
|
||||
|
||||
// CAPI3REF: Constants Defining Special Destructor Behavior
|
||||
//
|
||||
@ -2334,7 +2305,7 @@ type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1723:36 */
|
||||
//
|
||||
// The typedef is necessary to work around problems in certain
|
||||
// C++ compilers.
|
||||
type sqlite3_destructor_type = uintptr /* sqlite3.h:5733:14 */
|
||||
type sqlite3_destructor_type = uintptr /* sqlite3.h:5665:14 */
|
||||
|
||||
// The interface to the virtual-table mechanism is currently considered
|
||||
// to be experimental. The interface might change in incompatible ways.
|
||||
@ -2349,7 +2320,7 @@ type sqlite3_vtab1 = struct {
|
||||
nRef int32
|
||||
_ [4]byte
|
||||
zErrMsg uintptr
|
||||
} /* sqlite3.h:6918:9 */
|
||||
} /* sqlite3.h:6784:9 */
|
||||
|
||||
// The interface to the virtual-table mechanism is currently considered
|
||||
// to be experimental. The interface might change in incompatible ways.
|
||||
@ -2359,7 +2330,7 @@ type sqlite3_vtab1 = struct {
|
||||
// interface fixed, support it indefinitely, and remove this comment.
|
||||
|
||||
// Structures used by the virtual table interface
|
||||
type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6918:29 */
|
||||
type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6784:29 */
|
||||
type sqlite3_index_info1 = struct {
|
||||
nConstraint int32
|
||||
_ [4]byte
|
||||
@ -2378,12 +2349,12 @@ type sqlite3_index_info1 = struct {
|
||||
idxFlags int32
|
||||
_ [4]byte
|
||||
colUsed sqlite3_uint64
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6919:35 */
|
||||
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6920:9 */
|
||||
type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6785:35 */
|
||||
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6786:9 */
|
||||
|
||||
type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6920:36 */
|
||||
type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6786:36 */
|
||||
type sqlite3_module1 = struct {
|
||||
iVersion int32
|
||||
_ [4]byte
|
||||
@ -2410,9 +2381,9 @@ type sqlite3_module1 = struct {
|
||||
xRelease uintptr
|
||||
xRollbackTo uintptr
|
||||
xShadowName uintptr
|
||||
} /* sqlite3.h:6918:9 */
|
||||
} /* sqlite3.h:6784:9 */
|
||||
|
||||
type sqlite3_module = sqlite3_module1 /* sqlite3.h:6921:31 */
|
||||
type sqlite3_module = sqlite3_module1 /* sqlite3.h:6787:31 */
|
||||
|
||||
// CAPI3REF: Virtual Table Indexing Information
|
||||
// KEYWORDS: sqlite3_index_info
|
||||
@ -2520,7 +2491,7 @@ type sqlite3_index_constraint = struct {
|
||||
usable uint8
|
||||
_ [2]byte
|
||||
iTermOffset int32
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
// CAPI3REF: Virtual Table Indexing Information
|
||||
// KEYWORDS: sqlite3_index_info
|
||||
@ -2626,7 +2597,7 @@ type sqlite3_index_orderby = struct {
|
||||
iColumn int32
|
||||
desc uint8
|
||||
_ [3]byte
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
// CAPI3REF: Virtual Table Indexing Information
|
||||
// KEYWORDS: sqlite3_index_info
|
||||
@ -2732,7 +2703,7 @@ type sqlite3_index_constraint_usage = struct {
|
||||
argvIndex int32
|
||||
omit uint8
|
||||
_ [3]byte
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
// CAPI3REF: Mutex Methods Object
|
||||
//
|
||||
@ -2807,7 +2778,7 @@ type sqlite3_mutex_methods1 = struct {
|
||||
xMutexLeave uintptr
|
||||
xMutexHeld uintptr
|
||||
xMutexNotheld uintptr
|
||||
} /* sqlite3.h:7753:9 */
|
||||
} /* sqlite3.h:7619:9 */
|
||||
|
||||
// CAPI3REF: Mutex Methods Object
|
||||
//
|
||||
@ -2872,7 +2843,7 @@ type sqlite3_mutex_methods1 = struct {
|
||||
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
|
||||
// If xMutexInit fails in any way, it is expected to clean up after itself
|
||||
// prior to returning.
|
||||
type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7753:38 */
|
||||
type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7619:38 */
|
||||
|
||||
// CAPI3REF: Custom Page Cache Object
|
||||
//
|
||||
@ -2885,7 +2856,7 @@ type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7753:38 */
|
||||
type sqlite3_pcache_page1 = struct {
|
||||
pBuf uintptr
|
||||
pExtra uintptr
|
||||
} /* sqlite3.h:8509:9 */
|
||||
} /* sqlite3.h:8375:9 */
|
||||
|
||||
// CAPI3REF: Custom Page Cache Object
|
||||
//
|
||||
@ -2895,7 +2866,7 @@ type sqlite3_pcache_page1 = struct {
|
||||
// of this object as parameters or as their return value.
|
||||
//
|
||||
// See [sqlite3_pcache_methods2] for additional information.
|
||||
type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8509:36 */
|
||||
type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8375:36 */
|
||||
|
||||
// CAPI3REF: Application Defined Page Cache.
|
||||
// KEYWORDS: {page cache}
|
||||
@ -3069,7 +3040,7 @@ type sqlite3_pcache_methods21 = struct {
|
||||
xTruncate uintptr
|
||||
xDestroy uintptr
|
||||
xShrink uintptr
|
||||
} /* sqlite3.h:8674:9 */
|
||||
} /* sqlite3.h:8540:9 */
|
||||
|
||||
// CAPI3REF: Application Defined Page Cache.
|
||||
// KEYWORDS: {page cache}
|
||||
@ -3228,7 +3199,7 @@ type sqlite3_pcache_methods21 = struct {
|
||||
// free up as much of heap memory as possible. The page cache implementation
|
||||
// is not obligated to free any memory, but well-behaved implementations should
|
||||
// do their best.
|
||||
type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8674:40 */
|
||||
type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8540:40 */
|
||||
|
||||
// This is the obsolete pcache_methods object that has now been replaced
|
||||
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
|
||||
@ -3245,12 +3216,12 @@ type sqlite3_pcache_methods1 = struct {
|
||||
xRekey uintptr
|
||||
xTruncate uintptr
|
||||
xDestroy uintptr
|
||||
} /* sqlite3.h:8697:9 */
|
||||
} /* sqlite3.h:8563:9 */
|
||||
|
||||
// This is the obsolete pcache_methods object that has now been replaced
|
||||
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
|
||||
// retained in the header file for backwards compatibility only.
|
||||
type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8697:39 */
|
||||
type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8563:39 */
|
||||
|
||||
// CAPI3REF: Database Snapshot
|
||||
// KEYWORDS: {snapshot} {sqlite3_snapshot}
|
||||
@ -3270,7 +3241,7 @@ type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8697:39 */
|
||||
// version of the database file so that it is possible to later open a new read
|
||||
// transaction that sees that historical version of the database rather than
|
||||
// the most recent version.
|
||||
type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9765:9 */
|
||||
type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9630:9 */
|
||||
|
||||
// CAPI3REF: Database Snapshot
|
||||
// KEYWORDS: {snapshot} {sqlite3_snapshot}
|
||||
@ -3290,7 +3261,7 @@ type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9765:9 */
|
||||
// version of the database file so that it is possible to later open a new read
|
||||
// transaction that sees that historical version of the database rather than
|
||||
// the most recent version.
|
||||
type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9767:3 */
|
||||
type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9632:3 */
|
||||
|
||||
// CAPI3REF: Flags for sqlite3_deserialize()
|
||||
//
|
||||
@ -3334,7 +3305,7 @@ type sqlite3_rtree_geometry1 = struct {
|
||||
aParam uintptr
|
||||
pUser uintptr
|
||||
xDelUser uintptr
|
||||
} /* sqlite3.h:10096:9 */
|
||||
} /* sqlite3.h:9957:9 */
|
||||
|
||||
// CAPI3REF: Flags for sqlite3_deserialize()
|
||||
//
|
||||
@ -3371,7 +3342,7 @@ type sqlite3_rtree_geometry1 = struct {
|
||||
//
|
||||
//
|
||||
|
||||
type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:10096:39 */
|
||||
type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9957:39 */
|
||||
type sqlite3_rtree_query_info1 = struct {
|
||||
pContext uintptr
|
||||
nParam int32
|
||||
@ -3391,13 +3362,13 @@ type sqlite3_rtree_query_info1 = struct {
|
||||
eWithin int32
|
||||
rScore sqlite3_rtree_dbl
|
||||
apSqlParam uintptr
|
||||
} /* sqlite3.h:10097:9 */
|
||||
} /* sqlite3.h:9958:9 */
|
||||
|
||||
type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:10097:41 */
|
||||
type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9958:41 */
|
||||
|
||||
// The double-precision datatype used by RTree depends on the
|
||||
// SQLITE_RTREE_INT_ONLY compile-time option.
|
||||
type sqlite3_rtree_dbl = float64 /* sqlite3.h:10105:18 */
|
||||
type sqlite3_rtree_dbl = float64 /* sqlite3.h:9966:18 */
|
||||
|
||||
// CAPI3REF: Values for sqlite3session_config().
|
||||
|
||||
@ -3451,7 +3422,7 @@ type Fts5ExtensionApi1 = struct {
|
||||
xPhraseNext uintptr
|
||||
xPhraseFirstColumn uintptr
|
||||
xPhraseNextColumn uintptr
|
||||
} /* sqlite3.h:11952:9 */
|
||||
} /* sqlite3.h:11813:9 */
|
||||
|
||||
// CAPI3REF: Values for sqlite3session_config().
|
||||
|
||||
@ -3483,22 +3454,22 @@ type Fts5ExtensionApi1 = struct {
|
||||
// Virtual table implementations may overload SQL functions by implementing
|
||||
// the sqlite3_module.xFindFunction() method.
|
||||
|
||||
type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11952:33 */
|
||||
type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11813:33 */
|
||||
type Fts5PhraseIter1 = struct {
|
||||
a uintptr
|
||||
b uintptr
|
||||
} /* sqlite3.h:11954:9 */
|
||||
} /* sqlite3.h:11815:9 */
|
||||
|
||||
type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11954:31 */
|
||||
type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11815:31 */
|
||||
|
||||
type fts5_extension_function = uintptr /* sqlite3.h:11956:14 */
|
||||
type fts5_extension_function = uintptr /* sqlite3.h:11817:14 */
|
||||
type fts5_tokenizer1 = struct {
|
||||
xCreate uintptr
|
||||
xDelete uintptr
|
||||
xTokenize uintptr
|
||||
} /* sqlite3.h:12415:9 */
|
||||
} /* sqlite3.h:12276:9 */
|
||||
|
||||
type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12415:31 */
|
||||
type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12276:31 */
|
||||
|
||||
// Flags that may be passed as the third argument to xTokenize()
|
||||
|
||||
@ -3518,7 +3489,7 @@ type fts5_api1 = struct {
|
||||
xCreateTokenizer uintptr
|
||||
xFindTokenizer uintptr
|
||||
xCreateFunction uintptr
|
||||
} /* sqlite3.h:12451:9 */
|
||||
} /* sqlite3.h:12312:9 */
|
||||
|
||||
// Flags that may be passed as the third argument to xTokenize()
|
||||
|
||||
@ -3532,7 +3503,7 @@ type fts5_api1 = struct {
|
||||
// ************************************************************************
|
||||
//
|
||||
// FTS5 EXTENSION REGISTRATION API
|
||||
type fts5_api = fts5_api1 /* sqlite3.h:12451:25 */
|
||||
type fts5_api = fts5_api1 /* sqlite3.h:12312:25 */
|
||||
|
||||
// The tag name of this struct is _G_fpos_t to preserve historic
|
||||
// C++ mangled names for functions taking fpos_t arguments.
|
||||
@ -3989,7 +3960,7 @@ type fpos_t = _G_fpos64_t /* stdio.h:86:20 */
|
||||
|
||||
// Never include this file directly; use <sys/types.h> instead.
|
||||
|
||||
// Copyright (C) 1989-2020 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of GCC.
|
||||
//
|
||||
@ -4514,7 +4485,7 @@ type time_t = int64 /* time_t.h:7:18 */
|
||||
// Timer ID returned by `timer_create'.
|
||||
type timer_t = uintptr /* timer_t.h:7:19 */
|
||||
|
||||
// Copyright (C) 1989-2020 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of GCC.
|
||||
//
|
||||
@ -6385,11 +6356,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */) != 0 {
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-06-18 18:36..." */) != 0 {
|
||||
libc.Xfprintf(tls, libc.Xstderr,
|
||||
|
||||
ts+2415, /* "SQLite library a..." */
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-11-27 14:13..." */))
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-06-18 18:36..." */))
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
|
||||
@ -6448,7 +6419,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
|
||||
}
|
||||
libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
|
||||
libc.Xprintf(tls, ts+2617 /* "With SQLite 3.37..." */, 0)
|
||||
libc.Xprintf(tls, ts+2617 /* "With SQLite 3.36..." */, 0)
|
||||
for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
|
||||
libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
|
||||
}
|
||||
@ -6595,5 +6566,5 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
return (libc.Bool32(g.nError > 0))
|
||||
}
|
||||
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.36.0 2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Code generated by 'ccgo -export-defines "" -o internal/mptest/main_windows_amd64.go -trace-translation-units testdata/sqlite-src-3370000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3370000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_WIN=1 -D_MSC_VER=1900', DO NOT EDIT.
|
||||
// Code generated by 'ccgo -export-defines "" -o internal/mptest/main_windows_amd64.go -trace-translation-units testdata/sqlite-src-3360000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3360000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_WIN=1 -D_MSC_VER=1900', DO NOT EDIT.
|
||||
|
||||
package main
|
||||
|
||||
@ -17,7 +17,6 @@ var _ = math.Pi
|
||||
var _ reflect.Kind
|
||||
var _ atomic.Value
|
||||
var _ unsafe.Pointer
|
||||
var _ *libc.TLS
|
||||
var _ types.Size_t
|
||||
|
||||
func main() { libc.Start(main1) }
|
||||
@ -8955,7 +8954,6 @@ const (
|
||||
SQLITE_CONSTRAINT = 19
|
||||
SQLITE_CONSTRAINT_CHECK = 275
|
||||
SQLITE_CONSTRAINT_COMMITHOOK = 531
|
||||
SQLITE_CONSTRAINT_DATATYPE = 3091
|
||||
SQLITE_CONSTRAINT_FOREIGNKEY = 787
|
||||
SQLITE_CONSTRAINT_FUNCTION = 1043
|
||||
SQLITE_CONSTRAINT_NOTNULL = 1299
|
||||
@ -9226,7 +9224,6 @@ const (
|
||||
SQLITE_OPEN_CREATE = 0x00000004
|
||||
SQLITE_OPEN_DELETEONCLOSE = 0x00000008
|
||||
SQLITE_OPEN_EXCLUSIVE = 0x00000010
|
||||
SQLITE_OPEN_EXRESCODE = 0x02000000
|
||||
SQLITE_OPEN_FULLMUTEX = 0x00010000
|
||||
SQLITE_OPEN_MAIN_DB = 0x00000100
|
||||
SQLITE_OPEN_MAIN_JOURNAL = 0x00000800
|
||||
@ -9285,7 +9282,7 @@ const (
|
||||
SQLITE_SHM_SHARED = 4
|
||||
SQLITE_SHM_UNLOCK = 1
|
||||
SQLITE_SOUNDEX = 1
|
||||
SQLITE_SOURCE_ID = "2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a"
|
||||
SQLITE_SOURCE_ID = "2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5"
|
||||
SQLITE_STATUS_MALLOC_COUNT = 9
|
||||
SQLITE_STATUS_MALLOC_SIZE = 5
|
||||
SQLITE_STATUS_MEMORY_USED = 0
|
||||
@ -9358,8 +9355,8 @@ const (
|
||||
SQLITE_UTF16LE = 2
|
||||
SQLITE_UTF16_ALIGNED = 8
|
||||
SQLITE_UTF8 = 1
|
||||
SQLITE_VERSION = "3.37.0"
|
||||
SQLITE_VERSION_NUMBER = 3037000
|
||||
SQLITE_VERSION = "3.36.0"
|
||||
SQLITE_VERSION_NUMBER = 3036000
|
||||
SQLITE_VTAB_CONSTRAINT_SUPPORT = 1
|
||||
SQLITE_VTAB_DIRECTONLY = 3
|
||||
SQLITE_VTAB_INNOCUOUS = 2
|
||||
@ -13003,15 +13000,15 @@ type va_list = uintptr /* <builtin>:50:27 */
|
||||
// between -9223372036854775808 and +9223372036854775807 inclusive. ^The
|
||||
// sqlite3_uint64 and sqlite_uint64 types can store integer values
|
||||
// between 0 and +18446744073709551615 inclusive.
|
||||
type sqlite_int64 = int64 /* sqlite3.h:298:19 */
|
||||
type sqlite_uint64 = uint64 /* sqlite3.h:299:28 */
|
||||
type sqlite3_int64 = sqlite_int64 /* sqlite3.h:304:22 */
|
||||
type sqlite3_uint64 = sqlite_uint64 /* sqlite3.h:305:23 */
|
||||
type sqlite_int64 = int64 /* sqlite3.h:275:19 */
|
||||
type sqlite_uint64 = uint64 /* sqlite3.h:276:28 */
|
||||
type sqlite3_int64 = sqlite_int64 /* sqlite3.h:281:22 */
|
||||
type sqlite3_uint64 = sqlite_uint64 /* sqlite3.h:282:23 */
|
||||
|
||||
// The type for a callback function.
|
||||
// This is legacy and deprecated. It is included for historical
|
||||
// compatibility and is not documented.
|
||||
type sqlite3_callback = uintptr /* sqlite3.h:361:13 */
|
||||
type sqlite3_callback = uintptr /* sqlite3.h:338:13 */
|
||||
|
||||
// CAPI3REF: Result Codes
|
||||
// KEYWORDS: {result code definitions}
|
||||
@ -13046,19 +13043,6 @@ type sqlite3_callback = uintptr /* sqlite3.h:361:13 */
|
||||
// These bit values are intended for use in the
|
||||
// 3rd parameter to the [sqlite3_open_v2()] interface and
|
||||
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
|
||||
//
|
||||
// Only those flags marked as "Ok for sqlite3_open_v2()" may be
|
||||
// used as the third argument to the [sqlite3_open_v2()] interface.
|
||||
// The other flags have historically been ignored by sqlite3_open_v2(),
|
||||
// though future versions of SQLite might change so that an error is
|
||||
// raised if any of the disallowed bits are passed into sqlite3_open_v2().
|
||||
// Applications should not depend on the historical behavior.
|
||||
//
|
||||
// Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
|
||||
// [sqlite3_open_v2()] does *not* cause the underlying database file
|
||||
// to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
|
||||
// [sqlite3_open_v2()] has historically be a no-op and might become an
|
||||
// error in future versions of SQLite.
|
||||
|
||||
// Reserved: 0x00F00000
|
||||
// Legacy compatibility:
|
||||
@ -13135,7 +13119,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:361:13 */
|
||||
// for their own use. The pMethods entry is a pointer to an
|
||||
// [sqlite3_io_methods] object that defines methods for performing
|
||||
// I/O operations on the open file.
|
||||
type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:722:9 */
|
||||
type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:684:9 */
|
||||
|
||||
// CAPI3REF: Result Codes
|
||||
// KEYWORDS: {result code definitions}
|
||||
@ -13170,19 +13154,6 @@ type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:722:9 */
|
||||
// These bit values are intended for use in the
|
||||
// 3rd parameter to the [sqlite3_open_v2()] interface and
|
||||
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
|
||||
//
|
||||
// Only those flags marked as "Ok for sqlite3_open_v2()" may be
|
||||
// used as the third argument to the [sqlite3_open_v2()] interface.
|
||||
// The other flags have historically been ignored by sqlite3_open_v2(),
|
||||
// though future versions of SQLite might change so that an error is
|
||||
// raised if any of the disallowed bits are passed into sqlite3_open_v2().
|
||||
// Applications should not depend on the historical behavior.
|
||||
//
|
||||
// Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
|
||||
// [sqlite3_open_v2()] does *not* cause the underlying database file
|
||||
// to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
|
||||
// [sqlite3_open_v2()] has historically be a no-op and might become an
|
||||
// error in future versions of SQLite.
|
||||
|
||||
// Reserved: 0x00F00000
|
||||
// Legacy compatibility:
|
||||
@ -13259,7 +13230,7 @@ type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:722:9 */
|
||||
// for their own use. The pMethods entry is a pointer to an
|
||||
// [sqlite3_io_methods] object that defines methods for performing
|
||||
// I/O operations on the open file.
|
||||
type sqlite3_file = sqlite3_file1 /* sqlite3.h:722:29 */
|
||||
type sqlite3_file = sqlite3_file1 /* sqlite3.h:684:29 */
|
||||
type sqlite3_io_methods1 = struct {
|
||||
iVersion int32
|
||||
_ [4]byte
|
||||
@ -13281,7 +13252,7 @@ type sqlite3_io_methods1 = struct {
|
||||
xShmUnmap uintptr
|
||||
xFetch uintptr
|
||||
xUnfetch uintptr
|
||||
} /* sqlite3.h:722:9 */
|
||||
} /* sqlite3.h:684:9 */
|
||||
|
||||
// CAPI3REF: OS Interface File Virtual Methods Object
|
||||
//
|
||||
@ -13375,7 +13346,7 @@ type sqlite3_io_methods1 = struct {
|
||||
// fails to zero-fill short reads might seem to work. However,
|
||||
// failure to zero-fill short reads will eventually lead to
|
||||
// database corruption.
|
||||
type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:821:35 */
|
||||
type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:783:35 */
|
||||
|
||||
// CAPI3REF: OS Interface Object
|
||||
//
|
||||
@ -13568,7 +13539,7 @@ type sqlite3_vfs1 = struct {
|
||||
xSetSystemCall uintptr
|
||||
xGetSystemCall uintptr
|
||||
xNextSystemCall uintptr
|
||||
} /* sqlite3.h:1425:9 */
|
||||
} /* sqlite3.h:1387:9 */
|
||||
|
||||
// CAPI3REF: OS Interface Object
|
||||
//
|
||||
@ -13737,8 +13708,8 @@ type sqlite3_vfs1 = struct {
|
||||
// or all of these interfaces to be NULL or for their behavior to change
|
||||
// from one release to the next. Applications must not attempt to access
|
||||
// any of these methods if the iVersion of the VFS is less than 3.
|
||||
type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1425:28 */
|
||||
type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1426:14 */
|
||||
type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1387:28 */
|
||||
type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1388:14 */
|
||||
|
||||
// CAPI3REF: Memory Allocation Routines
|
||||
//
|
||||
@ -13810,7 +13781,7 @@ type sqlite3_mem_methods1 = struct {
|
||||
xInit uintptr
|
||||
xShutdown uintptr
|
||||
pAppData uintptr
|
||||
} /* sqlite3.h:1723:9 */
|
||||
} /* sqlite3.h:1685:9 */
|
||||
|
||||
// CAPI3REF: Memory Allocation Routines
|
||||
//
|
||||
@ -13873,7 +13844,7 @@ type sqlite3_mem_methods1 = struct {
|
||||
//
|
||||
// SQLite will never invoke xInit() more than once without an intervening
|
||||
// call to xShutdown().
|
||||
type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1723:36 */
|
||||
type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1685:36 */
|
||||
|
||||
// CAPI3REF: Constants Defining Special Destructor Behavior
|
||||
//
|
||||
@ -13887,7 +13858,7 @@ type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1723:36 */
|
||||
//
|
||||
// The typedef is necessary to work around problems in certain
|
||||
// C++ compilers.
|
||||
type sqlite3_destructor_type = uintptr /* sqlite3.h:5733:14 */
|
||||
type sqlite3_destructor_type = uintptr /* sqlite3.h:5665:14 */
|
||||
|
||||
// The interface to the virtual-table mechanism is currently considered
|
||||
// to be experimental. The interface might change in incompatible ways.
|
||||
@ -13902,7 +13873,7 @@ type sqlite3_vtab1 = struct {
|
||||
nRef int32
|
||||
_ [4]byte
|
||||
zErrMsg uintptr
|
||||
} /* sqlite3.h:6918:9 */
|
||||
} /* sqlite3.h:6784:9 */
|
||||
|
||||
// The interface to the virtual-table mechanism is currently considered
|
||||
// to be experimental. The interface might change in incompatible ways.
|
||||
@ -13912,7 +13883,7 @@ type sqlite3_vtab1 = struct {
|
||||
// interface fixed, support it indefinitely, and remove this comment.
|
||||
|
||||
// Structures used by the virtual table interface
|
||||
type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6918:29 */
|
||||
type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6784:29 */
|
||||
type sqlite3_index_info1 = struct {
|
||||
nConstraint int32
|
||||
_ [4]byte
|
||||
@ -13931,12 +13902,12 @@ type sqlite3_index_info1 = struct {
|
||||
idxFlags int32
|
||||
_ [4]byte
|
||||
colUsed sqlite3_uint64
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6919:35 */
|
||||
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6920:9 */
|
||||
type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6785:35 */
|
||||
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6786:9 */
|
||||
|
||||
type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6920:36 */
|
||||
type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6786:36 */
|
||||
type sqlite3_module1 = struct {
|
||||
iVersion int32
|
||||
_ [4]byte
|
||||
@ -13963,9 +13934,9 @@ type sqlite3_module1 = struct {
|
||||
xRelease uintptr
|
||||
xRollbackTo uintptr
|
||||
xShadowName uintptr
|
||||
} /* sqlite3.h:6918:9 */
|
||||
} /* sqlite3.h:6784:9 */
|
||||
|
||||
type sqlite3_module = sqlite3_module1 /* sqlite3.h:6921:31 */
|
||||
type sqlite3_module = sqlite3_module1 /* sqlite3.h:6787:31 */
|
||||
|
||||
// CAPI3REF: Virtual Table Indexing Information
|
||||
// KEYWORDS: sqlite3_index_info
|
||||
@ -14073,7 +14044,7 @@ type sqlite3_index_constraint = struct {
|
||||
usable uint8
|
||||
_ [2]byte
|
||||
iTermOffset int32
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
// CAPI3REF: Virtual Table Indexing Information
|
||||
// KEYWORDS: sqlite3_index_info
|
||||
@ -14179,7 +14150,7 @@ type sqlite3_index_orderby = struct {
|
||||
iColumn int32
|
||||
desc uint8
|
||||
_ [3]byte
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
// CAPI3REF: Virtual Table Indexing Information
|
||||
// KEYWORDS: sqlite3_index_info
|
||||
@ -14285,7 +14256,7 @@ type sqlite3_index_constraint_usage = struct {
|
||||
argvIndex int32
|
||||
omit uint8
|
||||
_ [3]byte
|
||||
} /* sqlite3.h:6919:9 */
|
||||
} /* sqlite3.h:6785:9 */
|
||||
|
||||
// CAPI3REF: Mutex Methods Object
|
||||
//
|
||||
@ -14360,7 +14331,7 @@ type sqlite3_mutex_methods1 = struct {
|
||||
xMutexLeave uintptr
|
||||
xMutexHeld uintptr
|
||||
xMutexNotheld uintptr
|
||||
} /* sqlite3.h:7753:9 */
|
||||
} /* sqlite3.h:7619:9 */
|
||||
|
||||
// CAPI3REF: Mutex Methods Object
|
||||
//
|
||||
@ -14425,7 +14396,7 @@ type sqlite3_mutex_methods1 = struct {
|
||||
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
|
||||
// If xMutexInit fails in any way, it is expected to clean up after itself
|
||||
// prior to returning.
|
||||
type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7753:38 */
|
||||
type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7619:38 */
|
||||
|
||||
// CAPI3REF: Custom Page Cache Object
|
||||
//
|
||||
@ -14438,7 +14409,7 @@ type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7753:38 */
|
||||
type sqlite3_pcache_page1 = struct {
|
||||
pBuf uintptr
|
||||
pExtra uintptr
|
||||
} /* sqlite3.h:8509:9 */
|
||||
} /* sqlite3.h:8375:9 */
|
||||
|
||||
// CAPI3REF: Custom Page Cache Object
|
||||
//
|
||||
@ -14448,7 +14419,7 @@ type sqlite3_pcache_page1 = struct {
|
||||
// of this object as parameters or as their return value.
|
||||
//
|
||||
// See [sqlite3_pcache_methods2] for additional information.
|
||||
type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8509:36 */
|
||||
type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8375:36 */
|
||||
|
||||
// CAPI3REF: Application Defined Page Cache.
|
||||
// KEYWORDS: {page cache}
|
||||
@ -14622,7 +14593,7 @@ type sqlite3_pcache_methods21 = struct {
|
||||
xTruncate uintptr
|
||||
xDestroy uintptr
|
||||
xShrink uintptr
|
||||
} /* sqlite3.h:8674:9 */
|
||||
} /* sqlite3.h:8540:9 */
|
||||
|
||||
// CAPI3REF: Application Defined Page Cache.
|
||||
// KEYWORDS: {page cache}
|
||||
@ -14781,7 +14752,7 @@ type sqlite3_pcache_methods21 = struct {
|
||||
// free up as much of heap memory as possible. The page cache implementation
|
||||
// is not obligated to free any memory, but well-behaved implementations should
|
||||
// do their best.
|
||||
type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8674:40 */
|
||||
type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8540:40 */
|
||||
|
||||
// This is the obsolete pcache_methods object that has now been replaced
|
||||
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
|
||||
@ -14798,12 +14769,12 @@ type sqlite3_pcache_methods1 = struct {
|
||||
xRekey uintptr
|
||||
xTruncate uintptr
|
||||
xDestroy uintptr
|
||||
} /* sqlite3.h:8697:9 */
|
||||
} /* sqlite3.h:8563:9 */
|
||||
|
||||
// This is the obsolete pcache_methods object that has now been replaced
|
||||
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
|
||||
// retained in the header file for backwards compatibility only.
|
||||
type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8697:39 */
|
||||
type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8563:39 */
|
||||
|
||||
// CAPI3REF: Database Snapshot
|
||||
// KEYWORDS: {snapshot} {sqlite3_snapshot}
|
||||
@ -14823,7 +14794,7 @@ type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8697:39 */
|
||||
// version of the database file so that it is possible to later open a new read
|
||||
// transaction that sees that historical version of the database rather than
|
||||
// the most recent version.
|
||||
type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9765:9 */
|
||||
type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9630:9 */
|
||||
|
||||
// CAPI3REF: Database Snapshot
|
||||
// KEYWORDS: {snapshot} {sqlite3_snapshot}
|
||||
@ -14843,7 +14814,7 @@ type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9765:9 */
|
||||
// version of the database file so that it is possible to later open a new read
|
||||
// transaction that sees that historical version of the database rather than
|
||||
// the most recent version.
|
||||
type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9767:3 */
|
||||
type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9632:3 */
|
||||
|
||||
// CAPI3REF: Flags for sqlite3_deserialize()
|
||||
//
|
||||
@ -14887,7 +14858,7 @@ type sqlite3_rtree_geometry1 = struct {
|
||||
aParam uintptr
|
||||
pUser uintptr
|
||||
xDelUser uintptr
|
||||
} /* sqlite3.h:10096:9 */
|
||||
} /* sqlite3.h:9957:9 */
|
||||
|
||||
// CAPI3REF: Flags for sqlite3_deserialize()
|
||||
//
|
||||
@ -14924,7 +14895,7 @@ type sqlite3_rtree_geometry1 = struct {
|
||||
//
|
||||
//
|
||||
|
||||
type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:10096:39 */
|
||||
type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9957:39 */
|
||||
type sqlite3_rtree_query_info1 = struct {
|
||||
pContext uintptr
|
||||
nParam int32
|
||||
@ -14944,13 +14915,13 @@ type sqlite3_rtree_query_info1 = struct {
|
||||
eWithin int32
|
||||
rScore sqlite3_rtree_dbl
|
||||
apSqlParam uintptr
|
||||
} /* sqlite3.h:10097:9 */
|
||||
} /* sqlite3.h:9958:9 */
|
||||
|
||||
type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:10097:41 */
|
||||
type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9958:41 */
|
||||
|
||||
// The double-precision datatype used by RTree depends on the
|
||||
// SQLITE_RTREE_INT_ONLY compile-time option.
|
||||
type sqlite3_rtree_dbl = float64 /* sqlite3.h:10105:18 */
|
||||
type sqlite3_rtree_dbl = float64 /* sqlite3.h:9966:18 */
|
||||
|
||||
// CAPI3REF: Values for sqlite3session_config().
|
||||
|
||||
@ -15004,7 +14975,7 @@ type Fts5ExtensionApi1 = struct {
|
||||
xPhraseNext uintptr
|
||||
xPhraseFirstColumn uintptr
|
||||
xPhraseNextColumn uintptr
|
||||
} /* sqlite3.h:11952:9 */
|
||||
} /* sqlite3.h:11813:9 */
|
||||
|
||||
// CAPI3REF: Values for sqlite3session_config().
|
||||
|
||||
@ -15036,22 +15007,22 @@ type Fts5ExtensionApi1 = struct {
|
||||
// Virtual table implementations may overload SQL functions by implementing
|
||||
// the sqlite3_module.xFindFunction() method.
|
||||
|
||||
type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11952:33 */
|
||||
type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11813:33 */
|
||||
type Fts5PhraseIter1 = struct {
|
||||
a uintptr
|
||||
b uintptr
|
||||
} /* sqlite3.h:11954:9 */
|
||||
} /* sqlite3.h:11815:9 */
|
||||
|
||||
type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11954:31 */
|
||||
type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11815:31 */
|
||||
|
||||
type fts5_extension_function = uintptr /* sqlite3.h:11956:14 */
|
||||
type fts5_extension_function = uintptr /* sqlite3.h:11817:14 */
|
||||
type fts5_tokenizer1 = struct {
|
||||
xCreate uintptr
|
||||
xDelete uintptr
|
||||
xTokenize uintptr
|
||||
} /* sqlite3.h:12415:9 */
|
||||
} /* sqlite3.h:12276:9 */
|
||||
|
||||
type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12415:31 */
|
||||
type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12276:31 */
|
||||
|
||||
// Flags that may be passed as the third argument to xTokenize()
|
||||
|
||||
@ -15071,7 +15042,7 @@ type fts5_api1 = struct {
|
||||
xCreateTokenizer uintptr
|
||||
xFindTokenizer uintptr
|
||||
xCreateFunction uintptr
|
||||
} /* sqlite3.h:12451:9 */
|
||||
} /* sqlite3.h:12312:9 */
|
||||
|
||||
// Flags that may be passed as the third argument to xTokenize()
|
||||
|
||||
@ -15085,7 +15056,7 @@ type fts5_api1 = struct {
|
||||
// ************************************************************************
|
||||
//
|
||||
// FTS5 EXTENSION REGISTRATION API
|
||||
type fts5_api = fts5_api1 /* sqlite3.h:12451:25 */
|
||||
type fts5_api = fts5_api1 /* sqlite3.h:12312:25 */
|
||||
|
||||
type ssize_t = int64 /* corecrt.h:50:35 */
|
||||
|
||||
@ -28158,11 +28129,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
if strglob(tls, ts+2327 /* "*.test" */, g.zDbFile) != 0 {
|
||||
usage(tls, *(*uintptr)(unsafe.Pointer(argv)))
|
||||
}
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2334 /* "2021-11-27 14:13..." */) != 0 {
|
||||
if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2334 /* "2021-06-18 18:36..." */) != 0 {
|
||||
fprintf(tls, libc.X__acrt_iob_func(tls, uint32(2)),
|
||||
|
||||
ts+2419, /* "SQLite library a..." */
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2334 /* "2021-11-27 14:13..." */))
|
||||
libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2334 /* "2021-06-18 18:36..." */))
|
||||
libc.Xexit(tls, 1)
|
||||
}
|
||||
*(*int32)(unsafe.Pointer(bp + 240 /* n */)) = (argc - 2)
|
||||
@ -28221,7 +28192,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
printf(tls, ts+2321 /* " %s" */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
|
||||
}
|
||||
printf(tls, ts+2325 /* "\n" */, 0)
|
||||
printf(tls, ts+2621 /* "With SQLite 3.37..." */, 0)
|
||||
printf(tls, ts+2621 /* "With SQLite 3.36..." */, 0)
|
||||
for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
|
||||
printf(tls, ts+2726 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
|
||||
}
|
||||
@ -28373,5 +28344,5 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
|
||||
return (libc.Bool32(g.nError > 0))
|
||||
}
|
||||
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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')\x00CreateProcessA() fails with error code %lu\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00persist\x00truncate\x00Changing journal mode to DELETE from %s\x00DELETE\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\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\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\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')\x00CreateProcessA() fails with error code %lu\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\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\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\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\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.36.0 2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00persist\x00truncate\x00Changing journal mode to DELETE from %s\x00DELETE\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;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
|
||||
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user